diff options
author | Stephen Hines <srhines@google.com> | 2014-04-23 16:57:46 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-04-24 15:53:16 -0700 |
commit | 36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch) | |
tree | e6cfb69fbbd937f450eeb83bfb83b9da3b01275a /unittests/Bitcode | |
parent | 69a8640022b04415ae9fac62f8ab090601d8f889 (diff) | |
download | external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2 |
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'unittests/Bitcode')
-rw-r--r-- | unittests/Bitcode/BitReaderTest.cpp | 9 | ||||
-rw-r--r-- | unittests/Bitcode/CMakeLists.txt | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/unittests/Bitcode/BitReaderTest.cpp b/unittests/Bitcode/BitReaderTest.cpp index f33af2f..ba03023 100644 --- a/unittests/Bitcode/BitReaderTest.cpp +++ b/unittests/Bitcode/BitReaderTest.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/SmallString.h" -#include "llvm/Analysis/Verifier.h" #include "llvm/Bitcode/BitstreamWriter.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" +#include "llvm/IR/Verifier.h" #include "llvm/PassManager.h" #include "llvm/Support/MemoryBuffer.h" #include "gtest/gtest.h" @@ -45,7 +45,7 @@ static Module *makeLLVMModule() { } static void writeModuleToBuffer(SmallVectorImpl<char> &Buffer) { - OwningPtr<Module> Mod(makeLLVMModule()); + std::unique_ptr<Module> Mod(makeLLVMModule()); raw_svector_ostream OS(Buffer); WriteBitcodeToFile(Mod.get(), OS); } @@ -54,8 +54,9 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddr) { // PR11677 SmallString<1024> Mem; writeModuleToBuffer(Mem); MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(Mem.str(), "test", false); - std::string errMsg; - OwningPtr<Module> m(getLazyBitcodeModule(Buffer, getGlobalContext(), &errMsg)); + ErrorOr<Module *> ModuleOrErr = + getLazyBitcodeModule(Buffer, getGlobalContext()); + std::unique_ptr<Module> m(ModuleOrErr.get()); PassManager passes; passes.add(createVerifierPass()); passes.run(*m); diff --git a/unittests/Bitcode/CMakeLists.txt b/unittests/Bitcode/CMakeLists.txt index d8f5fe1..743ab18 100644 --- a/unittests/Bitcode/CMakeLists.txt +++ b/unittests/Bitcode/CMakeLists.txt @@ -1,6 +1,8 @@ set(LLVM_LINK_COMPONENTS BitReader BitWriter + Core + Support ) add_llvm_unittest(BitcodeTests |