summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-06-15 22:23:23 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-06-15 22:23:23 +0000
commitfe2aa97babcd6a5c150113efeff0ea0f93e7c688 (patch)
tree62db780249f26f3279f0d29b69615e3f4fd242e0 /llvm/lib/CodeGen/MIRParser/MIRParser.cpp
parent0ff92e6e3e998ed2fe48e302f6296e3552dca45a (diff)
downloadbcm5719-llvm-fe2aa97babcd6a5c150113efeff0ea0f93e7c688.tar.gz
bcm5719-llvm-fe2aa97babcd6a5c150113efeff0ea0f93e7c688.zip
MIR Serialization: Report an error when machine functions have the same name.
This commit reports an error when the MIR parser encounters a machine function with the name that is the same as the name of a different machine function. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10130 llvm-svn: 239774
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index 69ecb923ed7..19e845fc01f 100644
--- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
@@ -156,6 +156,9 @@ bool MIRParserImpl::parseMachineFunction(yaml::Input &In) {
if (In.error())
return true;
auto FunctionName = MF->Name;
+ if (Functions.find(FunctionName) != Functions.end())
+ return error(Twine("redefinition of machine function '") + FunctionName +
+ "'");
Functions.insert(std::make_pair(FunctionName, std::move(MF)));
return false;
}
OpenPOWER on IntegriCloud