aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-29 07:56:15 +0000
committerChris Lattner <sabre@nondot.org>2009-12-29 07:56:15 +0000
commitb0287c34b82a05b35ad143fff14d9e7d1bbce657 (patch)
treecb03a93d33df0ca2c4502dfa893f6afa9c202b80
parentcbabc2c806b1b10bfa31abd1f4a2e0611c68d2ba (diff)
downloadexternal_llvm-b0287c34b82a05b35ad143fff14d9e7d1bbce657.zip
external_llvm-b0287c34b82a05b35ad143fff14d9e7d1bbce657.tar.gz
external_llvm-b0287c34b82a05b35ad143fff14d9e7d1bbce657.tar.bz2
privatize another interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92255 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Metadata.h3
-rw-r--r--lib/VMCore/Metadata.cpp5
2 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index b7833a6..c25ce22 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -221,9 +221,6 @@ public:
/// 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;
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index 2698767..216d8a2 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/lib/VMCore/Metadata.cpp
@@ -389,8 +389,9 @@ void MetadataContextImpl::removeAllMetadata(Instruction *Inst) {
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 @@ bool MetadataContext::isValidName(StringRef MDName) {
}
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);
}