aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/LLVMContext.cpp')
-rw-r--r--lib/IR/LLVMContext.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
index c62bc09..b6d95c4 100644
--- a/lib/IR/LLVMContext.cpp
+++ b/lib/IR/LLVMContext.cpp
@@ -229,28 +229,10 @@ void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
// Metadata Kind Uniquing
//===----------------------------------------------------------------------===//
-#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 (!std::isalpha(static_cast<unsigned char>(MDName[0])))
- return false;
-
- for (StringRef::iterator I = MDName.begin() + 1, E = MDName.end(); I != E;
- ++I) {
- if (!std::isalnum(static_cast<unsigned char>(*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");
+ assert(!std::isdigit(Name.front()) &&
+ "Named metadata may not start with a digit");
// If this is new, assign it its ID.
return pImpl->CustomMDKindNames.insert(std::make_pair(