mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-05 03:36:43 +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>
|
std::unique_ptr<MIRParser>
|
||||||
llvm::createMIRParser(std::unique_ptr<MemoryBuffer> Contents,
|
llvm::createMIRParser(std::unique_ptr<MemoryBuffer> Contents,
|
||||||
LLVMContext &Context) {
|
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();
|
auto Filename = Contents->getBufferIdentifier();
|
||||||
return llvm::make_unique<MIRParser>(
|
return llvm::make_unique<MIRParser>(
|
||||||
llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
|
llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user