Modernize the error handling of the Materialize function.

llvm-svn: 220600
This commit is contained in:
Rafael Espindola
2014-10-24 22:50:48 +00:00
parent 2813f496d9
commit 5a52e6dc9e
12 changed files with 39 additions and 36 deletions

View File

@@ -69,7 +69,7 @@ TEST(BitReaderTest, DematerializeFunctionPreservesLinkageType) {
EXPECT_FALSE(verifyModule(*M, &dbgs()));
M->getFunction("func")->Materialize();
M->getFunction("func")->materialize();
EXPECT_FALSE(M->getFunction("func")->empty());
EXPECT_TRUE(M->getFunction("func")->getLinkage() ==
GlobalValue::InternalLinkage);
@@ -121,7 +121,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddrInFunctionBefore) {
EXPECT_FALSE(verifyModule(*M, &dbgs()));
// Materialize @before, pulling in @func.
EXPECT_FALSE(M->getFunction("before")->Materialize());
EXPECT_FALSE(M->getFunction("before")->materialize());
EXPECT_FALSE(M->getFunction("func")->empty());
EXPECT_TRUE(M->getFunction("other")->empty());
EXPECT_FALSE(verifyModule(*M, &dbgs()));
@@ -153,7 +153,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddrInFunctionAfter) {
EXPECT_FALSE(verifyModule(*M, &dbgs()));
// Materialize @after, pulling in @func.
EXPECT_FALSE(M->getFunction("after")->Materialize());
EXPECT_FALSE(M->getFunction("after")->materialize());
EXPECT_FALSE(M->getFunction("func")->empty());
EXPECT_TRUE(M->getFunction("other")->empty());
EXPECT_FALSE(verifyModule(*M, &dbgs()));