summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-09-17 05:33:58 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-09-17 05:33:58 +0000
commit8d904e95348fe0c5e56aae8696c04acb846fc8eb (patch)
tree9971e863735828b541bdf3915e1fcd58e48746d3 /llvm/lib/CodeGen/MIRParser
parent3e36ec1d18188810b19bb7d2153039ae2cc8c0db (diff)
downloadbcm5719-llvm-8d904e95348fe0c5e56aae8696c04acb846fc8eb.tar.gz
bcm5719-llvm-8d904e95348fe0c5e56aae8696c04acb846fc8eb.zip
MIR Parser: issue an error when the Context discard value names.
This is in line with the LLParser behavior llvm-svn: 281811
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index 104d7d18812..35614d3b77b 100644
--- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
@@ -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));
OpenPOWER on IntegriCloud