Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-11 Thread Olivier Goffart via cfe-commits
ogoffart abandoned this revision. ogoffart marked an inline comment as done. ogoffart added a comment. commited as r249982. (I forgot to add the link to reviews.llvm.org in the commit message. I'll do it next time) http://reviews.llvm.org/D13344 __

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-10 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaStmt.cpp:505-506 @@ -512,1 +504,4 @@ + } else { +ConditionExpr = new (Context) OpaqueValueExpr(SourceLocation(), + Context.VoidTy, VK_RValue); } Please

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-10 Thread Olivier Goffart via cfe-commits
ogoffart updated this revision to Diff 37035. ogoffart added a comment. The updated patch uses OpaqueValueExpr http://reviews.llvm.org/D13344 Files: lib/Sema/SemaStmt.cpp test/Misc/ast-dump-invalid.cpp Index: test/Misc/ast-dump-invalid.cpp ==

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-10 Thread Olivier Goffart via cfe-commits
ogoffart added a comment. Are the analysis run if there is an error? I think the consumer should expect null condition anyway. But i'll try to add an ErrorExpr anyway. http://reviews.llvm.org/D13344 ___ cfe-commits mailing list cfe-commits@lists.

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-07 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/Sema/SemaStmt.cpp:508-509 @@ -513,6 +507,4 @@ - DiagnoseUnusedExprResult(elseStmt); - return new (Context) IfStmt(Context, IfLoc, ConditionVar, ConditionExpr, thenStmt, ElseLoc, elseStmt); } --

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-01 Thread Manuel Klimek via cfe-commits
klimek added a reviewer: rsmith. klimek added a comment. +Richard, whom we need to validate AST changes to make sure they're benign. http://reviews.llvm.org/D13344 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

Re: [PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-01 Thread Milian Wolff via cfe-commits
milianw added a comment. Is there still an error reported for the invalid condition? Anyhow, from my POV this is excellent and should fix a bunch of issues I've seen when using clang-c in KDevelop. I never got around to investigating it, but it always was related to conditionals. I'm pretty sur

[PATCH] D13344: Keep the IfStmt node even if the condition is invalid

2015-10-01 Thread Olivier Goffart via cfe-commits
ogoffart created this revision. ogoffart added a reviewer: cfe-commits. This is quite useful for IDE's or other tools which would like to recover as much as possible even if there are a few errors in the code, and discarding the full 'if' bodies is unfortunate. http://reviews.llvm.org/D13344 F