Modernize the error handling of the Materialize function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-10-24 22:50:48 +00:00
parent 44ccedc273
commit c498284e46
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()));