diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-02-09 10:09:43 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-02-09 10:09:43 +0000 |
commit | 223f0ff6a9a5d0eaf63b98b3aa92888b4c088868 (patch) | |
tree | 45a49912fa97753e4dd03ebe44f47808510bb1b8 /lib | |
parent | a4475a6b8277f24ed15d7b67d9dab77444c77cb1 (diff) |
Remove some stray uses of <ctype.h> functions.
These are causing assertions on some MSVC builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 2 | ||||
-rw-r--r-- | lib/Lex/HeaderMap.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 3 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index b943472f33..429d9d8cb2 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -471,7 +471,7 @@ SelectorTable::constructSetterName(IdentifierTable &Idents, SmallString<100> SelectorName; SelectorName = "set"; SelectorName += Name->getName(); - SelectorName[3] = toupper(SelectorName[3]); + SelectorName[3] = toUppercase(SelectorName[3]); IdentifierInfo *SetterName = &Idents.get(SelectorName); return SelTable.getUnarySelector(SetterName); } diff --git a/lib/Lex/HeaderMap.cpp b/lib/Lex/HeaderMap.cpp index 9be7b033f7..dcf1f0c70c 100644 --- a/lib/Lex/HeaderMap.cpp +++ b/lib/Lex/HeaderMap.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Lex/HeaderMap.h" +#include "clang/Basic/CharInfo.h" #include "clang/Basic/FileManager.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" @@ -61,7 +62,7 @@ static inline unsigned HashHMapKey(StringRef Str) { const char *S = Str.begin(), *End = Str.end(); for (; S != End; S++) - Result += tolower(*S) * 13; + Result += toLowercase(*S) * 13; return Result; } diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 04f6ba72fc..738e31ac57 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -14,6 +14,7 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" +#include "clang/Basic/CharInfo.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/MacroInfo.h" #include "clang/Lex/Preprocessor.h" @@ -6258,7 +6259,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property, // The uppercased name of the property name. std::string UpperKey = PropName->getName(); if (!UpperKey.empty()) - UpperKey[0] = toupper(UpperKey[0]); + UpperKey[0] = toUppercase(UpperKey[0]); bool ReturnTypeMatchesProperty = ReturnType.isNull() || Context.hasSameUnqualifiedType(ReturnType.getNonReferenceType(), diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index 771d82989b..0a94747d04 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -14,6 +14,7 @@ #include "ClangSACheckers.h" #include "InterCheckerAPI.h" +#include "clang/Basic/CharInfo.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" @@ -305,7 +306,7 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C, SmallString<80> buf; llvm::raw_svector_ostream os(buf); - os << (char)toupper(CurrentFunctionDescription[0]) + os << toUppercase(CurrentFunctionDescription[0]) << &CurrentFunctionDescription[1] << " accesses out-of-bound array element"; report = new BugReport(*BT, os.str(), N); |