summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-12-14 21:57:04 +0000
committerDavide Italiano <davide@freebsd.org>2016-12-14 21:57:04 +0000
commit2ceb628f364bfb2444df6b819ccc22a46fac0a58 (patch)
treeb2771ffd3828ac13417872d3660afaaed4b22795 /llvm/lib/LTO/LTO.cpp
parentdd9688703c0c4df836d0b1ad0d93ccad33c00d2e (diff)
downloadbcm5719-llvm-2ceb628f364bfb2444df6b819ccc22a46fac0a58.tar.gz
bcm5719-llvm-2ceb628f364bfb2444df6b819ccc22a46fac0a58.zip
[LTO] Reject modules without datalayout.
Also, udpate the ~60 failing tests in the tree which did not contain a valid datalayout. This fixes PR31123. lld will be updated in a following patch, immediately after this is committed. Differential Revision: https://reviews.llvm.org/D27082 llvm-svn: 289719
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 718cbf17048..74de6c18aef 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -380,6 +380,11 @@ Error LTO::addModule(InputFile &Input, InputFile::InputModule &IM,
const SymbolResolution *ResE) {
// FIXME: move to backend
Module &M = *IM.Mod;
+
+ if (M.getDataLayoutStr().empty())
+ return make_error<StringError>("input module has no datalayout",
+ inconvertibleErrorCode());
+
if (!Conf.OverrideTriple.empty())
M.setTargetTriple(Conf.OverrideTriple);
else if (M.getTargetTriple().empty())
OpenPOWER on IntegriCloud