diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-06-16 17:06:29 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-06-16 17:06:29 +0000 |
commit | 5ef16b8a7c107141541430233cea2263caaf85d1 (patch) | |
tree | 6b93a5483edba93a6f47411e615daed050dea4ed /llvm/lib | |
parent | 7ac23c3ae066eaf998cdaa6e7f001c290486d8b9 (diff) | |
download | bcm5719-llvm-5ef16b8a7c107141541430233cea2263caaf85d1.tar.gz bcm5719-llvm-5ef16b8a7c107141541430233cea2263caaf85d1.zip |
MIR Parser: Report an error when a machine function doesn't have a corresponding function.
This commit reports an error when a machine function from a MIR file that contains
LLVM IR can't find a function with the same name in the loaded LLVM IR module.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10468
llvm-svn: 239831
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index acd3c1130a5..8fe4c838000 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -173,6 +173,9 @@ bool MIRParserImpl::parseMachineFunction(yaml::Input &In, Module &M, Functions.insert(std::make_pair(FunctionName, std::move(MF))); if (NoLLVMIR) createDummyFunction(FunctionName, M); + else if (!M.getFunction(FunctionName)) + return error(Twine("function '") + FunctionName + + "' isn't defined in the provided LLVM IR"); return false; } |