Skip to content

Commit

Permalink
Object: Move datalayout check into irsymtab::build. NFCI.
Browse files Browse the repository at this point in the history
This check is a requirement of the irsymtab builder, not of any
particular caller.

Differential Revision: https://reviews.llvm.org/D33970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305023 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pcc committed Jun 8, 2017
1 parent b9fc96d commit 7136633
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Object/IRSymtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ struct Builder {
};

Error Builder::addModule(Module *M) {
if (M->getDataLayoutStr().empty())
return make_error<StringError>("input module has no datalayout",
inconvertibleErrorCode());

SmallPtrSet<GlobalValue *, 8> Used;
collectUsedGlobalVariables(*M, Used, /*CompilerUsed*/ false);

Expand Down Expand Up @@ -277,10 +281,6 @@ static Expected<FileContents> upgrade(ArrayRef<BitcodeModule> BMs) {
if (!MOrErr)
return MOrErr.takeError();

if ((*MOrErr)->getDataLayoutStr().empty())
return make_error<StringError>("input module has no datalayout",
inconvertibleErrorCode());

Mods.push_back(MOrErr->get());
OwnedMods.push_back(std::move(*MOrErr));
}
Expand Down

0 comments on commit 7136633

Please sign in to comment.