eliminate ReadASTBitcodeFile
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67903 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/SerializationTest.cpp b/tools/clang-cc/SerializationTest.cpp
index e489a19..fcc047e 100644
--- a/tools/clang-cc/SerializationTest.cpp
+++ b/tools/clang-cc/SerializationTest.cpp
@@ -81,7 +81,18 @@
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;