From 1bef1cdd9292c25f69b07726499e8bc41c4689c1 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 15 May 2015 18:20:14 +0000 Subject: [PATCH] While in GlobalValue fix the function(s) that don't follow the naming convention and update users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237461 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/GVMaterializer.h | 4 ++-- include/llvm/IR/GlobalValue.h | 2 +- include/llvm/IR/Module.h | 2 +- lib/Bitcode/Reader/BitcodeReader.cpp | 8 ++++---- lib/IR/Globals.cpp | 4 ++-- lib/IR/Module.cpp | 6 +++--- lib/Linker/LinkModules.cpp | 2 +- unittests/Bitcode/BitReaderTest.cpp | 8 ++++---- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/llvm/IR/GVMaterializer.h b/include/llvm/IR/GVMaterializer.h index 779f2e01818..1d6c9157f0b 100644 --- a/include/llvm/IR/GVMaterializer.h +++ b/include/llvm/IR/GVMaterializer.h @@ -47,11 +47,11 @@ public: /// 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; diff --git a/include/llvm/IR/GlobalValue.h b/include/llvm/IR/GlobalValue.h index aeaaef4bd8b..6d46a465ee7 100644 --- a/include/llvm/IR/GlobalValue.h +++ b/include/llvm/IR/GlobalValue.h @@ -317,7 +317,7 @@ public: /// 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(); /// @} diff --git a/include/llvm/IR/Module.h b/include/llvm/IR/Module.h index dbaf322263d..d8636dfb123 100644 --- a/include/llvm/IR/Module.h +++ b/include/llvm/IR/Module.h @@ -492,7 +492,7 @@ public: /// 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(); diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index cb03218bff8..145c7349862 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -240,9 +240,9 @@ public: 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 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. @@ -4447,7 +4447,7 @@ bool BitcodeReader::isDematerializable(const GlobalValue *GV) const { return DeferredFunctionInfo.count(const_cast(F)); } -void BitcodeReader::Dematerialize(GlobalValue *GV) { +void BitcodeReader::dematerialize(GlobalValue *GV) { Function *F = dyn_cast(GV); // If this function isn't dematerializable, this is a noop. if (!F || !isDematerializable(F)) @@ -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."); diff --git a/lib/IR/Globals.cpp b/lib/IR/Globals.cpp index 31f864d2115..1028e33eae6 100644 --- a/lib/IR/Globals.cpp +++ b/lib/IR/Globals.cpp @@ -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 diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp index 3e8f91fee74..043f74e12da 100644 --- a/lib/IR/Module.cpp +++ b/lib/IR/Module.cpp @@ -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() { diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 27b7ffd795a..1b7a33168f1 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -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; } diff --git a/unittests/Bitcode/BitReaderTest.cpp b/unittests/Bitcode/BitReaderTest.cpp index c746f591672..2e6dd0b499d 100644 --- a/unittests/Bitcode/BitReaderTest.cpp +++ b/unittests/Bitcode/BitReaderTest.cpp @@ -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); @@ -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()); } @@ -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())); } @@ -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())); }