mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user