we already know the sectionkind when invoking SelectSectionForGlobal,
pass it in instead of recomputing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76990 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 1ed9a71..9893bf9 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -300,14 +300,13 @@
}
// Use default section depending on the 'type' of global
- return SelectSectionForGlobal(GV);
+ return SelectSectionForGlobal(GV, Kind);
}
// Lame default implementation. Calculate the section name for global.
const Section*
-TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
- SectionKind::Kind Kind = SectionKindForGlobal(GV);
-
+TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind::Kind Kind) const {
if (Kind == SectionKind::Text)
return getTextSection();