[PATCH] D54958: [OPENMP] remove redundant ColonExpected flag in ParseOpenMP.cpp - (NFC)
Ahsan Saghir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 27 10:53:47 PST 2018
saghir created this revision.
saghir added reviewers: ABataev, kkwli0, RaviNarayanaswamy, mikerice, Hahnfeld, hfinkel, gtbercea.
saghir added a project: OpenMP.
Herald added subscribers: cfe-commits, guansong.
In ParseOpenMP.cpp:
bool ColonExpected = false;
...
...
...
else if (ColonExpected)
Diag(Tok, diag::warn_pragma_expected_colon) << "map type";
The flag ColonExpected is not changed after being initialized to false at declaration. Hence, the code within the else if is never executed.
We should remove all instances of this flag.
Repository:
rC Clang
https://reviews.llvm.org/D54958
Files:
clang/lib/Parse/ParseOpenMP.cpp
Index: clang/lib/Parse/ParseOpenMP.cpp
===================================================================
--- clang/lib/Parse/ParseOpenMP.cpp
+++ clang/lib/Parse/ParseOpenMP.cpp
@@ -1867,7 +1867,6 @@
getOpenMPSimpleClauseType(Kind, PP.getSpelling(Tok)))
: OMPC_MAP_unknown;
Data.DepLinMapLoc = Tok.getLocation();
- bool ColonExpected = false;
if (IsMapClauseModifierToken(Tok)) {
if (PP.LookAhead(0).is(tok::colon)) {
@@ -1935,8 +1934,6 @@
if (Tok.is(tok::colon))
Data.ColonLoc = ConsumeToken();
- else if (ColonExpected)
- Diag(Tok, diag::warn_pragma_expected_colon) << "map type";
}
bool IsComma =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54958.175531.patch
Type: text/x-patch
Size: 685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181127/49df9a92/attachment.bin>
More information about the cfe-commits
mailing list