diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-22 01:01:24 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-22 01:01:24 +0000 |
commit | 0fffb49d56fb6bf2008d9bb3292335be3d1263c1 (patch) | |
tree | 376076303663c7b568dd70c87fb645bb5e893c52 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 7a0d49da1bbe4df67a951c0ff2306a66895282fc (diff) | |
download | bcm5719-llvm-0fffb49d56fb6bf2008d9bb3292335be3d1263c1.tar.gz bcm5719-llvm-0fffb49d56fb6bf2008d9bb3292335be3d1263c1.zip |
Fix getHandlerNames() interface. Now it populate clinet supplied small vector with handler names.
llvm-svn: 84820
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index a8c1ef7c728..947b8958a12 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/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) { |