diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-12 20:15:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-12 20:15:49 +0000 |
commit | 38048cdb1c016e1429004ddf4adfa40a8d853cbf (patch) | |
tree | 20868c4f3015e4cc37f7d41e0312d85e50cf2d02 /lib/IR/Verifier.cpp | |
parent | 4207c6759c040ca9c26fd305b1e62d5c68a44fb1 (diff) | |
download | llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.gz llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.bz2 llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.xz |
Reject alias to undefined symbols in the verifier.
On ELF and COFF an alias is just another name for a position in the file.
There is no way to refer to a position in another file, so an alias to
undefined is meaningless.
MachO currently doesn't support aliases. The spec has a N_INDR, which when
implemented will have a different set of restrictions. Adding support for
it shouldn't be harder than any other IR extension.
For now, having the IR represent what is actually possible with current
tools makes it easier to fix the design of GlobalAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Verifier.cpp')
-rw-r--r-- | lib/IR/Verifier.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index fcdbac2f9f..2fc77cc2d7 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -501,6 +501,7 @@ void Verifier::visitGlobalAlias(const GlobalAlias &GA) { &GA); } } + Assert1(!GV->isDeclaration(), "Alias must point to a definition", &GA); const GlobalValue* Resolved = GA.resolveAliasedGlobal(/*stopOnWeak*/ false); Assert1(Resolved, |