[cfe-commits] r65645 - in /cfe/trunk: include/clang/Parse/DeclSpec.h lib/Parse/DeclSpec.cpp lib/Parse/Parser.cpp
Chris Lattner
sabre at nondot.org
Fri Feb 27 10:35:46 PST 2009
Author: lattner
Date: Fri Feb 27 12:35:46 2009
New Revision: 65645
URL: http://llvm.org/viewvc/llvm-project?rev=65645&view=rev
Log:
cleanup
Modified:
cfe/trunk/include/clang/Parse/DeclSpec.h
cfe/trunk/lib/Parse/DeclSpec.cpp
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=65645&r1=65644&r2=65645&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Parse/DeclSpec.h Fri Feb 27 12:35:46 2009
@@ -248,6 +248,12 @@
///
unsigned getParsedSpecifiers() const;
+ /// isEmpty - Return true if this declaration specifier is completely empty:
+ /// no tokens were parsed in the production of it.
+ bool isEmpty() const {
+ return getParsedSpecifiers() == DeclSpec::PQ_None;
+ }
+
void SetRangeStart(SourceLocation Loc) { Range.setBegin(Loc); }
void SetRangeEnd(SourceLocation Loc) { Range.setEnd(Loc); }
Modified: cfe/trunk/lib/Parse/DeclSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/DeclSpec.cpp?rev=65645&r1=65644&r2=65645&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/DeclSpec.cpp (original)
+++ cfe/trunk/lib/Parse/DeclSpec.cpp Fri Feb 27 12:35:46 2009
@@ -65,6 +65,7 @@
}
/// getParsedSpecifiers - Return a bitmask of which flavors of specifiers this
+/// declaration specifier includes.
///
unsigned DeclSpec::getParsedSpecifiers() const {
unsigned Res = 0;
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=65645&r1=65644&r2=65645&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Fri Feb 27 12:35:46 2009
@@ -549,7 +549,7 @@
// If this is C90 and the declspecs were completely missing, fudge in an
// implicit int. We do this here because this is the only place where
// declaration-specifiers are completely optional in the grammar.
- if (getLang().ImplicitInt && D.getDeclSpec().getParsedSpecifiers() == 0) {
+ if (getLang().ImplicitInt && D.getDeclSpec().isEmpty()) {
const char *PrevSpec;
D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int,
D.getIdentifierLoc(),
More information about the cfe-commits
mailing list