aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target
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
commit680c6f69828e44b73f2dbea9922c35c8cd481f52 (patch)
tree603a6eb1a17ad2fa32f99daa34a77c5e7e42de9f /include/llvm/Target
parent5454456ad84ec6080b09188456f27493d9ca4b87 (diff)
downloadexternal_llvm-680c6f69828e44b73f2dbea9922c35c8cd481f52.zip
external_llvm-680c6f69828e44b73f2dbea9922c35c8cd481f52.tar.gz
external_llvm-680c6f69828e44b73f2dbea9922c35c8cd481f52.tar.bz2
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/llvm/Target')
-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 8eef95d..edce640 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 fd269a1..c06a5a9 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 e59b12a..0140433 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.