Start refactoring of asmprinters: provide a TAI hook, which will select a 'section kind' for a global.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2008-06-28 13:45:57 +00:00
parent 4d580651b3
commit 28a2b54580
2 changed files with 69 additions and 2 deletions

View File

@@ -29,8 +29,22 @@ namespace llvm {
};
}
namespace SectionKind {
enum Kind {
Text, ///< Text section
Data, ///< Data section
BSS, ///< BSS section
ROData, ///< Readonly data section
RODataMergeStr, ///< Readonly data section (mergeable strings)
RODataMergeConst, ///< Readonly data section (mergeable constants)
ThreadData, ///< Initialized TLS data objects
ThreadBSS ///< Uninitialized TLS data objects
};
}
class TargetMachine;
class CallInst;
class GlobalValue;
/// TargetAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target.
@@ -427,7 +441,11 @@ namespace llvm {
/// if the symbol can be relocated.
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;
/// SectionKindForGlobal - This hook allows the target to select proper
/// section kind used for global emission.
SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
// Accessors.
//
const char *getTextSection() const {
@@ -642,7 +660,7 @@ namespace llvm {
}
const char *getDwarfSectionOffsetDirective() const {
return DwarfSectionOffsetDirective;
}
}
const char *getDwarfAbbrevSection() const {
return DwarfAbbrevSection;
}