diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:59:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:59:24 +0000 |
commit | 3692b09faa9fe346f39bc922db6dce48cdcc3f63 (patch) | |
tree | 345b316a71a538b837efa50e3cdda96182386e0d /lib/Lex/Pragma.cpp | |
parent | ef708fd4abccf4d21b1f82ab2ab62f6ae7cc1265 (diff) |
Convert the lexer and start converting the PP over to using canonical Diag methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r-- | lib/Lex/Pragma.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index cc224dd8d9..dd5f144e34 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -102,13 +102,17 @@ void Preprocessor::Handle_Pragma(Token &Tok) { // Read the '('. Lex(Tok); - if (Tok.isNot(tok::l_paren)) - return Diag(PragmaLoc, diag::err__Pragma_malformed); + if (Tok.isNot(tok::l_paren)) { + Diag(PragmaLoc, diag::err__Pragma_malformed); + return; + } // Read the '"..."'. Lex(Tok); - if (Tok.isNot(tok::string_literal) && Tok.isNot(tok::wide_string_literal)) - return Diag(PragmaLoc, diag::err__Pragma_malformed); + if (Tok.isNot(tok::string_literal) && Tok.isNot(tok::wide_string_literal)) { + Diag(PragmaLoc, diag::err__Pragma_malformed); + return; + } // Remember the string. std::string StrVal = getSpelling(Tok); @@ -116,8 +120,10 @@ void Preprocessor::Handle_Pragma(Token &Tok) { // Read the ')'. Lex(Tok); - if (Tok.isNot(tok::r_paren)) - return Diag(PragmaLoc, diag::err__Pragma_malformed); + if (Tok.isNot(tok::r_paren)) { + Diag(PragmaLoc, diag::err__Pragma_malformed); + return; + } // The _Pragma is lexically sound. Destringize according to C99 6.10.9.1. if (StrVal[0] == 'L') // Remove L prefix. |