Skip to content

Commit

Permalink
While in GlobalValue fix the function(s) that don't follow the
Browse files Browse the repository at this point in the history
naming convention and update users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237461 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
echristo committed May 15, 2015
1 parent 85e632d commit 1bef1cd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions include/llvm/IR/GVMaterializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class GVMaterializer {
/// lazily. If the Materializer doesn't support this capability, this method
/// is a noop.
///
virtual void Dematerialize(GlobalValue *) {}
virtual void dematerialize(GlobalValue *) {}

/// Make sure the entire Module has been completely read.
///
virtual std::error_code MaterializeModule(Module *M) = 0;
virtual std::error_code materializeModule(Module *M) = 0;

virtual std::error_code materializeMetadata() = 0;
virtual void setStripDebugInfo() = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/IR/GlobalValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class GlobalValue : public Constant {
/// If this GlobalValue is read in, and if the GVMaterializer supports it,
/// release the memory for the function, and set it up to be materialized
/// lazily. If !isDematerializable(), this method is a noop.
void Dematerialize();
void dematerialize();

/// @}

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/IR/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class Module {
/// If the GlobalValue is read in, and if the GVMaterializer supports it,
/// release the memory for the function, and set it up to be materialized
/// lazily. If !isDematerializable(), this method is a no-op.
void Dematerialize(GlobalValue *GV);
void dematerialize(GlobalValue *GV);

/// Make sure all GlobalValues in this Module are fully read.
std::error_code materializeAll();
Expand Down
8 changes: 4 additions & 4 deletions lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ class BitcodeReader : public GVMaterializer {

bool isDematerializable(const GlobalValue *GV) const override;
std::error_code materialize(GlobalValue *GV) override;
std::error_code MaterializeModule(Module *M) override;
std::error_code materializeModule(Module *M) override;
std::vector<StructType *> getIdentifiedStructTypes() const override;
void Dematerialize(GlobalValue *GV) override;
void dematerialize(GlobalValue *GV) override;

/// @brief Main interface to parsing a bitcode buffer.
/// @returns true if an error occurred.
Expand Down Expand Up @@ -4447,7 +4447,7 @@ bool BitcodeReader::isDematerializable(const GlobalValue *GV) const {
return DeferredFunctionInfo.count(const_cast<Function*>(F));
}

void BitcodeReader::Dematerialize(GlobalValue *GV) {
void BitcodeReader::dematerialize(GlobalValue *GV) {
Function *F = dyn_cast<Function>(GV);
// If this function isn't dematerializable, this is a noop.
if (!F || !isDematerializable(F))
Expand All @@ -4460,7 +4460,7 @@ void BitcodeReader::Dematerialize(GlobalValue *GV) {
F->setIsMaterializable(true);
}

std::error_code BitcodeReader::MaterializeModule(Module *M) {
std::error_code BitcodeReader::materializeModule(Module *M) {
assert(M == TheModule &&
"Can only Materialize the Module this BitcodeReader is attached to.");

Expand Down
4 changes: 2 additions & 2 deletions lib/IR/Globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ bool GlobalValue::isDematerializable() const {
std::error_code GlobalValue::materialize() {
return getParent()->materialize(this);
}
void GlobalValue::Dematerialize() {
getParent()->Dematerialize(this);
void GlobalValue::dematerialize() {
getParent()->dematerialize(this);
}

/// Override destroyConstant to make sure it doesn't get called on
Expand Down
6 changes: 3 additions & 3 deletions lib/IR/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ std::error_code Module::materialize(GlobalValue *GV) {
return Materializer->materialize(GV);
}

void Module::Dematerialize(GlobalValue *GV) {
void Module::dematerialize(GlobalValue *GV) {
if (Materializer)
return Materializer->Dematerialize(GV);
return Materializer->dematerialize(GV);
}

std::error_code Module::materializeAll() {
if (!Materializer)
return std::error_code();
return Materializer->MaterializeModule(this);
return Materializer->materializeModule(this);
}

std::error_code Module::materializeAllPermanently() {
Expand Down
2 changes: 1 addition & 1 deletion lib/Linker/LinkModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ bool ModuleLinker::linkFunctionBody(Function &Dst, Function &Src) {
for (Argument &Arg : Src.args())
ValueMap.erase(&Arg);

Src.Dematerialize();
Src.dematerialize();
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions unittests/Bitcode/BitReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ TEST(BitReaderTest, DematerializeFunctionPreservesLinkageType) {
GlobalValue::InternalLinkage);

// Check that the linkage type is preserved after dematerialization.
M->getFunction("func")->Dematerialize();
M->getFunction("func")->dematerialize();
EXPECT_TRUE(M->getFunction("func")->empty());
EXPECT_TRUE(M->getFunction("func")->getLinkage() ==
GlobalValue::InternalLinkage);
Expand Down Expand Up @@ -160,7 +160,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddr) { // PR11677
EXPECT_FALSE(verifyModule(*M, &dbgs()));

// Try (and fail) to dematerialize @func.
M->getFunction("func")->Dematerialize();
M->getFunction("func")->dematerialize();
EXPECT_FALSE(M->getFunction("func")->empty());
}

Expand Down Expand Up @@ -191,7 +191,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddrInFunctionBefore) {
EXPECT_FALSE(verifyModule(*M, &dbgs()));

// Try (and fail) to dematerialize @func.
M->getFunction("func")->Dematerialize();
M->getFunction("func")->dematerialize();
EXPECT_FALSE(M->getFunction("func")->empty());
EXPECT_FALSE(verifyModule(*M, &dbgs()));
}
Expand Down Expand Up @@ -223,7 +223,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddrInFunctionAfter) {
EXPECT_FALSE(verifyModule(*M, &dbgs()));

// Try (and fail) to dematerialize @func.
M->getFunction("func")->Dematerialize();
M->getFunction("func")->dematerialize();
EXPECT_FALSE(M->getFunction("func")->empty());
EXPECT_FALSE(verifyModule(*M, &dbgs()));
}
Expand Down

0 comments on commit 1bef1cd

Please sign in to comment.