diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-26 07:17:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-26 07:17:39 +0000 |
commit | d2e0220cb411126637d0f9ff3262a33201d37385 (patch) | |
tree | d8f30306e81a81a9a799f40bed24848cd9311c4c | |
parent | 9db3a9286dffef34029026654f5726bb8864b434 (diff) | |
download | bcm5719-llvm-d2e0220cb411126637d0f9ff3262a33201d37385.tar.gz bcm5719-llvm-d2e0220cb411126637d0f9ff3262a33201d37385.zip |
simplify SectionFlagsForGlobal, even though I want to kill it.
llvm-svn: 77143
-rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index bde119dedc7..b0aeff6f84a 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -199,11 +199,10 @@ static bool isConstantString(const Constant *C) { return false; } -static unsigned SectionFlagsForGlobal(const GlobalValue *GV, - SectionKind Kind) { +static unsigned SectionFlagsForGlobal(SectionKind Kind) { // Decode flags from global and section kind. unsigned Flags = SectionFlags::None; - if (GV->isWeakForLinker()) + if (Kind.isWeak()) Flags |= SectionFlags::Linkonce; if (Kind.isBSS() || Kind.isThreadBSS()) Flags |= SectionFlags::BSS; @@ -328,7 +327,7 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { return TS; // Honour section already set, if any. - unsigned Flags = SectionFlagsForGlobal(GV, Kind); + unsigned Flags = SectionFlagsForGlobal(Kind); // This is an explicitly named section. Flags |= SectionFlags::Named; @@ -343,9 +342,9 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { // If this global is linkonce/weak and the target handles this by emitting it // into a 'uniqued' section name, create and return the section now. - if (GV->isWeakForLinker()) { + if (Kind.isWeak()) { if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) { - unsigned Flags = SectionFlagsForGlobal(GV, Kind); + unsigned Flags = SectionFlagsForGlobal(Kind); // FIXME: Use mangler interface (PR4584). std::string Name = Prefix+GV->getNameStr(); |