[llvm] r281811 - MIR Parser: issue an error when the Context discard value names.
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 16 22:33:59 PDT 2016
Author: mehdi_amini
Date: Sat Sep 17 00:33:58 2016
New Revision: 281811
URL: http://llvm.org/viewvc/llvm-project?rev=281811&view=rev
Log:
MIR Parser: issue an error when the Context discard value names.
This is in line with the LLParser behavior
Modified:
llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp
Modified: llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp?rev=281811&r1=281810&r2=281811&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp Sat Sep 17 00:33:58 2016
@@ -828,6 +828,14 @@ std::unique_ptr<MIRParser> llvm::createM
std::unique_ptr<MIRParser>
llvm::createMIRParser(std::unique_ptr<MemoryBuffer> Contents,
LLVMContext &Context) {
+ if (Context.shouldDiscardValueNames()) {
+ Context.diagnose(DiagnosticInfoMIRParser(
+ DS_Error,
+ SMDiagnostic(
+ Filename, SourceMgr::DK_Error,
+ "Can't read MIR with a Context that discards named Values")));
+ return nullptr;
+ }
auto Filename = Contents->getBufferIdentifier();
return llvm::make_unique<MIRParser>(
llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
More information about the llvm-commits
mailing list