[cfe-commits] r39505 - in /cfe/cfe/trunk: AST/StmtPrinter.cpp include/clang/AST/Stmt.h include/clang/AST/StmtNodes.def
clattner at cs.uiuc.edu
clattner at cs.uiuc.edu
Wed Jul 11 09:45:04 PDT 2007
Author: clattner
Date: Wed Jul 11 11:45:04 2007
New Revision: 39505
URL: http://llvm.org/viewvc/llvm-project?rev=39505&view=rev
Log:
add a NullStmt ast node.
Modified:
cfe/cfe/trunk/AST/StmtPrinter.cpp
cfe/cfe/trunk/include/clang/AST/Stmt.h
cfe/cfe/trunk/include/clang/AST/StmtNodes.def
Modified: cfe/cfe/trunk/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/StmtPrinter.cpp?rev=39505&r1=39504&r2=39505&view=diff
==============================================================================
--- cfe/cfe/trunk/AST/StmtPrinter.cpp (original)
+++ cfe/cfe/trunk/AST/StmtPrinter.cpp Wed Jul 11 11:45:04 2007
@@ -105,6 +105,10 @@
Indent() << "}";
}
+void StmtPrinter::VisitNullStmt(NullStmt *Node) {
+ Indent() << ";\n";
+}
+
void StmtPrinter::VisitCompoundStmt(CompoundStmt *Node) {
Indent();
PrintRawCompoundStmt(Node);
Modified: cfe/cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Stmt.h?rev=39505&r1=39504&r2=39505&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Stmt.h Wed Jul 11 11:45:04 2007
@@ -62,6 +62,22 @@
static bool classof(const Stmt *) { return true; }
};
+/// NullStmt - This is the null statement ";": C99 6.8.3p3.
+///
+class NullStmt : public Stmt {
+ SourceLocation SemiLoc;
+public:
+ NullStmt(SourceLocation L) : Stmt(NullStmtClass), SemiLoc(L) {}
+
+ SourceLocation getSemiLoc() const { return SemiLoc; }
+
+ virtual void visit(StmtVisitor &Visitor);
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == NullStmtClass;
+ }
+ static bool classof(const NullStmt *) { return true; }
+};
+
/// CompoundStmt - This represents a group of statements like { stmt stmt }.
///
class CompoundStmt : public Stmt {
Modified: cfe/cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/StmtNodes.def?rev=39505&r1=39504&r2=39505&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/cfe/trunk/include/clang/AST/StmtNodes.def Wed Jul 11 11:45:04 2007
@@ -23,21 +23,22 @@
// Normal Statements.
FIRST_STMT(1)
-STMT(1, CompoundStmt , Stmt)
-STMT(2, CaseStmt , Stmt)
-STMT(3, DefaultStmt , Stmt)
-STMT(4, LabelStmt , Stmt)
-STMT(5, IfStmt , Stmt)
-STMT(6, SwitchStmt , Stmt)
-STMT(7, WhileStmt , Stmt)
-STMT(8, DoStmt , Stmt)
-STMT(9, ForStmt , Stmt)
-STMT(10, GotoStmt , Stmt)
-STMT(11, IndirectGotoStmt, Stmt)
-STMT(12, ContinueStmt , Stmt)
-STMT(13, BreakStmt , Stmt)
-STMT(14, ReturnStmt , Stmt)
-LAST_STMT(14)
+STMT( 1, NullStmt , Stmt)
+STMT( 2, CompoundStmt , Stmt)
+STMT( 3, CaseStmt , Stmt)
+STMT( 4, DefaultStmt , Stmt)
+STMT( 5, LabelStmt , Stmt)
+STMT( 6, IfStmt , Stmt)
+STMT( 7, SwitchStmt , Stmt)
+STMT( 8, WhileStmt , Stmt)
+STMT( 9, DoStmt , Stmt)
+STMT(10, ForStmt , Stmt)
+STMT(11, GotoStmt , Stmt)
+STMT(12, IndirectGotoStmt, Stmt)
+STMT(13, ContinueStmt , Stmt)
+STMT(14, BreakStmt , Stmt)
+STMT(15, ReturnStmt , Stmt)
+LAST_STMT(15)
FIRST_EXPR(32)
// Expressions.
More information about the cfe-commits
mailing list