diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:10:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:10:43 +0000 |
commit | 7d05c46d601cbb52be605019548c34286c02e3a3 (patch) | |
tree | 71f8c23f6c6a275b9674620119278f2bf9d34485 /lib/VMCore/Metadata.cpp | |
parent | 06ac32cc86ce88b940ffc0493a9bf54c8a720162 (diff) | |
download | external_llvm-7d05c46d601cbb52be605019548c34286c02e3a3.zip external_llvm-7d05c46d601cbb52be605019548c34286c02e3a3.tar.gz external_llvm-7d05c46d601cbb52be605019548c34286c02e3a3.tar.bz2 |
rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Metadata.cpp')
-rw-r--r-- | lib/VMCore/Metadata.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp index 3d136cc..31e737f 100644 --- a/lib/VMCore/Metadata.cpp +++ b/lib/VMCore/Metadata.cpp @@ -290,9 +290,9 @@ public: /// the same metadata to In2. void copyMD(Instruction *In1, Instruction *In2); - /// getHandlerNames - Populate client-supplied smallvector using custom + /// getMDKindNames - Populate client-supplied smallvector using custom /// metadata name and ID. - void getHandlerNames(SmallVectorImpl<std::pair<unsigned, StringRef> >&) const; + void getMDKindNames(SmallVectorImpl<StringRef> &) const; /// ValueIsDeleted - This handler is used to update metadata store /// when a value is deleted. @@ -415,12 +415,13 @@ getMDs(const Instruction *Inst, /// getHandlerNames - Populate client supplied smallvector using custome /// metadata name and ID. void MetadataContextImpl:: -getHandlerNames(SmallVectorImpl<std::pair<unsigned, StringRef> >&Names) const { - Names.resize(MDHandlerNames.size()); +getMDKindNames(SmallVectorImpl<StringRef> &Names) const { + Names.resize(MDHandlerNames.size()+1); + Names[0] = ""; for (StringMap<unsigned>::const_iterator I = MDHandlerNames.begin(), E = MDHandlerNames.end(); I != E; ++I) // MD Handlers are numbered from 1. - Names[I->second - 1] = std::make_pair(I->second, I->first()); + Names[I->second] = I->first(); } /// ValueIsCloned - This handler is used to update metadata store @@ -520,9 +521,8 @@ void MetadataContext::copyMD(Instruction *In1, Instruction *In2) { /// getHandlerNames - Populate client supplied smallvector using custome /// metadata name and ID. -void MetadataContext:: -getHandlerNames(SmallVectorImpl<std::pair<unsigned, StringRef> >&N) const { - pImpl->getHandlerNames(N); +void MetadataContext::getMDKindNames(SmallVectorImpl<StringRef> &N) const { + pImpl->getMDKindNames(N); } /// ValueIsDeleted - This handler is used to update metadata store |