aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/LowerBitSets.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/LowerBitSets.cpp b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
index 1798d83..db5bab0 100644
--- a/llvm/lib/Transforms/IPO/LowerBitSets.cpp
+++ b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
@@ -639,8 +639,9 @@ void LowerBitSets::verifyBitSetMDNode(MDNode *Op) {
if (OpGlobal->isThreadLocal())
report_fatal_error("Bit set element may not be thread-local");
- if (OpGlobal->hasSection())
- report_fatal_error("Bit set element may not have an explicit section");
+ if (isa<GlobalVariable>(OpGlobal) && OpGlobal->hasSection())
+ report_fatal_error(
+ "Bit set global var element may not have an explicit section");
if (isa<GlobalVariable>(OpGlobal) && OpGlobal->isDeclarationForLinker())
report_fatal_error("Bit set global var element must be a definition");