[CodeGen] If there is a function definition with duplicate mangled name, emit an error instead of asserting.
rdar://15522601 & http://llvm.org/PR18031 llvm-svn: 195556
This commit is contained in:
@@ -2100,6 +2100,10 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) {
|
||||
Entry = CE->getOperand(0);
|
||||
}
|
||||
|
||||
if (!cast<llvm::GlobalValue>(Entry)->isDeclaration()) {
|
||||
getDiags().Report(D->getLocation(), diag::err_duplicate_mangled_name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cast<llvm::GlobalValue>(Entry)->getType()->getElementType() != Ty) {
|
||||
llvm::GlobalValue *OldFn = cast<llvm::GlobalValue>(Entry);
|
||||
|
||||
Reference in New Issue
Block a user