aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-22 00:28:43 +0000
committerChris Lattner <sabre@nondot.org>2009-07-22 00:28:43 +0000
commit298414ec1891ce8d3a1b69e6019ad8765c8e69dc (patch)
tree603a6eb1a17ad2fa32f99daa34a77c5e7e42de9f /include
parentfc6ad402fb267cba1625801444aad30da43d383a (diff)
remove the SelectSectionForMachineConst hook, replacing it with
a new getSectionForMergableConstant hook. This removes one dependence of TAI on Type, and provides the hook with enough info to make the right decision based on whether the global has relocations etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/DarwinTargetAsmInfo.h5
-rw-r--r--include/llvm/Target/ELFTargetAsmInfo.h9
-rw-r--r--include/llvm/Target/TargetAsmInfo.h9
3 files changed, 19 insertions, 4 deletions
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h
index 8eef95dfa4..edce64096a 100644
--- a/include/llvm/Target/DarwinTargetAsmInfo.h
+++ b/include/llvm/Target/DarwinTargetAsmInfo.h
@@ -39,7 +39,10 @@ namespace llvm {
SectionKind::Kind kind) const;
virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
Mangler *Mang) const;
- const Section* SelectSectionForMachineConst(const Type *Ty) const;
+
+
+ virtual const Section *
+ getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
private:
const Section* MergeableConstSection(const Type *Ty) const;
diff --git a/include/llvm/Target/ELFTargetAsmInfo.h b/include/llvm/Target/ELFTargetAsmInfo.h
index fd269a1430..c06a5a9f28 100644
--- a/include/llvm/Target/ELFTargetAsmInfo.h
+++ b/include/llvm/Target/ELFTargetAsmInfo.h
@@ -25,11 +25,16 @@ namespace llvm {
struct ELFTargetAsmInfo: public TargetAsmInfo {
explicit ELFTargetAsmInfo(const TargetMachine &TM);
+ /// getSectionForMergableConstant - Given a mergable constant with the
+ /// specified size and relocation information, return a section that it
+ /// should be placed in.
+ virtual const Section *
+ getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
+
+
SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
virtual std::string printSectionFlags(unsigned flags) const;
- virtual const Section*
- SelectSectionForMachineConst(const Type *Ty) const;
const Section* DataRelSection;
const Section* DataRelLocalSection;
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h
index e59b12a7cd..0140433413 100644
--- a/include/llvm/Target/TargetAsmInfo.h
+++ b/include/llvm/Target/TargetAsmInfo.h
@@ -595,6 +595,14 @@ namespace llvm {
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;
+
+ /// getSectionForMergableConstant - Given a mergable constant with the
+ /// specified size and relocation information, return a section that it
+ /// should be placed in.
+ virtual const Section *
+ getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
+
+
/// SectionKindForGlobal - This hook allows the target to select proper
/// section kind used for global emission.
// FIXME: Eliminate this.
@@ -623,7 +631,6 @@ namespace llvm {
// FIXME: Eliminate this.
virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
- virtual const Section* SelectSectionForMachineConst(const Type *Ty) const;
/// getSLEB128Size - Compute the number of bytes required for a signed
/// leb128 value.