summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-03-15 00:04:37 +0000
committerTeresa Johnson <tejohnson@google.com>2016-03-15 00:04:37 +0000
commit26ab5772b058fcddabfecb6736a3b78c67bc1751 (patch)
tree89b82d60f6e4ef3d7970cf1dc620c4f3a78bad2e /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentda8b3f1914e0cc4eb25af376583a23e660718115 (diff)
downloadbcm5719-llvm-26ab5772b058fcddabfecb6736a3b78c67bc1751.tar.gz
bcm5719-llvm-26ab5772b058fcddabfecb6736a3b78c67bc1751.zip
[ThinLTO] Renaming of function index to module summary index (NFC)
(Resubmitting after fixing missing file issue) With the changes in r263275, there are now more than just functions in the summary. Completed the renaming of data structures (started in r263275) to reflect the wider scope. In particular, changed the FunctionIndex* data structures to ModuleIndex*, and renamed related variables and comments. Also renamed the files to reflect the changes. A companion clang patch will immediately succeed this patch to reflect this renaming. llvm-svn: 263513
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 2e13958fdb1..de5aa73bd6d 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2245,7 +2245,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
}
/// Emit names for globals/functions etc. The VSTOffsetPlaceholder,
-/// BitcodeStartBit and FunctionIndex are only passed for the module-level
+/// BitcodeStartBit and ModuleSummaryIndex are only passed for the module-level
/// VST, where we are including a function bitcode index and need to
/// backpatch the VST forward declaration record.
static void WriteValueSymbolTable(
@@ -2347,7 +2347,6 @@ static void WriteValueSymbolTable(
// Save the word offset of the function (from the start of the
// actual bitcode written to the stream).
- assert(FunctionIndex->count(F) == 1);
uint64_t BitcodeIndex =
(*FunctionIndex)[F]->bitcodeIndex() - BitcodeStartBit;
assert((BitcodeIndex & 31) == 0 && "function block not 32-bit aligned");
@@ -2380,7 +2379,7 @@ static void WriteValueSymbolTable(
/// Emit function names and summary offsets for the combined index
/// used by ThinLTO.
static void
-WriteCombinedValueSymbolTable(const FunctionInfoIndex &Index,
+WriteCombinedValueSymbolTable(const ModuleSummaryIndex &Index,
BitstreamWriter &Stream,
std::map<uint64_t, unsigned> &GUIDToValueIdMap,
uint64_t VSTOffsetPlaceholder) {
@@ -2810,7 +2809,7 @@ static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) {
/// Write the module path strings, currently only used when generating
/// a combined index file.
-static void WriteModStrings(const FunctionInfoIndex &I,
+static void WriteModStrings(const ModuleSummaryIndex &I,
BitstreamWriter &Stream) {
Stream.EnterSubblock(bitc::MODULE_STRTAB_BLOCK_ID, 3);
@@ -3011,10 +3010,9 @@ static void WritePerModuleGlobalValueSummary(
Stream.ExitBlock();
}
-/// Emit the combined function summary section into the combined index
-/// file.
+/// Emit the combined summary section into the combined index file.
static void WriteCombinedGlobalValueSummary(
- const FunctionInfoIndex &I, BitstreamWriter &Stream,
+ const ModuleSummaryIndex &I, BitstreamWriter &Stream,
std::map<uint64_t, unsigned> &GUIDToValueIdMap, unsigned GlobalValueId) {
Stream.EnterSubblock(bitc::GLOBALVAL_SUMMARY_BLOCK_ID, 3);
@@ -3354,7 +3352,7 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out,
// Write the specified module summary index to the given raw output stream,
// where it will be written in a new bitcode block. This is used when
// writing the combined index file for ThinLTO.
-void llvm::WriteIndexToFile(const FunctionInfoIndex &Index, raw_ostream &Out) {
+void llvm::WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out) {
SmallVector<char, 0> Buffer;
Buffer.reserve(256 * 1024);
OpenPOWER on IntegriCloud