From c9558df1f0144f43c4c6025d2bef4aa2ead518ee Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 28 Dec 2009 20:10:43 +0000 Subject: rename getHandlerNames to getMDKindNames, simplify its interface and simplify all the clients that use it. llvm-svn: 92224 --- llvm/lib/VMCore/Metadata.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/VMCore/Metadata.cpp') diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 3d136ccf3c4..31e737f4150 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/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 >&) const; + void getMDKindNames(SmallVectorImpl &) 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 >&Names) const { - Names.resize(MDHandlerNames.size()); +getMDKindNames(SmallVectorImpl &Names) const { + Names.resize(MDHandlerNames.size()+1); + Names[0] = ""; for (StringMap::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 >&N) const { - pImpl->getHandlerNames(N); +void MetadataContext::getMDKindNames(SmallVectorImpl &N) const { + pImpl->getMDKindNames(N); } /// ValueIsDeleted - This handler is used to update metadata store -- cgit v1.2.3