summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index e927447739e..62eaac7a2f0 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -238,16 +238,13 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage())
Res |= BasicSymbolRef::SF_Weak;
- if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
+ if (GV->getName().startswith("llvm."))
+ Res |= BasicSymbolRef::SF_FormatSpecific;
+ else if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
if (Var->getSection() == StringRef("llvm.metadata"))
Res |= BasicSymbolRef::SF_FormatSpecific;
}
- if (auto *F = dyn_cast<Function>(GV)) {
- if (F->getName().startswith("llvm."))
- Res |= BasicSymbolRef::SF_FormatSpecific;
- }
-
return Res;
}
OpenPOWER on IntegriCloud