[cfe-commits] r163149 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Sema/ include/clang/Serialization/ lib/AST/ lib/CodeGen/ lib/Parse/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/Core/ test/Parser/ tools/libclang/
Joao Matos
ripzonetriton at gmail.com
Tue Sep 4 10:49:35 PDT 2012
Author: triton
Date: Tue Sep 4 12:49:35 2012
New Revision: 163149
URL: http://llvm.org/viewvc/llvm-project?rev=163149&view=rev
Log:
Revert r163083 per chandlerc's request.
Modified:
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/StmtNodes.td
cfe/trunk/include/clang/Sema/Scope.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/trunk/test/Parser/MicrosoftExtensions.c
cfe/trunk/tools/libclang/RecursiveASTVisitor.h
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Sep 4 12:49:35 2012
@@ -2202,7 +2202,6 @@
})
DEF_TRAVERSE_STMT(SEHTryStmt, {})
-DEF_TRAVERSE_STMT(SEHLeaveStmt, {})
DEF_TRAVERSE_STMT(SEHExceptStmt, {})
DEF_TRAVERSE_STMT(SEHFinallyStmt,{})
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Tue Sep 4 12:49:35 2012
@@ -1889,34 +1889,6 @@
static bool classof(SEHTryStmt *) { return true; }
};
-class SEHLeaveStmt : public Stmt {
- SourceLocation LeaveLoc;
-
- SEHLeaveStmt(SourceLocation LeaveLoc);
-
- friend class ASTReader;
- friend class ASTStmtReader;
- explicit SEHLeaveStmt(EmptyShell E) : Stmt(SEHLeaveStmtClass, E) { }
-
-public:
- static SEHLeaveStmt* Create(ASTContext &C,
- SourceLocation LeaveLoc);
-
- SourceRange getSourceRange() const LLVM_READONLY {
- return SourceRange(getLeaveLoc());
- }
-
- SourceLocation getLeaveLoc() const { return LeaveLoc; }
-
- child_range children() { return child_range(); }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == SEHLeaveStmtClass;
- }
-
- static bool classof(SEHLeaveStmt *) { return true; }
-};
-
} // end namespace clang
#endif
Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Tue Sep 4 12:49:35 2012
@@ -740,9 +740,6 @@
def err_seh___finally_block : Error<
"%0 only allowed in __finally block">;
-
-def err_seh___try_block : Error<
- "%0 only allowed in __try block">;
} // end of Parse Issue category.
Modified: cfe/trunk/include/clang/Basic/StmtNodes.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/StmtNodes.td (original)
+++ cfe/trunk/include/clang/Basic/StmtNodes.td Tue Sep 4 12:49:35 2012
@@ -164,7 +164,6 @@
// Microsoft Extensions.
def CXXUuidofExpr : DStmt<Expr>;
def SEHTryStmt : Stmt;
-def SEHLeaveStmt : Stmt;
def SEHExceptStmt : Stmt;
def SEHFinallyStmt : Stmt;
def MSDependentExistsStmt : Stmt;
Modified: cfe/trunk/include/clang/Sema/Scope.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Scope.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Scope.h (original)
+++ cfe/trunk/include/clang/Sema/Scope.h Tue Sep 4 12:49:35 2012
@@ -82,10 +82,7 @@
SwitchScope = 0x800,
/// TryScope - This is the scope of a C++ try statement.
- TryScope = 0x1000,
-
- /// SEHTryScope - This is scope of a Microsoft SEH try statement.
- SEHTryScope = 0x2000
+ TryScope = 0x1000
};
private:
/// The parent scope for this scope. This is null for the translation-unit
@@ -295,9 +292,6 @@
/// \brief Determine whether this scope is a C++ 'try' block.
bool isTryScope() const { return getFlags() & Scope::TryScope; }
- /// \brief Determine whether this scope is a MS SEH 'try' block.
- bool isSEHTryScope() const { return getFlags() & Scope::SEHTryScope; }
-
/// containedInPrototypeScope - Return true if this or a parent scope
/// is a FunctionPrototypeScope.
bool containedInPrototypeScope() const;
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Sep 4 12:49:35 2012
@@ -2622,8 +2622,6 @@
Stmt *TryBlock,
Stmt *Handler);
- StmtResult ActOnSEHLeaveStmt(SourceLocation LeaveLoc);
-
StmtResult ActOnSEHExceptBlock(SourceLocation Loc,
Expr *FilterExpr,
Stmt *Block);
Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Tue Sep 4 12:49:35 2012
@@ -1204,7 +1204,6 @@
STMT_SEH_EXCEPT, // SEHExceptStmt
STMT_SEH_FINALLY, // SEHFinallyStmt
STMT_SEH_TRY, // SEHTryStmt
- STMT_SEH_LEAVE, // SEHLeaveStmt
// ARC
EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Tue Sep 4 12:49:35 2012
@@ -1006,17 +1006,6 @@
return dyn_cast<SEHFinallyStmt>(getHandler());
}
-SEHLeaveStmt::SEHLeaveStmt(SourceLocation LeaveLoc)
- : Stmt(SEHLeaveStmtClass),
- LeaveLoc(LeaveLoc)
-{
-}
-
-SEHLeaveStmt* SEHLeaveStmt::Create(ASTContext &C,
- SourceLocation LeaveLoc) {
- return new(C) SEHLeaveStmt(LeaveLoc);
-}
-
SEHExceptStmt::SEHExceptStmt(SourceLocation Loc,
Expr *FilterExpr,
Stmt *Block)
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Sep 4 12:49:35 2012
@@ -537,11 +537,6 @@
OS << "\n";
}
-void StmtPrinter::VisitSEHLeaveStmt(SEHLeaveStmt *Node) {
- Indent() << "__leave;";
- OS << "\n";
-}
-
void StmtPrinter::PrintRawSEHFinallyStmt(SEHFinallyStmt *Node) {
OS << "__finally ";
PrintRawCompoundStmt(Node->getBlock());
@@ -551,7 +546,7 @@
void StmtPrinter::PrintRawSEHExceptHandler(SEHExceptStmt *Node) {
OS << "__except (";
VisitExpr(Node->getFilterExpr());
- OS << ") ";
+ OS << ")\n";
PrintRawCompoundStmt(Node->getBlock());
OS << "\n";
}
Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Tue Sep 4 12:49:35 2012
@@ -215,10 +215,6 @@
VisitStmt(S);
}
-void StmtProfiler::VisitSEHLeaveStmt(const SEHLeaveStmt *S) {
- VisitStmt(S);
-}
-
void StmtProfiler::VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S) {
VisitStmt(S);
}
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Tue Sep 4 12:49:35 2012
@@ -163,7 +163,6 @@
case Stmt::CXXForRangeStmtClass:
EmitCXXForRangeStmt(cast<CXXForRangeStmt>(*S));
case Stmt::SEHTryStmtClass:
- case Stmt::SEHLeaveStmtClass:
// FIXME Not yet implemented
break;
}
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Sep 4 12:49:35 2012
@@ -183,19 +183,6 @@
return ParseExprStatement();
}
-
- case tok::kw___leave: {
- Token LeaveTok = Tok;
- ConsumeToken();
- if (getCurScope()->isSEHTryScope()) {
- Res = Actions.ActOnSEHLeaveStmt(LeaveTok.getLocation());
- } else {
- Diag(LeaveTok, diag::err_seh___try_block)
- << LeaveTok.getIdentifierInfo()->getName();
- Res = StmtError();
- }
- break;
- }
case tok::kw_case: // C99 6.8.1: labeled-statement
return ParseCaseStatement();
@@ -335,9 +322,7 @@
if(Tok.isNot(tok::l_brace))
return StmtError(Diag(Tok,diag::err_expected_lbrace));
- // Use the SEHTryScope to handle __leave as a statement.
- unsigned ScopeFlags = Scope::DeclScope | Scope::SEHTryScope;
- StmtResult TryBlock(ParseCompoundStatement(false /*isStmtExpr*/, ScopeFlags));
+ StmtResult TryBlock(ParseCompoundStatement());
if(TryBlock.isInvalid())
return TryBlock;
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Tue Sep 4 12:49:35 2012
@@ -2746,12 +2746,6 @@
}
StmtResult
-Sema::ActOnSEHLeaveStmt(SourceLocation LeaveLoc)
-{
- return Owned(SEHLeaveStmt::Create(Context, LeaveLoc));
-}
-
-StmtResult
Sema::ActOnSEHExceptBlock(SourceLocation Loc,
Expr *FilterExpr,
Stmt *Block) {
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Sep 4 12:49:35 2012
@@ -1361,10 +1361,6 @@
return getSema().ActOnSEHTryBlock(IsCXXTry,TryLoc,TryBlock,Handler);
}
- StmtResult RebuildSEHLeaveStmt(SourceLocation LeaveLoc) {
- return getSema().ActOnSEHLeaveStmt(LeaveLoc);
- }
-
StmtResult RebuildSEHExceptStmt(SourceLocation Loc,
Expr *FilterExpr,
Stmt *Block) {
@@ -6005,12 +6001,6 @@
template<typename Derived>
StmtResult
-TreeTransform<Derived>::TransformSEHLeaveStmt(SEHLeaveStmt *S) {
- return getDerived().RebuildSEHLeaveStmt(S->getLeaveLoc());
-}
-
-template<typename Derived>
-StmtResult
TreeTransform<Derived>::TransformSEHFinallyStmt(SEHFinallyStmt *S) {
StmtResult Block; // = getDerived().TransformCompoundStatement(S->getBlock());
if(Block.isInvalid()) return StmtError();
Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Tue Sep 4 12:49:35 2012
@@ -1516,11 +1516,6 @@
S->Children[SEHTryStmt::HANDLER] = Reader.ReadSubStmt();
}
-void ASTStmtReader::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
- VisitStmt(S);
- S->LeaveLoc = ReadSourceLocation(Record, Idx);
-}
-
//===----------------------------------------------------------------------===//
// CUDA Expressions and Statements
//===----------------------------------------------------------------------===//
@@ -1991,9 +1986,6 @@
case STMT_SEH_TRY:
S = new (Context) SEHTryStmt(Empty);
break;
- case STMT_SEH_LEAVE:
- S = new (Context) SEHLeaveStmt(Empty);
- break;
case STMT_CXX_CATCH:
S = new (Context) CXXCatchStmt(Empty);
break;
Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Tue Sep 4 12:49:35 2012
@@ -1554,12 +1554,6 @@
Code = serialization::STMT_SEH_TRY;
}
-void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {
- VisitStmt(S);
- Writer.AddSourceLocation(S->getLeaveLoc(), Record);
- Code = serialization::STMT_SEH_LEAVE;
-}
-
//===----------------------------------------------------------------------===//
// ASTWriter Implementation
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Tue Sep 4 12:49:35 2012
@@ -527,7 +527,6 @@
case Stmt::PackExpansionExprClass:
case Stmt::SubstNonTypeTemplateParmPackExprClass:
case Stmt::SEHTryStmtClass:
- case Stmt::SEHLeaveStmtClass:
case Stmt::SEHExceptStmtClass:
case Stmt::LambdaExprClass:
case Stmt::SEHFinallyStmtClass: {
Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Tue Sep 4 12:49:35 2012
@@ -102,9 +102,3 @@
struct S7 s;
int i = s.t; /* expected-warning {{'t' is deprecated}} */
}
-
-void SEH() {
- __try { __leave; } __except (0) {}
- __try { } __except (0) { __leave; } // expected-error {{__leave only allowed in __try block}}
- __try { } __finally { __leave; } // expected-error {{__leave only allowed in __try block}}
-}
\ No newline at end of file
Modified: cfe/trunk/tools/libclang/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/RecursiveASTVisitor.h?rev=163149&r1=163148&r2=163149&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/RecursiveASTVisitor.h (original)
+++ cfe/trunk/tools/libclang/RecursiveASTVisitor.h Tue Sep 4 12:49:35 2012
@@ -2122,7 +2122,6 @@
})
DEF_TRAVERSE_STMT(SEHTryStmt, {})
-DEF_TRAVERSE_STMT(SEHLeaveStmt, {})
DEF_TRAVERSE_STMT(SEHExceptStmt, {})
DEF_TRAVERSE_STMT(SEHFinallyStmt,{})
More information about the cfe-commits
mailing list