diff options
| author | Juergen Ributzka <juergen@apple.com> | 2014-05-01 22:21:24 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@apple.com> | 2014-05-01 22:21:24 +0000 |
| commit | f01e809383af504b92aaf2e4c869c2446ec14982 (patch) | |
| tree | 12129e73bc6cf4efe8d21118be82cbe1fd45737c /llvm/lib | |
| parent | a665de8f382d1effee745d72fb497a80319c5c14 (diff) | |
| download | bcm5719-llvm-f01e809383af504b92aaf2e4c869c2446ec14982.tar.gz bcm5719-llvm-f01e809383af504b92aaf2e4c869c2446ec14982.zip | |
[Stackmaps] Replace the custom ConstantPool class with a MapVector.
llvm-svn: 207803
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/StackMaps.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp index 337982bc157..81a336eeda8 100644 --- a/llvm/lib/CodeGen/StackMaps.cpp +++ b/llvm/lib/CodeGen/StackMaps.cpp @@ -209,7 +209,8 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID, if (I->LocType == Location::Constant && ((I->Offset + (int64_t(1)<<31)) >> 32) != 0) { I->LocType = Location::ConstantIndex; - I->Offset = ConstPool.getConstantIndex(I->Offset); + auto Result = ConstPool.insert(std::make_pair(I->Offset, I->Offset)); + I->Offset = Result.first - ConstPool.begin(); } } @@ -334,9 +335,9 @@ void StackMaps::serializeToStackMapSection() { DEBUG(dbgs() << WSMP << "#functions = " << FnStackSize.size() << '\n'); AP.OutStreamer.EmitIntValue(FnStackSize.size(), 4); // Num constants. - DEBUG(dbgs() << WSMP << "#constants = " << ConstPool.getNumConstants() + DEBUG(dbgs() << WSMP << "#constants = " << ConstPool.size() << '\n'); - AP.OutStreamer.EmitIntValue(ConstPool.getNumConstants(), 4); + AP.OutStreamer.EmitIntValue(ConstPool.size(), 4); // Num callsites. DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << '\n'); AP.OutStreamer.EmitIntValue(CSInfos.size(), 4); @@ -349,8 +350,8 @@ void StackMaps::serializeToStackMapSection() { } // Constant pool entries. - for (unsigned i = 0; i < ConstPool.getNumConstants(); ++i) - AP.OutStreamer.EmitIntValue(ConstPool.getConstant(i), 8); + for (auto Constant : ConstPool) + AP.OutStreamer.EmitIntValue(Constant.second, 8); // Callsite entries. for (CallsiteInfoList::const_iterator CSII = CSInfos.begin(), @@ -473,4 +474,5 @@ void StackMaps::serializeToStackMapSection() { AP.OutStreamer.AddBlankLine(); CSInfos.clear(); + ConstPool.clear(); } |

