diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-25 23:22:10 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-25 23:22:10 +0000 |
commit | 041ceb7d57d81c34d530ca50d947857facb6f40f (patch) | |
tree | 8337520a4a5323835a3b09d3f1f77b57d0e15d51 /llvm/tools/llvm-link | |
parent | 093b2d48b46919e4323f4217ab13a4ec46c8ac0a (diff) | |
download | bcm5719-llvm-041ceb7d57d81c34d530ca50d947857facb6f40f.tar.gz bcm5719-llvm-041ceb7d57d81c34d530ca50d947857facb6f40f.zip |
llvm-link: Verify input modules
Otherwise, broken input modules can cause assertions. I've updated two
of the testcases that started failing (modules that had `Require` flags
but didn't meet their own requirements), but Rafael and I decided that
test/Linker/2011-08-22-ResolveAlias.ll should just be deleted outright
-- it's a leftover of the way llvm-gcc used to implement weakref.
llvm-svn: 233229
Diffstat (limited to 'llvm/tools/llvm-link')
-rw-r--r-- | llvm/tools/llvm-link/llvm-link.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp index 4348dae0aeb..e52191a267b 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -112,6 +112,12 @@ int main(int argc, char **argv) { return 1; } + if (verifyModule(*M)) { + errs() << argv[0] << ": input module '" << InputFilenames[i] + << "' is broken!\n"; + return 1; + } + if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n"; if (L.linkInModule(M.get())) |