mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -30,20 +30,16 @@ namespace {
|
||||
class IsPotentiallyReachableTest : public testing::Test {
|
||||
protected:
|
||||
void ParseAssembly(const char *Assembly) {
|
||||
M.reset(new Module("Module", getGlobalContext()));
|
||||
|
||||
SMDiagnostic Error;
|
||||
bool Parsed = ParseAssemblyString(Assembly, M.get(),
|
||||
Error, M->getContext()) == M.get();
|
||||
M = parseAssemblyString(Assembly, Error, getGlobalContext());
|
||||
|
||||
std::string errMsg;
|
||||
raw_string_ostream os(errMsg);
|
||||
Error.print("", os);
|
||||
|
||||
if (!Parsed) {
|
||||
// A failure here means that the test itself is buggy.
|
||||
// A failure here means that the test itself is buggy.
|
||||
if (!M)
|
||||
report_fatal_error(os.str().c_str());
|
||||
}
|
||||
|
||||
Function *F = M->getFunction("test");
|
||||
if (F == nullptr)
|
||||
|
Reference in New Issue
Block a user