diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:16:59 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:16:59 +0000 |
commit | beb9d409006abd85ab7a9c1632fdb1d6ad9e6cdd (patch) | |
tree | 3dc99e3a28cd983861814a1b518c9282ea56cbdc /include/llvm/Target | |
parent | dd1c20d2580236280694a22264fa26b36cb8fbe6 (diff) | |
download | external_llvm-beb9d409006abd85ab7a9c1632fdb1d6ad9e6cdd.zip external_llvm-beb9d409006abd85ab7a9c1632fdb1d6ad9e6cdd.tar.gz external_llvm-beb9d409006abd85ab7a9c1632fdb1d6ad9e6cdd.tar.bz2 |
Add code for default section falgs computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index bf4fd10..65c0df4 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -30,6 +30,7 @@ namespace llvm { namespace SectionKind { enum Kind { + Unknown = 0, ///< Custom section Text, ///< Text section Data, ///< Data section BSS, ///< BSS section @@ -41,6 +42,25 @@ namespace llvm { }; } + namespace SectionFlags { + enum Flags { + None = 0, + Code = 1 << 0, ///< Section contains code + Writeable = 1 << 1, ///< Section is writeable + BSS = 1 << 2, ///< Section contains only zeroes + Mergeable = 1 << 3, ///< Section contains mergeable data + Strings = 1 << 4, ///< Section contains null-terminated strings + TLS = 1 << 5, ///< Section contains thread-local data + Debug = 1 << 6, ///< Section contains debug data + Linkonce = 1 << 7 ///< Section is linkonce + }; + } + + struct SectionInfo { + SectionKind::Kind kind; + SectionFlags::Flags flags; + }; + class TargetMachine; class CallInst; class GlobalValue; @@ -444,6 +464,13 @@ namespace llvm { /// section kind used for global emission. SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const; + + /// SectionFlagsForGlobal - This hook allows the target to select proper + /// section flags either for given global or for section. + unsigned + SectionFlagsForGlobal(const GlobalValue *GV = NULL, + const char* name = NULL); + // Accessors. // const char *getTextSection() const { |