[llvm-commits] [llvm] r92255 - in /llvm/trunk: include/llvm/Metadata.h lib/VMCore/Metadata.cpp
Chris Lattner
sabre at nondot.org
Mon Dec 28 23:56:15 PST 2009
Author: lattner
Date: Tue Dec 29 01:56:15 2009
New Revision: 92255
URL: http://llvm.org/viewvc/llvm-project?rev=92255&view=rev
Log:
privatize another interface.
Modified:
llvm/trunk/include/llvm/Metadata.h
llvm/trunk/lib/VMCore/Metadata.cpp
Modified: llvm/trunk/include/llvm/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=92255&r1=92254&r2=92255&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Metadata.h (original)
+++ llvm/trunk/include/llvm/Metadata.h Tue Dec 29 01:56:15 2009
@@ -221,9 +221,6 @@
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
unsigned getMDKindID(StringRef Name) const;
- /// isValidName - Return true if Name is a valid custom metadata handler name.
- static bool isValidName(StringRef Name);
-
/// getMDKindNames - Populate client supplied SmallVector with the name for
/// each custom metadata ID. ID #0 is not used, so it is filled in as empty.
void getMDKindNames(SmallVectorImpl<StringRef> &) const;
Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=92255&r1=92254&r2=92255&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Dec 29 01:56:15 2009
@@ -389,8 +389,9 @@
MetadataContext::MetadataContext() : pImpl(new MetadataContextImpl()) { }
MetadataContext::~MetadataContext() { delete pImpl; }
+#ifndef NDEBUG
/// isValidName - Return true if Name is a valid custom metadata handler name.
-bool MetadataContext::isValidName(StringRef MDName) {
+static bool isValidName(StringRef MDName) {
if (MDName.empty())
return false;
@@ -404,9 +405,11 @@
}
return true;
}
+#endif
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
unsigned MetadataContext::getMDKindID(StringRef Name) const {
+ assert(isValidName(Name) && "Invalid MDNode name");
return pImpl->getMDKindID(Name);
}
More information about the llvm-commits
mailing list