summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/LazyCallGraphTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-19 16:58:54 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-19 16:58:54 +0000
commit11c07d7eec2889be194e1662277542af2c9359df (patch)
treecf10f6375d086cd35dc910d75cba0497bb53ce8a /llvm/unittests/Analysis/LazyCallGraphTest.cpp
parent38f556d96d564fbd0fa9f76b5bd049338698b053 (diff)
downloadbcm5719-llvm-11c07d7eec2889be194e1662277542af2c9359df.tar.gz
bcm5719-llvm-11c07d7eec2889be194e1662277542af2c9359df.zip
Modernize the .ll parsing interface.
* Use StringRef instead of std::string& * Return a std::unique_ptr<Module> instead of taking an optional module to write to (was not really used). * Use current comment style. * Use current naming convention. llvm-svn: 215989
Diffstat (limited to 'llvm/unittests/Analysis/LazyCallGraphTest.cpp')
-rw-r--r--llvm/unittests/Analysis/LazyCallGraphTest.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/unittests/Analysis/LazyCallGraphTest.cpp b/llvm/unittests/Analysis/LazyCallGraphTest.cpp
index d7c70453c9b..5f73d83f092 100644
--- a/llvm/unittests/Analysis/LazyCallGraphTest.cpp
+++ b/llvm/unittests/Analysis/LazyCallGraphTest.cpp
@@ -22,18 +22,16 @@ using namespace llvm;
namespace {
std::unique_ptr<Module> parseAssembly(const char *Assembly) {
- auto M = make_unique<Module>("Module", getGlobalContext());
-
SMDiagnostic Error;
- bool Parsed =
- ParseAssemblyString(Assembly, M.get(), Error, M->getContext()) == M.get();
+ std::unique_ptr<Module> 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;
OpenPOWER on IntegriCloud