diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-30 20:48:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-30 20:48:48 +0000 |
commit | a3b94ba2c58b2bea6ed75bddb0de825e8d2245d6 (patch) | |
tree | 349d96ca822fbfe76ff2878fb03678fe8071d50a /llvm/lib/VMCore/Metadata.cpp | |
parent | 607f14168a8e424fe9f82640be26667f5c80098d (diff) | |
download | bcm5719-llvm-a3b94ba2c58b2bea6ed75bddb0de825e8d2245d6.tar.gz bcm5719-llvm-a3b94ba2c58b2bea6ed75bddb0de825e8d2245d6.zip |
move some method definitions to files that make sense.
llvm-svn: 99927
Diffstat (limited to 'llvm/lib/VMCore/Metadata.cpp')
-rw-r--r-- | llvm/lib/VMCore/Metadata.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/llvm/lib/VMCore/Metadata.cpp b/llvm/lib/VMCore/Metadata.cpp index 69db83e2364..793c8744860 100644 --- a/llvm/lib/VMCore/Metadata.cpp +++ b/llvm/lib/VMCore/Metadata.cpp @@ -412,50 +412,6 @@ StringRef NamedMDNode::getName() const { } //===----------------------------------------------------------------------===// -// LLVMContext MDKind naming implementation. -// - -#ifndef NDEBUG -/// isValidName - Return true if Name is a valid custom metadata handler name. -static bool isValidName(StringRef MDName) { - if (MDName.empty()) - return false; - - if (!isalpha(MDName[0])) - return false; - - for (StringRef::iterator I = MDName.begin() + 1, E = MDName.end(); I != E; - ++I) { - if (!isalnum(*I) && *I != '_' && *I != '-' && *I != '.') - return false; - } - return true; -} -#endif - -/// getMDKindID - Return a unique non-zero ID for the specified metadata kind. -unsigned LLVMContext::getMDKindID(StringRef Name) const { - assert(isValidName(Name) && "Invalid MDNode name"); - - unsigned &Entry = pImpl->CustomMDKindNames[Name]; - - // If this is new, assign it its ID. - if (Entry == 0) Entry = pImpl->CustomMDKindNames.size(); - return Entry; -} - -/// getHandlerNames - Populate client supplied smallvector using custome -/// metadata name and ID. -void LLVMContext::getMDKindNames(SmallVectorImpl<StringRef> &Names) const { - Names.resize(pImpl->CustomMDKindNames.size()+1); - Names[0] = ""; - for (StringMap<unsigned>::const_iterator I = pImpl->CustomMDKindNames.begin(), - E = pImpl->CustomMDKindNames.end(); I != E; ++I) - // MD Handlers are numbered from 1. - Names[I->second] = I->first(); -} - -//===----------------------------------------------------------------------===// // Instruction Metadata method implementations. // |