From 11c07d7eec2889be194e1662277542af2c9359df Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 19 Aug 2014 16:58:54 +0000 Subject: Modernize the .ll parsing interface. * Use StringRef instead of std::string& * Return a std::unique_ptr instead of taking an optional module to write to (was not really used). * Use current comment style. * Use current naming convention. llvm-svn: 215989 --- llvm/unittests/Bitcode/BitReaderTest.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/unittests/Bitcode/BitReaderTest.cpp') diff --git a/llvm/unittests/Bitcode/BitReaderTest.cpp b/llvm/unittests/Bitcode/BitReaderTest.cpp index 8331527437b..adc8851f279 100644 --- a/llvm/unittests/Bitcode/BitReaderTest.cpp +++ b/llvm/unittests/Bitcode/BitReaderTest.cpp @@ -26,18 +26,16 @@ using namespace llvm; namespace { std::unique_ptr parseAssembly(const char *Assembly) { - auto M = make_unique("Module", getGlobalContext()); - SMDiagnostic Error; - bool Parsed = - ParseAssemblyString(Assembly, M.get(), Error, M->getContext()) == M.get(); + std::unique_ptr M = + parseAssemblyString(Assembly, Error, getGlobalContext()); std::string ErrMsg; raw_string_ostream OS(ErrMsg); Error.print("", OS); // A failure here means that the test itself is buggy. - if (!Parsed) + if (!M) report_fatal_error(OS.str().c_str()); return M; -- cgit v1.2.3