mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 23:29:51 +00:00
IR: Disable verifier check for GlobalValues with private linkage named after a comdat for non-COFF.
This check is only meaningful for COFF and it is perfectly valid to create such a GlobalValue in ELF. Differential Revision: https://reviews.llvm.org/D65686 llvm-svn: 368094
This commit is contained in:
parent
bcf0742f7f
commit
c7c99237df
@ -119,6 +119,7 @@ struct VerifierSupport {
|
|||||||
raw_ostream *OS;
|
raw_ostream *OS;
|
||||||
const Module &M;
|
const Module &M;
|
||||||
ModuleSlotTracker MST;
|
ModuleSlotTracker MST;
|
||||||
|
Triple TT;
|
||||||
const DataLayout &DL;
|
const DataLayout &DL;
|
||||||
LLVMContext &Context;
|
LLVMContext &Context;
|
||||||
|
|
||||||
@ -130,7 +131,8 @@ struct VerifierSupport {
|
|||||||
bool TreatBrokenDebugInfoAsError = true;
|
bool TreatBrokenDebugInfoAsError = true;
|
||||||
|
|
||||||
explicit VerifierSupport(raw_ostream *OS, const Module &M)
|
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:
|
private:
|
||||||
void Write(const Module *M) {
|
void Write(const Module *M) {
|
||||||
@ -1306,11 +1308,12 @@ void Verifier::visitDIImportedEntity(const DIImportedEntity &N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Verifier::visitComdat(const Comdat &C) {
|
void Verifier::visitComdat(const Comdat &C) {
|
||||||
// The Module is invalid if the GlobalValue has private linkage. Entities
|
// In COFF the Module is invalid if the GlobalValue has private linkage.
|
||||||
// with private linkage don't have entries in the symbol table.
|
// Entities with private linkage don't have entries in the symbol table.
|
||||||
if (const GlobalValue *GV = M.getNamedValue(C.getName()))
|
if (TT.isOSBinFormatCOFF())
|
||||||
Assert(!GV->hasPrivateLinkage(), "comdat global value has private linkage",
|
if (const GlobalValue *GV = M.getNamedValue(C.getName()))
|
||||||
GV);
|
Assert(!GV->hasPrivateLinkage(),
|
||||||
|
"comdat global value has private linkage", GV);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Verifier::visitModuleIdents(const Module &M) {
|
void Verifier::visitModuleIdents(const Module &M) {
|
||||||
|
@ -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 = comdat any
|
||||||
@v = private global i32 0, comdat($v)
|
@v = private global i32 0, comdat($v)
|
||||||
|
Loading…
Reference in New Issue
Block a user