AsmParser: Save and restore the parsing state for types using SlotMapping.
[oota-llvm.git] / lib / AsmParser / Parser.cpp
index 6135b43f00d1895687ecc66fdf51f52c498385c8..4e55e62ecf5c49c76cb62a82995e35a9d2fde404 100644 (file)
@@ -68,13 +68,13 @@ std::unique_ptr<Module> llvm::parseAssemblyString(StringRef AsmString,
 }
 
 Constant *llvm::parseConstantValue(StringRef Asm, SMDiagnostic &Err,
-                                   const Module &M) {
+                                   const Module &M, const SlotMapping *Slots) {
   SourceMgr SM;
   std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Asm);
   SM.AddNewSourceBuffer(std::move(Buf), SMLoc());
   Constant *C;
   if (LLParser(Asm, SM, Err, const_cast<Module *>(&M))
-          .parseStandaloneConstantValue(C))
+          .parseStandaloneConstantValue(C, Slots))
     return nullptr;
   return C;
 }