aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-02 05:07:53 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-02 05:07:53 +0000
commitad5741b075518e840d4ef55bffe3e3cbf41c370b (patch)
treee9790c9f5f0f440bcc79fc8e5fcc9fc13ce143b6 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent2cd609482d0e5c8b4bd6cc32d3fd40cb2bfb6d91 (diff)
downloadllvm-ad5741b075518e840d4ef55bffe3e3cbf41c370b.zip
llvm-ad5741b075518e840d4ef55bffe3e3cbf41c370b.tar.gz
llvm-ad5741b075518e840d4ef55bffe3e3cbf41c370b.tar.bz2
Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Summary: This should make the code more readable, especially all the map declarations. Reviewers: tejohnson Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18721 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265215
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 84bdd8c..4ee53b5 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2397,11 +2397,10 @@ static void WriteValueSymbolTable(
/// Emit function names and summary offsets for the combined index
/// used by ThinLTO.
-static void
-WriteCombinedValueSymbolTable(const ModuleSummaryIndex &Index,
- BitstreamWriter &Stream,
- std::map<uint64_t, unsigned> &GUIDToValueIdMap,
- uint64_t VSTOffsetPlaceholder) {
+static void WriteCombinedValueSymbolTable(
+ const ModuleSummaryIndex &Index, BitstreamWriter &Stream,
+ std::map<GlobalValue::GUID, unsigned> &GUIDToValueIdMap,
+ uint64_t VSTOffsetPlaceholder) {
assert(VSTOffsetPlaceholder > 0 && "Expected non-zero VSTOffsetPlaceholder");
// Get the offset of the VST we are writing, and backpatch it into
// the VST forward declaration record.
@@ -2427,7 +2426,7 @@ WriteCombinedValueSymbolTable(const ModuleSummaryIndex &Index,
SmallVector<uint64_t, 64> NameVals;
for (const auto &FII : Index) {
- uint64_t FuncGUID = FII.first;
+ GlobalValue::GUID FuncGUID = FII.first;
const auto &VMI = GUIDToValueIdMap.find(FuncGUID);
assert(VMI != GUIDToValueIdMap.end());
@@ -3052,7 +3051,8 @@ static void WritePerModuleGlobalValueSummary(
/// Emit the combined summary section into the combined index file.
static void WriteCombinedGlobalValueSummary(
const ModuleSummaryIndex &I, BitstreamWriter &Stream,
- std::map<uint64_t, unsigned> &GUIDToValueIdMap, unsigned GlobalValueId) {
+ std::map<GlobalValue::GUID, unsigned> &GUIDToValueIdMap,
+ unsigned GlobalValueId) {
Stream.EnterSubblock(bitc::GLOBALVAL_SUMMARY_BLOCK_ID, 3);
// Abbrev for FS_COMBINED.
@@ -3445,7 +3445,7 @@ void llvm::WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out) {
// in writing out the call graph edges. Save the mapping from GUID
// to the new global value id to use when writing those edges, which
// are currently saved in the index in terms of GUID.
- std::map<uint64_t, unsigned> GUIDToValueIdMap;
+ std::map<GlobalValue::GUID, unsigned> GUIDToValueIdMap;
unsigned GlobalValueId = 0;
for (auto &II : Index)
GUIDToValueIdMap[II.first] = ++GlobalValueId;