aboutsummaryrefslogtreecommitdiff
path: root/tools/clang-cc/SerializationTest.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-28 03:49:26 +0000
committerChris Lattner <sabre@nondot.org>2009-03-28 03:49:26 +0000
commit5f737ccd3854b55a3eb9ab3aa54f2b1c3212418f (patch)
tree5346f2f5d03bcacf829da24365a2421882fa296c /tools/clang-cc/SerializationTest.cpp
parenta9376d470ccb0eac74fe09a6b2a18a890f1d17c4 (diff)
eliminate ReadASTBitcodeFile
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-cc/SerializationTest.cpp')
-rw-r--r--tools/clang-cc/SerializationTest.cpp13
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;