[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-26 Thread Gauthier via Phabricator via cfe-commits
Tyker marked 2 inline comments as done. Tyker added inline comments. Comment at: clang/include/clang/AST/DeclCXX.h:2033 + + void setExplicitSpecifier(ExplicitSpecInfo ESI); + rsmith wrote: > Generally we don't want to have setters in the AST; the AST is

[PATCH] D60523: [clang] Don't segfault on incorrect using directive (PR41400)

2019-04-24 Thread Gauthier via Phabricator via cfe-commits
Tyker added a subscriber: jkooker. Tyker added a comment. @jkooker i don't think it is possible for `ASTContext::getDependentNameType` to deal with `NSS = nullptr` except by reporting the error. we probably don't want to just report the error because the error could have been handled before

[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-21 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 195990. Tyker added a comment. @Quuxplusone @riccibruno fixed / answered feedback CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60934/new/ https://reviews.llvm.org/D60934 Files: clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclBase.h

[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-20 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 195973. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60934/new/ https://reviews.llvm.org/D60934 Files: clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclBase.h clang/include/clang/AST/DeclCXX.h

[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-20 Thread Gauthier via Phabricator via cfe-commits
Tyker marked 2 inline comments as done. Tyker added inline comments. Comment at: clang/lib/Sema/DeclSpec.cpp:959 + // Each decl-specifier shall appear at most once in a complete + // decl-specifier-seq, except that long may appear twice. + if (hasExplicitSpecifier()) {

[PATCH] D60523: [clang] Bugfixe for 41400

2019-04-20 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. awaiting feedback on this Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60523/new/ https://reviews.llvm.org/D60523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D60934: [clang] adding explicit(bool) from c++2a

2019-04-20 Thread Gauthier via Phabricator via cfe-commits
Tyker created this revision. Tyker added a reviewer: rsmith. Herald added a reviewer: martong. Herald added a reviewer: shafik. Herald added a project: clang. Herald added a subscriber: cfe-commits. this patch adds support for the explicit bool specifier. added parsing for explicit bool

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-14 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 195056. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60561/new/ https://reviews.llvm.org/D60561 Files: clang/lib/AST/ExprConstant.cpp clang/test/SemaCXX/constant-expression-cxx1y.cpp Index: clang/test/SemaCXX/constant-expression-cxx1y.cpp

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-14 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 195055. Tyker added a comment. i changed the way arguments are stored. to make it more controllable. added an argument call stack where it is needed. this version slows down compilation by around 0.5% in average over 200 run for SemaDecl -fsyntax-only

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-13 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. the impact was much higher than i expected, around 1% slower in average on 50 compilation of SemaDecl with -fsyntax-only. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60561/new/ https://reviews.llvm.org/D60561 ___

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-12 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. @rsmith i don't think collecting theses values is expansive compared to evaluating the expression. but i agree that we can disable the collection of these values when it isn't needed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60561/new/

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-11 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 194684. Tyker added a comment. @Quuxplusone edited based of feedback i simplified the test but didn't put the original because this one test arguments for variable and literal and there may be corner case differences CHANGES SINCE LAST ACTION

[PATCH] D60561: [clang] fixing diagnostics of constexpr callstack

2019-04-11 Thread Gauthier via Phabricator via cfe-commits
Tyker created this revision. Tyker added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. this is a bugfix for this added a constant copy of argument to CallStackFrame. and use it in describeCall instead of

[PATCH] D60523: [clang] Bugfixe for 41400

2019-04-10 Thread Gauthier via Phabricator via cfe-commits
Tyker created this revision. Tyker added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. this is a bugfixe for bugtracker added nullptr check at the relevent place and test Repository: rC Clang

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-04-02 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 193284. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/AST/Stmt.h clang/include/clang/AST/StmtCXX.h clang/include/clang/AST/TextNodeDumper.h clang/include/clang/Basic/Attr.td

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-04-02 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 193269. Tyker added a comment. fixed the CFG issue is an proper way CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/AST/Stmt.h clang/include/clang/AST/StmtCXX.h

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-04-02 Thread Gauthier via Phabricator via cfe-commits
Tyker marked an inline comment as done. Tyker added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2208 +} + CFGBlock *CFGBuilder::VisitStmt(Stmt *S, AddStmtChoice asc) { NoQ wrote: > Tyker wrote: > > NoQ wrote: > > > Tyker wrote: > > > > riccibruno

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-04-01 Thread Gauthier via Phabricator via cfe-commits
Tyker marked an inline comment as done. Tyker added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2208 +} + CFGBlock *CFGBuilder::VisitStmt(Stmt *S, AddStmtChoice asc) { NoQ wrote: > Tyker wrote: > > riccibruno wrote: > > > I don't understand why this

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-31 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 193016. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/AST/Stmt.h clang/include/clang/AST/StmtCXX.h clang/include/clang/AST/TextNodeDumper.h clang/include/clang/Basic/Attr.td

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-31 Thread Gauthier via Phabricator via cfe-commits
Tyker marked an inline comment as done. Tyker added inline comments. Comment at: clang/lib/Sema/SemaStmt.cpp:528 +if (ElseLikelihoodAttr && ThenLikelihoodAttr->isEqual(ElseLikelihoodAttr)) { + Diag(ElseLikelihoodAttr->getLocation(), +

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-31 Thread Gauthier via Phabricator via cfe-commits
Tyker marked an inline comment as done. Tyker added inline comments. Herald added a subscriber: rnkovacs. Comment at: clang/test/SemaCXX/cxx2a-likelihood-attr.cpp:70 + +// clang-format off just saw the //clang format off at the bottom ill remove it CHANGES

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-31 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 193015. Tyker added a comment. Herald added a reviewer: martong. Herald added a reviewer: shafik. @riccibruno i fixed based on feedback everything except the CFG edit as i still need to analyse the situation. added AST and CodeGen for For, While, Do and

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-31 Thread Gauthier via Phabricator via cfe-commits
Tyker marked 2 inline comments as done. Tyker added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2208 +} + CFGBlock *CFGBuilder::VisitStmt(Stmt *S, AddStmtChoice asc) { riccibruno wrote: > I don't understand why this is needed. Can you explain it ?

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-30 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 192979. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/AST/Stmt.h clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td

[PATCH] D59467: [clang] Adding the Likelihood Attribute from C++2a

2019-03-29 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 192811. Tyker retitled this revision from "[clang] Adding the Likely Attribute from C++2a to AST" to "[clang] Adding the Likelihood Attribute from C++2a". Tyker added a comment. @aaron.ballman fixed based on feedback. added semantic support for switch

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-26 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. @lebedev.ri where are tests for AST serialization are located ? i didn't find them. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 ___ cfe-commits mailing list

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-23 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. @riccibruno Done CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-23 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 192012. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/AST/Stmt.h clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-23 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 192004. Tyker added a comment. i implemented the semantic the changes for if for, while and do while statement and the AST change to if. can you review it and tell me if it is fine so i implement the rest. i didn't update the test so they will fail. CHANGES

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-22 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. about the semantic issue. we will need for diagnostics purposes to detect attribute in branches during the semantic phase. so where and how can we store this information in the AST so that the CodeGen doesn't have to look through branches again for this attributes ?

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-22 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191862. Tyker added a comment. handled codegen for if, while, for and do/while, it will generate a @llvm.expect before the condition based on the attribute i changed slithly the semantic if (...) { //error [[likely]] ... } if (...) [[likely]] {

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-19 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191408. Tyker added a comment. Herald added a subscriber: jdoerfert. added diagnostics for contradictory attributes like for if: if (...) [[likely]] return 1; else [[likely]] return 2; handled the codegen for If to generate builtin_expect but i

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-18 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191115. Tyker added a comment. i think we are suppose to hook likely/unlikely on builtin_expected, for if, for, while, switch. but i have no idea how we could hook it if we need to support catch. i added a revision with likely/unlikely and the correct

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-17 Thread Gauthier via Phabricator via cfe-commits
Tyker added a comment. if likely/unlikely can be applied to any statement or label what should be generated when it is applied to a statement that don't have any conditional branch ? should it be ignored without warning or error ? CHANGES SINCE LAST ACTION

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-17 Thread Gauthier via Phabricator via cfe-commits
Tyker marked an inline comment as done. Tyker added a comment. I added the sema testes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-17 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191035. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-17 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191034. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-17 Thread Gauthier via Phabricator via cfe-commits
Tyker updated this revision to Diff 191031. Tyker added a comment. i added tests as you requested. i didn't add test for the codegen as it wasn't affected. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59467/new/ https://reviews.llvm.org/D59467 Files:

[PATCH] D59467: [clang] Adding the Likely Attribute from C++2a to AST

2019-03-16 Thread Gauthier via Phabricator via cfe-commits
Tyker created this revision. Tyker added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. attributes after an if like: if (...) [[likely]] are now applied on the if instead of the following statement. i added the likely attribute in the