summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorGuy Benyei <guy.benyei@intel.com>2013-02-12 21:21:59 +0000
committerGuy Benyei <guy.benyei@intel.com>2013-02-12 21:21:59 +0000
commit83c74e9fad4442998a780dc7707461713615fd82 (patch)
treefea31fcb6ba5dc4d108529fe1707cad4fc7eeb4f /llvm/lib/IR/LLVMContext.cpp
parent4e472b63280f208edf086c843725ec5935baa93f (diff)
downloadbcm5719-llvm-83c74e9fad4442998a780dc7707461713615fd82.tar.gz
bcm5719-llvm-83c74e9fad4442998a780dc7707461713615fd82.zip
Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
llvm-svn: 175006
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 8e2bbb79eeb..b73cd03ddd6 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -130,12 +130,13 @@ static bool isValidName(StringRef MDName) {
if (MDName.empty())
return false;
- if (!std::isalpha(MDName[0]))
+ 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(*I) && *I != '_' && *I != '-' && *I != '.')
+ if (!std::isalnum(static_cast<unsigned char>(*I)) && *I != '_' &&
+ *I != '-' && *I != '.')
return false;
}
return true;
OpenPOWER on IntegriCloud