Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: include/llvm/IRReader/IRReader.h

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/llvm/IR/NaClAtomicIntrinsics.h ('k') | include/llvm/InitializePasses.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/IRReader/IRReader.h
diff --git a/include/llvm/IRReader/IRReader.h b/include/llvm/IRReader/IRReader.h
index 2d9ace0b62a0426ba8bb3d77bab9c6eb133cf3a6..1816e0a2e36cdcff2c4c1f2a02586b5b79fb9887 100644
--- a/include/llvm/IRReader/IRReader.h
+++ b/include/llvm/IRReader/IRReader.h
@@ -43,6 +43,42 @@ std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
/// for it.
std::unique_ptr<Module> parseIRFile(StringRef Filename, SMDiagnostic &Err,
LLVMContext &Context);
+
+// @LOCALMOD-BEGIN
+class raw_ostream;
+
+// \brief Define the expected format of the file.
+enum NaClFileFormat {
+ // LLVM IR source or bitcode file (as appropriate).
+ LLVMFormat,
+ // PNaCl bitcode file.
+ PNaClFormat,
+ // Autodetect if PNaCl or LLVM format.
+ AutodetectFileFormat
+};
+
+// \brief If the given MemoryBuffer holds a bitcode image, return a
+// Module for it. Otherwise, attempt to parse it as LLVM Assembly and
+// return a Module for it. When Format=PNaClFormat and Verbose
+// is non-null, more descriptive error messages are also written to
+// Verbose.
+std::unique_ptr<Module> NaClParseIR(MemoryBufferRef Buffer,
+ NaClFileFormat Format,
+ SMDiagnostic &Err,
+ raw_ostream *Verbose,
+ LLVMContext &Context);
+
+/// \brief If the given file holds a Bitcode image, read the file.
+/// Otherwise, attempt to parse it as LLVM assembly and return a
+/// Module for it. When Format=PNaClFormat and Verbose
+// is non-null, more descriptive error messages are also written to
+// Verbose.
+std::unique_ptr<Module> NaClParseIRFile(StringRef Filename,
+ NaClFileFormat Format,
+ SMDiagnostic &Err,
+ raw_ostream *Verbose,
+ LLVMContext &Context);
+// @LOCALMOD-END
}
#endif
« no previous file with comments | « include/llvm/IR/NaClAtomicIntrinsics.h ('k') | include/llvm/InitializePasses.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698