From 82a599a0a42bdacb857a9dc10915a963961a1a9b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 4 Jul 2014 13:30:13 +0000 Subject: [PATCH] Remove unused old-style error handling. If needed, an ErrorOr should be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212340 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bitcode/ReaderWriter.h | 11 ++++------- lib/Bitcode/Reader/BitcodeReader.cpp | 7 ++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/llvm/Bitcode/ReaderWriter.h b/include/llvm/Bitcode/ReaderWriter.h index 4c194a638d4..8cf573544f8 100644 --- a/include/llvm/Bitcode/ReaderWriter.h +++ b/include/llvm/Bitcode/ReaderWriter.h @@ -41,14 +41,11 @@ namespace llvm { LLVMContext &Context, std::string *ErrMsg = nullptr); - /// 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. + /// 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 "". std::string getBitcodeTargetTriple(MemoryBuffer *Buffer, - LLVMContext &Context, - std::string *ErrMsg = nullptr); + LLVMContext &Context); /// Read the specified bitcode file, returning the module. /// This method *never* takes ownership of Buffer. diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 524a1a8bd6d..641f6889133 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3468,14 +3468,11 @@ ErrorOr llvm::parseBitcodeFile(MemoryBuffer *Buffer, } std::string llvm::getBitcodeTargetTriple(MemoryBuffer *Buffer, - LLVMContext& Context, - std::string *ErrMsg) { + LLVMContext &Context) { BitcodeReader *R = new BitcodeReader(Buffer, Context); std::string Triple(""); - if (std::error_code EC = R->ParseTriple(Triple)) - if (ErrMsg) - *ErrMsg = EC.message(); + R->ParseTriple(Triple); R->releaseBuffer(); delete R;