mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 19:26:30 +00:00
MIR Parser: issue an error when the Context discard value names.
This is in line with the LLParser behavior llvm-svn: 281811
This commit is contained in:
parent
4b0efbfd4a
commit
e8c86f419a
@ -828,6 +828,14 @@ std::unique_ptr<MIRParser> llvm::createMIRParserFromFile(StringRef Filename,
|
||||
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user