diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-24 16:46:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-24 16:46:50 +0000 |
commit | 8adc547a91b423472148877ca5a4b5b5a0fd2f64 (patch) | |
tree | 7d4dadb8b31586f33ded6226d860b600c06fa47d | |
parent | 104bbd10e497a5bcae7d03813d5a838c8cec23d3 (diff) |
make SectionFlagsForGlobal a private static function instead of a public
virtual one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76973 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 7 | ||||
-rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 12 |
2 files changed, 6 insertions, 13 deletions
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index 63afe9bd6a..42545c62fc 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -595,13 +595,6 @@ namespace llvm { virtual 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. -// FIXME: Eliminate this. - virtual unsigned - SectionFlagsForGlobal(const GlobalValue *GV = NULL, - const char* name = NULL) const; - /// SectionForGlobal - This hooks returns proper section name for given /// global with all necessary flags and marks. // FIXME: Eliminate this. diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 96e3e85636..6790ec9090 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -188,13 +188,12 @@ static bool isConstantString(const Constant *C) { return false; } -unsigned -TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV, - const char *Name) const { +static unsigned SectionFlagsForGlobal(const GlobalValue *GV, + SectionKind::Kind Kind, + const char *Name = 0) { unsigned Flags = SectionFlags::None; // Decode flags from global itself. - SectionKind::Kind Kind = SectionKindForGlobal(GV); switch (Kind) { case SectionKind::Text: Flags |= SectionFlags::Code; @@ -292,7 +291,8 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { // Select section name if (GV->hasSection()) { // Honour section already set, if any. - unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str()); + unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV), + GV->getSection().c_str()); return getNamedSection(GV->getSection().c_str(), Flags); } @@ -303,7 +303,7 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { getSectionPrefixForUniqueGlobal(SectionKindForGlobal(GV))) { // FIXME: Use mangler interface (PR4584). std::string Name = Prefix+GV->getNameStr(); - unsigned Flags = SectionFlagsForGlobal(GV); + unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV)); return getNamedSection(Name.c_str(), Flags); } } |