aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-24 16:53:52 +0000
committerChris Lattner <sabre@nondot.org>2009-07-24 16:53:52 +0000
commite5ca0ac36be44057ba5a5ad300c685b7967ff5ec (patch)
tree9cd724dc595fb0bcba1610b844fc7b08c98663de /lib/Target/TargetAsmInfo.cpp
parent27f3065cf36fc93f619f25862288513b13d8bb95 (diff)
downloadexternal_llvm-e5ca0ac36be44057ba5a5ad300c685b7967ff5ec.zip
external_llvm-e5ca0ac36be44057ba5a5ad300c685b7967ff5ec.tar.gz
external_llvm-e5ca0ac36be44057ba5a5ad300c685b7967ff5ec.tar.bz2
tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetAsmInfo.cpp')
-rw-r--r--lib/Target/TargetAsmInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 829bb90..b3eaadc 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -251,10 +251,10 @@ static unsigned GetSectionFlagsForNamedELFSection(const char *Name) {
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 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
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);
}
}