From 3d26f2333b320e04d405a4418f640f8b7e358a99 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Fri, 3 Jun 2011 05:09:12 +0000 Subject: [PATCH] Whitespace and other cleanup. Functionallity unchanged. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132533 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 1 - lib/Bitcode/Writer/BitcodeWriter.cpp | 13 +++++-------- lib/Bitcode/Writer/ValueEnumerator.cpp | 5 ++--- lib/Bitcode/Writer/ValueEnumerator.h | 6 +++--- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index c4ef57cb724..bc995aec83e 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1852,7 +1852,6 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { FunctionBBs[i] = BasicBlock::Create(Context, "", F); CurBB = FunctionBBs[0]; continue; - case bitc::FUNC_CODE_DEBUG_LOC_AGAIN: // DEBUG_LOC_AGAIN // This record indicates that the last instruction is at the same diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index e652e082d16..2ec10c0db52 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -100,8 +100,6 @@ static unsigned GetEncodedBinaryOpcode(unsigned Opcode) { } } - - static void WriteStringRecord(unsigned Code, const std::string &Str, unsigned AbbrevToUse, BitstreamWriter &Stream) { SmallVector Vals; @@ -447,7 +445,6 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Vals.clear(); } - // Emit the alias information. for (Module::const_alias_iterator AI = M->alias_begin(), E = M->alias_end(); AI != E; ++AI) { @@ -1208,7 +1205,7 @@ static void WriteValueSymbolTable(const ValueSymbolTable &VST, static void WriteFunction(const Function &F, ValueEnumerator &VE, BitstreamWriter &Stream) { Stream.EnterSubblock(bitc::FUNCTION_BLOCK_ID, 4); - VE.incorporateFunction(F); + VE.IncorporateFunction(F); SmallVector Vals; @@ -1272,7 +1269,7 @@ static void WriteFunction(const Function &F, ValueEnumerator &VE, if (NeedsMetadataAttachment) WriteMetadataAttachment(F, VE, Stream); - VE.purgeFunction(); + VE.PurgeFunction(); Stream.ExitBlock(); } @@ -1512,9 +1509,9 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) { WriteModuleMetadata(M, VE, Stream); // Emit function bodies. - for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isDeclaration()) - WriteFunction(*I, VE, Stream); + for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) + if (!F->isDeclaration()) + WriteFunction(*F, VE, Stream); // Emit metadata. WriteModuleMetadataStore(M, Stream); diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index 21f004a7dc5..4fffa6ffa9c 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -452,8 +452,7 @@ void ValueEnumerator::EnumerateAttributes(const AttrListPtr &PAL) { } } - -void ValueEnumerator::incorporateFunction(const Function &F) { +void ValueEnumerator::IncorporateFunction(const Function &F) { InstructionCount = 0; NumModuleValues = Values.size(); NumModuleMDValues = MDValues.size(); @@ -517,7 +516,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) { EnumerateFunctionLocalMetadata(FnLocalMDVector[i]); } -void ValueEnumerator::purgeFunction() { +void ValueEnumerator::PurgeFunction() { /// Remove purged values from the ValueMap. for (unsigned i = NumModuleValues, e = Values.size(); i != e; ++i) ValueMap.erase(Values[i].first); diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h index 1e42a266766..8b2a08ca0de 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.h +++ b/lib/Bitcode/Writer/ValueEnumerator.h @@ -127,11 +127,11 @@ public: /// should only be used by rare constructs such as address-of-label. unsigned getGlobalBasicBlockID(const BasicBlock *BB) const; - /// incorporateFunction/purgeFunction - If you'd like to deal with a function, + /// IncorporateFunction/PurgeFunction - If you'd like to deal with a function, /// use these two methods to get its data into the ValueEnumerator! /// - void incorporateFunction(const Function &F); - void purgeFunction(); + void IncorporateFunction(const Function &F); + void PurgeFunction(); private: void OptimizeConstants(unsigned CstStart, unsigned CstEnd); -- 2.34.1