summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-05-25 05:05:01 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-05-25 05:05:01 +0000
commit0e37afa15ea127909573a8f65dad72f30f70f2f0 (patch)
tree1a40cc2c6dcb2788f47c95d15bce6e5e5321f3be /clang/lib/Lex/Pragma.cpp
parent0246d63715dfa2239c538b1a300183e8a64ff94a (diff)
downloadbcm5719-llvm-0e37afa15ea127909573a8f65dad72f30f70f2f0.tar.gz
bcm5719-llvm-0e37afa15ea127909573a8f65dad72f30f70f2f0.zip
A StringRef-ication of the DiagnosticIDs API and internals.
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static diagnostic data structures, which resulted in a huge global-var-init function. Depends on llvm commit r132046. llvm-svn: 132047
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r--clang/lib/Lex/Pragma.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index a1c4498a94d..ecbf4cf4a0d 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -898,8 +898,7 @@ public:
return;
}
- std::string WarningName(Literal.GetString(),
- Literal.GetString()+Literal.GetStringLength());
+ llvm::StringRef WarningName(Literal.GetString(), Literal.GetStringLength());
if (WarningName.size() < 3 || WarningName[0] != '-' ||
WarningName[1] != 'W') {
@@ -908,7 +907,7 @@ public:
return;
}
- if (PP.getDiagnostics().setDiagnosticGroupMapping(WarningName.c_str()+2,
+ if (PP.getDiagnostics().setDiagnosticGroupMapping(WarningName.substr(2),
Map, DiagLoc))
PP.Diag(StrToks[0].getLocation(),
diag::warn_pragma_diagnostic_unknown_warning) << WarningName;
OpenPOWER on IntegriCloud