diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-25 05:05:01 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-25 05:05:01 +0000 |
commit | 477aab6782795e7472055a54108d2df270ce1a89 (patch) | |
tree | ac4b8a2984dc4bf43bb859cd1a4b5484eaff586d /lib/Lex/Pragma.cpp | |
parent | abca5a1b3e74e644e297c7590b46ab73a6bb476a (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r-- | lib/Lex/Pragma.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index a1c4498a94..ecbf4cf4a0 100644 --- a/lib/Lex/Pragma.cpp +++ b/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; |