aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-22 01:01:24 +0000
committerDevang Patel <dpatel@apple.com>2009-10-22 01:01:24 +0000
commitce6a1c97569ce65a60340b20e65abd0787969942 (patch)
tree8eb4a75066bed7ec40bb723a7f3202d7f31c6f87 /lib/Bitcode/Writer/BitcodeWriter.cpp
parent316e3268a8ba371b92ec57952a4c1ee1ef6ae5ce (diff)
Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index a8c1ef7c72..947b8958a1 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -602,11 +602,13 @@ static void WriteModuleMetadataStore(const Module *M,
// Write metadata kinds
// METADATA_KIND - [n x [id, name]]
MetadataContext &TheMetadata = M->getContext().getMetadata();
- const StringMap<unsigned> *Kinds = TheMetadata.getHandlerNames();
- for (StringMap<unsigned>::const_iterator
- I = Kinds->begin(), E = Kinds->end(); I != E; ++I) {
- Record.push_back(I->second);
- StringRef KName = I->first();
+ SmallVector<std::pair<unsigned, StringRef>, 4> Names;
+ TheMetadata.getHandlerNames(Names);
+ for (SmallVector<std::pair<unsigned, StringRef>, 4>::iterator
+ I = Names.begin(),
+ E = Names.end(); I != E; ++I) {
+ Record.push_back(I->first);
+ StringRef KName = I->second;
for (unsigned i = 0, e = KName.size(); i != e; ++i)
Record.push_back(KName[i]);
if (!StartedMetadataBlock) {