[PATCH] D74081: [clang][Analysis] CallGraph: store the actual call `Expr*` in the CallGraphNode::CallRecord

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd68c7b8e3e4d: [clang][Analysis] CallGraph: store the actual call `Expr*` in the CallGraphNode… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D72239: [clang-tidy] new opencl recursion not supported check

2020-02-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. D72362 has landed. I'd advise to see if any of the testcases here aren't being reported by that check, and filing a bugs for them. Other than that, abandon? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://re

[PATCH] D73996: [Sema] Demote call-site-based 'alignment is a power of two' check for AllocAlignAttr into a warning

2020-02-17 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Bump @rsmith / @erichkeane thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73996/new/ https://reviews.llvm.org/D73996 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D73020: [Sema] Perform call checking when building CXXNewExpr

2020-02-17 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Bump @rsmith thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73020/new/ https://reviews.llvm.org/D73020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D74801: [ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()

2020-02-18 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. While i certainly agree that it's kinda confusing, i'm not really sure this is conceptually correct change. https://en.wikipedia.org/wiki/Loop_(graph_theory) > In graph theory, a loop (also called a self-loop or a "buckle") is an edge > that connects a vertex to itse

[PATCH] D74801: [ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()

2020-02-18 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: llvm/tools/opt/PrintSCC.cpp:82-83 errs() << (*I)->getName() << ", "; -if (nextSCC.size() == 1 && SCCI.hasLoop()) - errs() << " (Has self-loop)."; +if (nextSCC.size() == 1 && SCCI.hasCycle()) + errs() << " (Has

[PATCH] D74801: [ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()

2020-02-18 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: llvm/tools/opt/PrintSCC.cpp:82-83 errs() << (*I)->getName() << ", "; -if (nextSCC.size() == 1 && SCCI.hasLoop()) - errs() << " (Has self-loop)."; +if (nextSCC.size() == 1 && SCCI.hasCycle()) + errs() << " (Has

[PATCH] D72979: [Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist

2020-01-18 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, jdoerfert, aaron.ballman. lebedev.ri added a project: clang. lebedev.ri edited the summary of this revision. We shouldn't be just giving up if we find one of them (like we currently do with `AssumeAlignedAttr`), we should em

[PATCH] D72993: [NFC][Codegen] Use MaybeAlign + APInt::getLimitedValue() when creating Alignment attr

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, gchatelet, courbet, jdoerfert. lebedev.ri added a project: clang. lebedev.ri added a parent revision: D72979: [Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist. Just an NFC code cleanup i st

[PATCH] D72994: [Sema] Sanitize alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert. lebedev.ri added a project: LLVM. Herald added a project: clang. Herald added a subscriber: cfe-commits. lebedev.ri added a parent revision: D72993: [NFC][Codegen] Use MaybeAlign +

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert. lebedev.ri added a project: LLVM. Herald added a project: clang. Herald added a subscriber: cfe-commits. lebedev.ri added a parent revision: D72994: [Sema] Sanity-check alignment r

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, hfinkel, jdoerfert, gchatelet, courbet. lebedev.ri added a project: LLVM. Herald added subscribers: cfe-commits, hiraditya. Herald added a project: clang. lebedev.ri added a parent revision: D72996: [Sema] Attempt to perform

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72998#1828559 , @hfinkel wrote: > Can we, at least, put this constant in a header file so we don't repeat it in > several places? Remember, we can't use `llvm::Value::MaximumAlignment` itself in clang sema. Which header d

[PATCH] D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith. lebedev.ri added a project: clang. lebedev.ri added a parent revision: D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on ca

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith. lebedev.ri added a project: clang. lebedev.ri added a child revision: D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-si

[PATCH] D73020: [Sema] Perform call checking when building CXXNewExpr

2020-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: rsmith, erichkeane, aaron.ballman, jdoerfert. lebedev.ri added a project: clang. lebedev.ri added a parent revision: D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

[PATCH] D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

2020-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: erichkeane, rsmith, aaron.ballman, jdoerfert. lebedev.ri added a project: clang. lebedev.ri added a parent revision: D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site funct

[PATCH] D73020: [Sema] Perform call checking when building CXXNewExpr

2020-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri planned changes to this revision. lebedev.ri added a comment. Ah right, hmm, posted too soon. I actually need to synthesize the size/align arguments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73020/new/ https://reviews.llvm.org/D7302

[PATCH] D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

2020-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239179. lebedev.ri added a comment. NFC, more tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73019/new/ https://reviews.llvm.org/D73019 Files: clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCXX/st

[PATCH] D73020: [Sema] Perform call checking when building CXXNewExpr

2020-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239180. lebedev.ri added a comment. Not only do we need to 'insert' size implicit argument, but we may need to insert alignment implicit argument. And while for size we can only insert `nullptr`, for alignment we can actually insert the correct value. Rep

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72998#1831377 , @erichkeane wrote: > In D72998#1828571 , @lebedev.ri > wrote: > > > In D72998#1828559 , @hfinkel wrote: > > > > > Can we, at

[PATCH] D72979: [Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG372cb38f4510: [Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D72993: [NFC][Codegen] Use MaybeAlign + APInt::getLimitedValue() when creating Alignment attr

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6b2f820221c7: [NFC][Codegen] Use MaybeAlign + APInt::getLimitedValue() when creating… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked an inline comment as done. lebedev.ri added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:4479 +const Expr *Arg = Args[AA->getParamIndex().getASTIndex()]; +if (!Arg->isTypeDependent() && !Arg->isValueDependent()) { + llvm::APSInt I(64

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239421. lebedev.ri added a comment. Add constants to `Sema` class. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72998/new/ https://reviews.llvm.org/D72998 Files: clang/include/clang/Sema/Sema.h clang/l

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 2 inline comments as done. lebedev.ri added inline comments. Comment at: clang/test/CodeGen/assume-aligned-and-alloc-align-attributes.c:12 // CHECK-NEXT:[[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 0 // CHECK-NEXT:call void @llvm.assume(i1 [[MASKCOND]

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-22 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:4479 +const Expr *Arg = Args[AA->getParamIndex().getASTIndex()]; +if (!Arg->isTypeDependent() && !Arg->isValueDependent()) { + llvm::APSInt I(64); lebedev.ri wrote: > erich

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-22 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239642. lebedev.ri marked 4 inline comments as done. lebedev.ri added a comment. `isValueDependent()` already implies `isTypeDependent()`, don't recheck it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72996

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 5 inline comments as done. lebedev.ri added a comment. Thank you for taking a look! Comment at: clang/lib/CodeGen/CGCall.cpp:3836 + + llvm::Value *Alignment;// May or may not be a constant. + llvm::ConstantInt *OffsetCI = nullptr; // Constant

[PATCH] D72993: [NFC][Codegen] Use MaybeAlign + APInt::getLimitedValue() when creating Alignment attr

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72993#1828934 , @gchatelet wrote: > Thx! Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72993/new/ https://reviews.llvm.org/D72993 _

[PATCH] D72979: [Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72979/new/ https://reviews.llvm.org/D72979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D72994: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72994#1836495 , @erichkeane wrote: > LGTM. note to other reviewers, D72998 > fixes the max alignment constant in this. Thank you for the review! Repository: rG LLVM Github Monorepo

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72996/new/ https://reviews.llvm.org/D72996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for the reviews! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72998/new/ https://reviews.llvm.org/D72998 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239930. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73006/new/ https://reviews.llvm.org/D73006 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/assume-a

[PATCH] D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D73019#1836529 , @erichkeane wrote: > This makes a lot of sense to me. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73019/new/ https://reviews.llv

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73005/new/ https://reviews.llvm.org/D73005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239928. lebedev.ri marked 4 inline comments as done. lebedev.ri added a comment. Init `Alignment` to `nullptr` by default. While there, tune `maybeRaiseRetAlignmentAttribute()` to do nothing if new alignment is not greater than the existing alignment. Rep

[PATCH] D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73006/new/ https://reviews.llvm.org/D73006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D72994: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239955. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72994/new/ https://reviews.llvm.org/D72994 Files: clang/lib/Sema/SemaDeclAttr.cpp clang/test/Sema/builtin-

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239958. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73005/new/ https://reviews.llvm.org/D73005 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/assume-a

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239957. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72998/new/ https://reviews.llvm.org/D72998 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCheck

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239956. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72996/new/ https://reviews.llvm.org/D72996 Files: clang/lib/Sema/SemaChecking.cpp clang/test/Sema/alloc-al

[PATCH] D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239959. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73006/new/ https://reviews.llvm.org/D73006 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/assume-a

[PATCH] D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 239960. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73019/new/ https://reviews.llvm.org/D73019 Files: clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCXX/std-a

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd096f8d306b2: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D72994: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa4cfb15d15a8: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc2a9061ac516: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D73006: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5ffe6408ffb6: [Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D73005: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe819f7c9feb4: [Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D73019: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb749af6a1ff4: [Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D72994: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri reopened this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. Seeing some bot failures, reverted this one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72994/new/ https://reviews.llvm.org/D72994

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri reopened this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. Seeing some bot failures, reverted this one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72996/new/ https://reviews.llvm.org/D72996

[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGba545c814bc1: [Sema] Try 2: Attempt to perform call-size-specific `__attribute__((alloc_align… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D72994: [Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0a002f679be4: [Sema] Try 2: Sanity-check alignment requested via `__attribute__… (authored by lebedev.ri). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7299

[PATCH] D73020: [Sema] Perform call checking when building CXXNewExpr

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 240196. lebedev.ri added a comment. Rebased, NFC. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73020/new/ https://reviews.llvm.org/D73020 Files: clang/lib/AST/ExprConstant.cpp clang/lib/Sema/SemaExprCX

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72998#1838760 , @davezarzycki wrote: > I understand not wanting to have trivial dependencies on IR for values like > this, but what about creating `llvm/Support/InternalLimits.h` to hold values > like this, and then *eith

[PATCH] D72998: [IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72998#1838811 , @gchatelet wrote: > Actually there's an issue with the code. It doesn't compile in shared_library > mode. > >ld.lld: error: undefined symbol: clang::Sema::MaximumAlignment > >>> referenced by SemaCheck

[PATCH] D73363: Verify that clang's max alignment is <= LLVM's max alignment

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. SGTM, thank you. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73363/new/ https://reviews.llvm.org/D73363 ___

[PATCH] D73380: [clang] Annotating C++'s `operator new` with more attributes

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: rsandifo, erichkeane, rjmccall, jdoerfert, eugenis. lebedev.ri added a project: LLVM. Herald added subscribers: atanasyan, jrtc27. Herald added a project: clang. lebedev.ri added a parent revision: D73020: [Sema] Perform call checking wh

[PATCH] D73380: [clang] Annotating C++'s `operator new` with more attributes

2020-01-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 2 inline comments as done. lebedev.ri added a comment. In D73380#1839603 , @xbolva00 wrote: > LLVM already infers noalias nonnull for eg. _Znwm so noalias and nonnull info > added by clang will not increase power of LLVM. Or? To be hon

[PATCH] D73380: [clang] Annotating C++'s `operator new` with more attributes

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 2 inline comments as done. lebedev.ri added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:14361 +/// attributes are applied to declarations. +void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction( +FunctionDecl *FD) { ---

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Herald added a subscriber: Charusso. In D72362#1819243 , @bader wrote: > In D72362#1817682 , @lebedev.ri > wrote: > > > In D72362#1817599 , @bade

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. So, i'm seeing an issue here: https://godbolt.org/z/KM2qLa I can't `NOLINT` it, because it is defined not in the source file, but in compile line. And i can't whitelist it since there is no whitelist.. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72378#1840455 , @aaron.ballman wrote: > In D72378#1840353 , @lebedev.ri > wrote: > > > So, i'm seeing an issue here: > > https://godbolt.org/z/KM2qLa > > > > I can't `NOLINT` it, b

[PATCH] D73380: [clang] Annotating C++'s `operator new` with more attributes

2020-01-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 3 inline comments as done. lebedev.ri added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:14361 +/// attributes are applied to declarations. +void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction( +FunctionDecl *FD) { ---

[PATCH] D73380: [clang] Annotating C++'s `operator new` with more attributes

2020-01-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 240530. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. For the sake of forward progress, remove overly optimistic alignment annotation, and replace it with FIXME. I have some ideas how to deal with that, but i'd prefer to deal wit

[PATCH] D73548: [clang-tidy] Added option for disabling const qualifiers in readability-qualified-auto

2020-01-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. SGTM, but please wait for the reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73548/new/ https://reviews.llvm.org/D73548 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/readability/FunctionSizeCheck.cpp:30-31 + bool VisitDecompositionDecl(DecompositionDecl *) { +// DecompositionDecl was already visited as VarDecl. Don't count it twice. +Info.Variables--; +return true;

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 139154. lebedev.ri marked 5 inline comments as done. lebedev.ri added a comment. Address @aaron.ballman's review notes. I'm not sure the change re `ParmVarDecl` handling is actually correct, see testcase. Repository: rCTE Clang Tools Extra https://re

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > I think the current behavior here is correct and the previou

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > lebedev.ri wrote: > > aaron.ballman wrote: > > > I think the

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > lebedev.ri wrote: > > aaron.ballman wrote: > > > lebedev.ri

[PATCH] D44708: [test] Adding config initialization to lit tests in clang-tools-extra

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Nice catch! I wonder how many more `test/lit.site.cfg.in` are silently partially non-functional because they don't have that substitution... I also have an idea why it might not have worked for you - are you building clang-tools-extra repo separately manually, not as

[PATCH] D44708: [test] Adding config initialization to lit tests in clang-tools-extra

2018-03-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. As per https://github.com/llvm-project/llvm-project-20170507/search?utf8=%E2%9C%93&q=LIT_SITE_CFG_IN_FOOTER&type= this substitution already exists in most of the repos. I don't see why

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > lebedev.ri wrote: > > aaron.ballman wrote: > > > lebedev.ri

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-22 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > JonasToth wrote: > > lebedev.ri wrote: > > > aaron.ballman w

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri planned changes to this revision. lebedev.ri added a comment. Ok then :) Let's only count the variables in the function itself, not in macros/nested functions/nested lambdas/nested classes/... Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44602 __

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 139711. lebedev.ri marked 15 inline comments as done. lebedev.ri added a comment. - Rebased ontop of master - Fixed links in documentation - Improved test coverage - No longer count variables declared in nested `class`es. - No longer count variables declare

[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.

2018-03-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/clang-tidy/readability-function-size.cpp:207-212 +void variables_8() { + int a, b; + struct A { +A(int c, int d); + }; +} aaron.ballman wrote: > lebedev.ri wrote: > > aaron.ballman wrote: > > > JonasToth w

[PATCH] D43341: [clang-doc] Implement reducer portion of the frontend framework

2018-03-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. It's good to finally have the initial block firmly landed, congratulations. Trying to review this... Some initial thoughts. Comment at: clang-doc/BitcodeReader.cpp:27 + assert(Record[0] == 20); + for (int I = 0, E = Record[0]; I < E; ++I) +Fie

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: aaron.ballman, rsmith, rtrieu, nikola, chandlerc, rjmccall. This has just bit me, so i though it would be nice to avoid that next time :) Motivational case: https://godbolt.org/g/cq9UNk Basically, it's likely to happen if you don't

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D44883#1048010, @rjmccall wrote: > I'm not sure you really need to put these in their own warning sub-group just > because they're user-defined operators. That's especially true because it > appears we already have divisions in the warnin

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 139788. lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. - Also warn on `BO_DivAssign`, `BO_SubAssign`, `BO_XorAssign`. - Add releasenotes entry. Repository: rC Clang https://reviews.llvm.org/D44883 Files: docs/ReleaseNotes.r

[PATCH] D44559: [Sema] Wrong width of result of mul operation

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. I'm having a very hard time following this thread. In fact, i can't follow the logic at all. In https://reviews.llvm.org/D44559#1041007, @rjmccall wrote: > ... > This patch, however, is contrary to the design of -Wconversion, which does > attempt to avoid warning i

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a subscriber: thakis. lebedev.ri added a comment. In https://reviews.llvm.org/D44883#1048421, @Quuxplusone wrote: > Two more high-level comments from me, and then I'll try to butt out. > > Q1. I don't understand what `field-` is doing in the name of some > diagnostics. Is there

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ok, once we understand why "field" diag is separate, and why since initial implementation it only warned for "builtin" operators, i'll work on the code further. In https://reviews.llvm.org/D44883#1048485, @rjmccall wrote: > That's an interesting question! You're ab

[PATCH] D44883: [Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D44883#1048689, @rjmccall wrote: > I tracked Chandler down, and he doesn't remember why user-defined operators > are excluded. Ok then. Unless reviewers think it would be best to have separate diag groups for "builtin" and "user-provided

[PATCH] D44912: [clang-doc] Removing -Wunused-variable warning

2018-03-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. LGTM. https://reviews.llvm.org/D44912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44559: [Sema] Wrong width of result of mul operation

2018-03-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D44559#1049049, @avt77 wrote: > ... > But I don't mind to close the review - and the corresponding bug of course. I disagree with closing the bug. It's a real issue that is not detected/diagnosed by anything in clang (diagnostic, sanitiz

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 139948. lebedev.ri retitled this revision from "[Sema] Extend -Wself-assign with -Wself-assign-overloaded to warn on overloaded self-assignment (classes)" to "[Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (class

[PATCH] D43341: [clang-doc] Implement reducer portion of the frontend framework

2018-03-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. It's surprisingly difficult to review this :/ Just by itself the logic is simple, but the amount of blocks/records/record types is kinda demoralizing. I really hope it will be possible to somehow tablegen this later. Comment at: clang-doc/BitcodeRea

[PATCH] D43341: [clang-doc] Implement reducer portion of the frontend framework

2018-03-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-doc/BitcodeWriter.h:129 // Check that the static size is large-enough. assert(Record.capacity() > BitCodeConstants::RecordSize); } juliehockett wrote: > lebedev.ri wrote: > > Isn't that the opposite

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaExpr.cpp:12093 +break; + } + rjmccall wrote: > I think doing this here can result in double-warning if the overload resolves > to a builtin operator. Now, it might not actually be possible for that

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaExpr.cpp:12093 +break; + } + rjmccall wrote: > lebedev.ri wrote: > > rjmccall wrote: > > > I think doing this here can result in double-warning if the overload > > > resolves to a builtin operator.

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Will do stage2 testing next.. Comment at: lib/Sema/SemaExpr.cpp:12087 + case BO_AndAssign: + case BO_OrAssign: +DiagnoseSelfAssignment(S, LHS, RHS, OpLoc, /*IsBuiltin=*/false); lebedev.ri wrote: > rjmccall wrote: > > Quuxpluson

[PATCH] D43341: [clang-doc] Implement reducer portion of the frontend framework

2018-03-29 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-doc/BitcodeWriter.h:129 // Check that the static size is large-enough. assert(Record.capacity() > BitCodeConstants::RecordSize); } lebedev.ri wrote: > juliehockett wrote: > > lebedev.ri wrote: > > >

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-29 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ok, tried llvm stage2 build, and it failed as expected, in code that intentionally does self-assignment: https://github.com/llvm-mirror/llvm/blob/1aa8147054e7ba8f2b7ea25daaed804662b4c6b2/unittests/ADT/DenseMapTest.cpp#L249-L250 [2/311 1.1/sec] Building CXX object u

[PATCH] D45050: [clang-tidy] New checker for not null-terminated result caused by strlen or wcslen

2018-03-29 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp:1 +#include "NotNullTerminatedResultCheck.h" +#include "clang/AST/ASTContext.h" Missing header blurb Comment at: clang-tidy/bugprone/NotNullTermi

[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

2018-03-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 140411. lebedev.ri added a comment. - Rebased - Created https://reviews.llvm.org/D45082 with llvm diff to prevent stage2 failure, and to disscuss the options. Similar diff will be needed at least for libc++ tests. Repository: rC Clang https://reviews

<    15   16   17   18   19   20   21   22   23   >