[llvm] r264556 - BitcodeWriter: Rename some functions for consistency, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 27 16:56:05 PDT 2016
Author: dexonsmith
Date: Sun Mar 27 18:56:04 2016
New Revision: 264556
URL: http://llvm.org/viewvc/llvm-project?rev=264556&view=rev
Log:
BitcodeWriter: Rename some functions for consistency, NFC
To match writeMetadataRecords, writeNamedMetadata and
writeMetadataStrings, change:
WriteModuleMetadata => writeModuleMetadata
WriteFunctionLocalMetadata => writeFunctionMetadata
Write##CLASS => write##CLASS
The only major change is "FunctionLocal" => "Function". The point is to
be less specific, in preparation for emitting normal metadata records
inside function metadata blocks (currently we only emit
`LocalAsMetadata` there).
Modified:
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=264556&r1=264555&r2=264556&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Mar 27 18:56:04 2016
@@ -862,7 +862,7 @@ static uint64_t GetOptimizationFlags(con
return Flags;
}
-static void WriteValueAsMetadata(const ValueAsMetadata *MD,
+static void writeValueAsMetadata(const ValueAsMetadata *MD,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record) {
@@ -874,7 +874,7 @@ static void WriteValueAsMetadata(const V
Record.clear();
}
-static void WriteMDTuple(const MDTuple *N, const ValueEnumerator &VE,
+static void writeMDTuple(const MDTuple *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) {
for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
@@ -902,7 +902,7 @@ static unsigned createDILocationAbbrev(B
return Stream.EmitAbbrev(Abbv);
}
-static void WriteDILocation(const DILocation *N, const ValueEnumerator &VE,
+static void writeDILocation(const DILocation *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned &Abbrev) {
@@ -933,7 +933,7 @@ static unsigned createGenericDINodeAbbre
return Stream.EmitAbbrev(Abbv);
}
-static void WriteGenericDINode(const GenericDINode *N,
+static void writeGenericDINode(const GenericDINode *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -957,7 +957,7 @@ static uint64_t rotateSign(int64_t I) {
return I < 0 ? ~(U << 1) : U << 1;
}
-static void WriteDISubrange(const DISubrange *N, const ValueEnumerator &,
+static void writeDISubrange(const DISubrange *N, const ValueEnumerator &,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -969,7 +969,7 @@ static void WriteDISubrange(const DISubr
Record.clear();
}
-static void WriteDIEnumerator(const DIEnumerator *N, const ValueEnumerator &VE,
+static void writeDIEnumerator(const DIEnumerator *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -981,7 +981,7 @@ static void WriteDIEnumerator(const DIEn
Record.clear();
}
-static void WriteDIBasicType(const DIBasicType *N, const ValueEnumerator &VE,
+static void writeDIBasicType(const DIBasicType *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -996,7 +996,7 @@ static void WriteDIBasicType(const DIBas
Record.clear();
}
-static void WriteDIDerivedType(const DIDerivedType *N,
+static void writeDIDerivedType(const DIDerivedType *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1018,7 +1018,7 @@ static void WriteDIDerivedType(const DID
Record.clear();
}
-static void WriteDICompositeType(const DICompositeType *N,
+static void writeDICompositeType(const DICompositeType *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1044,7 +1044,7 @@ static void WriteDICompositeType(const D
Record.clear();
}
-static void WriteDISubroutineType(const DISubroutineType *N,
+static void writeDISubroutineType(const DISubroutineType *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1057,7 +1057,7 @@ static void WriteDISubroutineType(const
Record.clear();
}
-static void WriteDIFile(const DIFile *N, const ValueEnumerator &VE,
+static void writeDIFile(const DIFile *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) {
Record.push_back(N->isDistinct());
@@ -1068,7 +1068,7 @@ static void WriteDIFile(const DIFile *N,
Record.clear();
}
-static void WriteDICompileUnit(const DICompileUnit *N,
+static void writeDICompileUnit(const DICompileUnit *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1095,7 +1095,7 @@ static void WriteDICompileUnit(const DIC
Record.clear();
}
-static void WriteDISubprogram(const DISubprogram *N, const ValueEnumerator &VE,
+static void writeDISubprogram(const DISubprogram *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -1122,7 +1122,7 @@ static void WriteDISubprogram(const DISu
Record.clear();
}
-static void WriteDILexicalBlock(const DILexicalBlock *N,
+static void writeDILexicalBlock(const DILexicalBlock *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1137,7 +1137,7 @@ static void WriteDILexicalBlock(const DI
Record.clear();
}
-static void WriteDILexicalBlockFile(const DILexicalBlockFile *N,
+static void writeDILexicalBlockFile(const DILexicalBlockFile *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1151,7 +1151,7 @@ static void WriteDILexicalBlockFile(cons
Record.clear();
}
-static void WriteDINamespace(const DINamespace *N, const ValueEnumerator &VE,
+static void writeDINamespace(const DINamespace *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -1165,7 +1165,7 @@ static void WriteDINamespace(const DINam
Record.clear();
}
-static void WriteDIMacro(const DIMacro *N, const ValueEnumerator &VE,
+static void writeDIMacro(const DIMacro *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) {
Record.push_back(N->isDistinct());
@@ -1178,7 +1178,7 @@ static void WriteDIMacro(const DIMacro *
Record.clear();
}
-static void WriteDIMacroFile(const DIMacroFile *N, const ValueEnumerator &VE,
+static void writeDIMacroFile(const DIMacroFile *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -1192,7 +1192,7 @@ static void WriteDIMacroFile(const DIMac
Record.clear();
}
-static void WriteDIModule(const DIModule *N, const ValueEnumerator &VE,
+static void writeDIModule(const DIModule *N, const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) {
Record.push_back(N->isDistinct());
@@ -1203,7 +1203,7 @@ static void WriteDIModule(const DIModule
Record.clear();
}
-static void WriteDITemplateTypeParameter(const DITemplateTypeParameter *N,
+static void writeDITemplateTypeParameter(const DITemplateTypeParameter *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1216,7 +1216,7 @@ static void WriteDITemplateTypeParameter
Record.clear();
}
-static void WriteDITemplateValueParameter(const DITemplateValueParameter *N,
+static void writeDITemplateValueParameter(const DITemplateValueParameter *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1231,7 +1231,7 @@ static void WriteDITemplateValueParamete
Record.clear();
}
-static void WriteDIGlobalVariable(const DIGlobalVariable *N,
+static void writeDIGlobalVariable(const DIGlobalVariable *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1252,7 +1252,7 @@ static void WriteDIGlobalVariable(const
Record.clear();
}
-static void WriteDILocalVariable(const DILocalVariable *N,
+static void writeDILocalVariable(const DILocalVariable *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1270,7 +1270,7 @@ static void WriteDILocalVariable(const D
Record.clear();
}
-static void WriteDIExpression(const DIExpression *N, const ValueEnumerator &,
+static void writeDIExpression(const DIExpression *N, const ValueEnumerator &,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
@@ -1283,7 +1283,7 @@ static void WriteDIExpression(const DIEx
Record.clear();
}
-static void WriteDIObjCProperty(const DIObjCProperty *N,
+static void writeDIObjCProperty(const DIObjCProperty *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1301,7 +1301,7 @@ static void WriteDIObjCProperty(const DI
Record.clear();
}
-static void WriteDIImportedEntity(const DIImportedEntity *N,
+static void writeDIImportedEntity(const DIImportedEntity *N,
const ValueEnumerator &VE,
BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record,
@@ -1411,16 +1411,16 @@ static void writeMetadataRecords(ArrayRe
llvm_unreachable("Invalid MDNode subclass");
#define HANDLE_MDNODE_LEAF(CLASS) \
case Metadata::CLASS##Kind: \
- Write##CLASS(cast<CLASS>(N), VE, Stream, Record, CLASS##Abbrev); \
+ write##CLASS(cast<CLASS>(N), VE, Stream, Record, CLASS##Abbrev); \
continue;
#include "llvm/IR/Metadata.def"
}
}
- WriteValueAsMetadata(cast<ConstantAsMetadata>(MD), VE, Stream, Record);
+ writeValueAsMetadata(cast<ConstantAsMetadata>(MD), VE, Stream, Record);
}
}
-static void WriteModuleMetadata(const Module &M,
+static void writeModuleMetadata(const Module &M,
const ValueEnumerator &VE,
BitstreamWriter &Stream) {
if (VE.getMDs().empty() && M.named_metadata_empty())
@@ -1434,9 +1434,8 @@ static void WriteModuleMetadata(const Mo
Stream.ExitBlock();
}
-static void WriteFunctionLocalMetadata(const Function &F,
- const ValueEnumerator &VE,
- BitstreamWriter &Stream) {
+static void writeFunctionMetadata(const Function &F, const ValueEnumerator &VE,
+ BitstreamWriter &Stream) {
ArrayRef<const Metadata *> MDs = VE.getFunctionMDs();
if (MDs.empty())
return;
@@ -1445,7 +1444,7 @@ static void WriteFunctionLocalMetadata(c
SmallVector<uint64_t, 64> Record;
for (const Metadata *MD : VE.getFunctionMDs())
- WriteValueAsMetadata(cast<LocalAsMetadata>(MD), VE, Stream, Record);
+ writeValueAsMetadata(cast<LocalAsMetadata>(MD), VE, Stream, Record);
Stream.ExitBlock();
}
@@ -2561,7 +2560,7 @@ static void WriteFunction(
WriteConstants(CstStart, CstEnd, VE, Stream, false);
// If there is function-local metadata, emit it now.
- WriteFunctionLocalMetadata(F, VE, Stream);
+ writeFunctionMetadata(F, VE, Stream);
// Keep a running idea of what the instruction ID is.
unsigned InstID = CstEnd;
@@ -3215,7 +3214,7 @@ static void WriteModule(const Module *M,
WriteModuleConstants(VE, Stream);
// Emit metadata.
- WriteModuleMetadata(*M, VE, Stream);
+ writeModuleMetadata(*M, VE, Stream);
// Emit metadata.
WriteModuleMetadataStore(M, Stream);
More information about the llvm-commits
mailing list