[llvm-commits] [llvm] r76975 - /llvm/trunk/lib/Target/TargetAsmInfo.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 24 09:53:53 PDT 2009
Author: lattner
Date: Fri Jul 24 11:53:52 2009
New Revision: 76975
URL: http://llvm.org/viewvc/llvm-project?rev=76975&view=rev
Log:
tidy up
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=76975&r1=76974&r2=76975&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Fri Jul 24 11:53:52 2009
@@ -251,10 +251,10 @@
SectionKind::Kind
TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
// Early exit - functions should be always in text sections.
- if (isa<Function>(GV))
+ const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
+ if (GVar == 0)
return SectionKind::Text;
- const GlobalVariable* GVar = dyn_cast<GlobalVariable>(GV);
bool isThreadLocal = GVar->isThreadLocal();
assert(GVar && "Invalid global value for section selection");
@@ -308,9 +308,10 @@
if (GV->isWeakForLinker()) {
if (const char *Prefix =
getSectionPrefixForUniqueGlobal(SectionKindForGlobal(GV))) {
+ unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV));
+
// FIXME: Use mangler interface (PR4584).
std::string Name = Prefix+GV->getNameStr();
- unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV));
return getNamedSection(Name.c_str(), Flags);
}
}
More information about the llvm-commits
mailing list