diff options
Diffstat (limited to 'tools/clang-cc/SerializationTest.cpp')
-rw-r--r-- | tools/clang-cc/SerializationTest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/clang-cc/SerializationTest.cpp b/tools/clang-cc/SerializationTest.cpp index e489a19ff8..fcc047e015 100644 --- a/tools/clang-cc/SerializationTest.cpp +++ b/tools/clang-cc/SerializationTest.cpp @@ -81,7 +81,18 @@ bool SerializationTest::Deserialize(llvm::sys::Path& Filename, llvm::sys::Path& FNameDeclPrint) { // Deserialize the translation unit. - TranslationUnit* NewTU = ReadASTBitcodeFile(Filename, FMgr); + TranslationUnit* NewTU; + + { + // Create the memory buffer that contains the contents of the file. + llvm::OwningPtr<llvm::MemoryBuffer> + MBuffer(llvm::MemoryBuffer::getFile(Filename.c_str())); + + if (!MBuffer) + return false; + + NewTU = ReadASTBitcodeBuffer(*MBuffer, FMgr); + } if (!NewTU) return false; |