diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-13 01:30:30 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-13 01:30:30 +0000 |
commit | d72479c2f061e3b57adf3d054875665f25a30d90 (patch) | |
tree | 1c22fc27e9e82663599b3df81b78626b59894034 /lib/VMCore | |
parent | fef9ff492206330ff0a5b94cec5ac1455b28df88 (diff) | |
download | external_llvm-d72479c2f061e3b57adf3d054875665f25a30d90.zip external_llvm-d72479c2f061e3b57adf3d054875665f25a30d90.tar.gz external_llvm-d72479c2f061e3b57adf3d054875665f25a30d90.tar.bz2 |
Reject uses of unnamed_addr in declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 58ec6fe..ee62a29 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -469,6 +469,8 @@ void Verifier::visitGlobalVariable(GlobalVariable &GV) { Assert1(GV.hasExternalLinkage() || GV.hasDLLImportLinkage() || GV.hasExternalWeakLinkage(), "invalid linkage type for global declaration", &GV); + Assert1(!GV.hasUnnamedAddr(), "only definitions can have unnamed_addr", + &GV); } visitGlobalValue(GV); @@ -725,6 +727,7 @@ void Verifier::visitFunction(Function &F) { Assert1(F.hasExternalLinkage() || F.hasDLLImportLinkage() || F.hasExternalWeakLinkage(), "invalid linkage type for function declaration", &F); + Assert1(!F.hasUnnamedAddr(), "only definitions can have unnamed_addr", &F); } else { // Verify that this function (which has a body) is not named "llvm.*". It // is not legal to define intrinsics. |