summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-11-23 18:41:35 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-11-23 18:41:35 +0000
commitf405dd62ecd67d8d4d389620d7c3949af0707bdc (patch)
tree25ed007bfaf17192367eef6cb36ce90640e9a92b /clang/lib/CodeGen/CodeGenModule.cpp
parent84c47a10741c7be02ac448833f32beaf53c0abde (diff)
downloadbcm5719-llvm-f405dd62ecd67d8d4d389620d7c3949af0707bdc.tar.gz
bcm5719-llvm-f405dd62ecd67d8d4d389620d7c3949af0707bdc.zip
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 8240f8d38c1..2acb2ec1e8f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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);
OpenPOWER on IntegriCloud