AsmParser: Add a function to parse a standalone constant value.
[oota-llvm.git] / include / llvm / AsmParser / Parser.h
index 52151409f94636279bfdfd07a95a58e2068f6d24..9fe33603bc66057302079e6c5d0553ae5d7fe6f1 100644 (file)
@@ -18,6 +18,7 @@
 
 namespace llvm {
 
+class Constant;
 class LLVMContext;
 class Module;
 struct SlotMapping;
@@ -79,6 +80,14 @@ std::unique_ptr<Module> parseAssembly(MemoryBufferRef F, SMDiagnostic &Err,
 bool parseAssemblyInto(MemoryBufferRef F, Module &M, SMDiagnostic &Err,
                        SlotMapping *Slots = nullptr);
 
+/// Parse a type and a constant value in the given string.
+///
+/// The constant value can be any LLVM constant, including a constant
+/// expression.
+///
+/// \return null on error.
+Constant *parseConstantValue(StringRef Asm, SMDiagnostic &Err, const Module &M);
+
 } // End llvm namespace
 
 #endif