aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Bitcode
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-10-06 01:22:42 +0000
committerBill Wendling <isanbard@gmail.com>2010-10-06 01:22:42 +0000
commit34711747a1d2c8713e69333bacef1c880810e371 (patch)
tree0dc76a5863ab9848365c88c02692d7b730104c94 /include/llvm/Bitcode
parent417b54354b3fcccb4f5919b8d2d9dcd8bba50069 (diff)
downloadexternal_llvm-34711747a1d2c8713e69333bacef1c880810e371.zip
external_llvm-34711747a1d2c8713e69333bacef1c880810e371.tar.gz
external_llvm-34711747a1d2c8713e69333bacef1c880810e371.tar.bz2
Provide a fast "get me the target triple from the module" API. This can
drastically reduce the linking time during LTO. Patch by Shantonu Sen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r--include/llvm/Bitcode/ReaderWriter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Bitcode/ReaderWriter.h b/include/llvm/Bitcode/ReaderWriter.h
index a186964..5099cb7 100644
--- a/include/llvm/Bitcode/ReaderWriter.h
+++ b/include/llvm/Bitcode/ReaderWriter.h
@@ -33,6 +33,15 @@ namespace llvm {
LLVMContext& Context,
std::string *ErrMsg = 0);
+ /// getBitcodeTargetTriple - Read the header of the specified bitcode
+ /// buffer and extract just the triple information. If successful,
+ /// this returns a string and *does not* take ownership
+ /// of 'buffer'. On error, this returns "", and fills in *ErrMsg
+ /// if ErrMsg is non-null.
+ std::string getBitcodeTargetTriple(MemoryBuffer *Buffer,
+ LLVMContext& Context,
+ std::string *ErrMsg = 0);
+
/// ParseBitcodeFile - Read the specified bitcode file, returning the module.
/// If an error occurs, this returns null and fills in *ErrMsg if it is
/// non-null. This method *never* takes ownership of Buffer.