[PATCH] D65686: IR: Disable verifier check for GlobalValues with private linkage named after a comdat for non-COFF.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 14:46:44 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL368094: IR: Disable verifier check for GlobalValues with private linkage named after a… (authored by pcc, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D65686?vs=213431&id=213727#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65686/new/
https://reviews.llvm.org/D65686
Files:
llvm/trunk/lib/IR/Verifier.cpp
llvm/trunk/test/Verifier/comdat2.ll
Index: llvm/trunk/lib/IR/Verifier.cpp
===================================================================
--- llvm/trunk/lib/IR/Verifier.cpp
+++ llvm/trunk/lib/IR/Verifier.cpp
@@ -119,6 +119,7 @@
raw_ostream *OS;
const Module &M;
ModuleSlotTracker MST;
+ Triple TT;
const DataLayout &DL;
LLVMContext &Context;
@@ -130,7 +131,8 @@
bool TreatBrokenDebugInfoAsError = true;
explicit VerifierSupport(raw_ostream *OS, const Module &M)
- : OS(OS), M(M), MST(&M), DL(M.getDataLayout()), Context(M.getContext()) {}
+ : OS(OS), M(M), MST(&M), TT(M.getTargetTriple()), DL(M.getDataLayout()),
+ Context(M.getContext()) {}
private:
void Write(const Module *M) {
@@ -1306,11 +1308,12 @@
}
void Verifier::visitComdat(const Comdat &C) {
- // The Module is invalid if the GlobalValue has private linkage. Entities
- // with private linkage don't have entries in the symbol table.
- if (const GlobalValue *GV = M.getNamedValue(C.getName()))
- Assert(!GV->hasPrivateLinkage(), "comdat global value has private linkage",
- GV);
+ // In COFF the Module is invalid if the GlobalValue has private linkage.
+ // Entities with private linkage don't have entries in the symbol table.
+ if (TT.isOSBinFormatCOFF())
+ if (const GlobalValue *GV = M.getNamedValue(C.getName()))
+ Assert(!GV->hasPrivateLinkage(),
+ "comdat global value has private linkage", GV);
}
void Verifier::visitModuleIdents(const Module &M) {
Index: llvm/trunk/test/Verifier/comdat2.ll
===================================================================
--- llvm/trunk/test/Verifier/comdat2.ll
+++ llvm/trunk/test/Verifier/comdat2.ll
@@ -1,4 +1,6 @@
-; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+; RUN: llvm-as %s -o /dev/null
+; RUN: opt -mtriple=x86_64-unknown-linux -o /dev/null
+; RUN: not opt -mtriple=x86_64-pc-win32 %s -o /dev/null 2>&1 | FileCheck %s
$v = comdat any
@v = private global i32 0, comdat($v)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65686.213727.patch
Type: text/x-patch
Size: 1970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190806/1299a2b7/attachment.bin>
More information about the llvm-commits
mailing list