[PATCH] D106713: Thread safety analysis: Warn when demoting locks on back edges

2021-07-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This seems reasonable to me, but I leave it to @delesley for the final sign-off. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106713/new/ https://reviews.llvm.org/D106713

[PATCH] D106732: Support macro deprecation #pragma clang deprecated

2021-07-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3875 + #define MIN(x, y) x < y ? x : y + #pragma clang deprecated("MIN", "use std::min instead") + beanz wrote: > aaron.ballman wrote: > > Rather than use a string literal, did

[PATCH] D106715: Thread safety analysis: Drop special block handling

2021-07-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think this looks reasonable, but @delesley should weigh in. Comment at: clang/lib/Analysis/ThreadSafety.cpp:2415 bool LocksetInitialized = false; SmallVector SpecialBlocks; for (CFGBlock::const_pred_iterator PI = CurrBlock->pred_b

[PATCH] D106577: [clang] Define __STDC_ISO_10646__

2021-07-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D106577#2904724 , @jyknight wrote: > Perhaps a reasonable path forward here to address the BSD issue can be to add > a targetinfo method: > > /* Returns true if the expected encoding of wchar_t changes at runtime >

[PATCH] D105951: [clang] P2266 implicit moves STL workaround

2021-07-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM, thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105951/new/ https://reviews.llvm.org/D105951 ___ cfe-commits mailing li

[PATCH] D106863: Allow #pragma float_control(push|pop) within a language linkage specification

2021-07-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: mibintc, rjmccall, erichkeane, kbsmith1. aaron.ballman requested review of this revision. Herald added a project: clang. Currently, we prohibit this pragma from appearing within a language linkage specification, but this is usefu

[PATCH] D106863: Allow #pragma float_control(push|pop) within a language linkage specification

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman marked an inline comment as done. aaron.ballman added a comment. In D106863#2907362 , @mibintc wrote: > Thanks for fixing this Aaron, just curious was there a bug report? There's no public bug to close fr

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Generally LGTM, but the CI is failing. Comment at: clang/test/PCH/ms-pch-macro-include_instead-regression.c:3 +// RUN: %clang_cc1 -DMSEXT -fms-extensions -DFOO %S/variables.h -DBAZ=\"Inputs/pch-through1.h\" -emit-pch -o %t1.pch +// RUN: %clang_cc

[PATCH] D106946: [clang-tidy] Fix crash on "reference to array" parameters in 'bugprone-easily-swappable-parameters'

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp:46 + +void crefToArrayTypedefBoth1(const Point2D &VecDescartes, const Point3D &VecThreeD) {} +// NO-WARN: Distinct types. -

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This currently has no codegen, so it only adds the attribute to the AST and does nothing with it. Can you also add the codegen components to this patch? Comment at: clang/include/clang/Basic/Attr.td:1835 + let Args = [StringArgument<"BTFTag">];

[PATCH] D106946: [clang-tidy] Fix crash on "reference to array" parameters in 'bugprone-easily-swappable-parameters'

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-implicits.cpp:60 + + // NO-WARN: Implicit instantiations are

[PATCH] D106431: [clang-tidy] Fix cppcoreguidelines-init-variables by removing the enum FixIt, and add support for initialization check of scoped enum.

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM -- it's not the cleanest solution (we're duplicating the call to `diag()`), but it'll suffice. If we wanted to clean it up a bit, we could use an `llvm::Optional Diagnose =

[PATCH] D106924: [Preprocessor] -E -P: Ensure newline after 8 skipped lines.

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106924/new/ https://reviews.llvm.org/D106924

[PATCH] D106732: Support macro deprecation #pragma clang deprecated

2021-07-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Lexer/deprecate-macro.c:34-39 +#ifdef foo +#endif + +// expected-warning@+1{{macro 'foo' has been marked as deprecated}} +#ifndef foo +#endif Some more test cases to add: ``` // Test that we diagnose on

[PATCH] D106431: [clang-tidy] Fix cppcoreguidelines-init-variables by removing the enum FixIt, and add support for initialization check of scoped enum.

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D106431#2912589 , @Sockke wrote: > Thank you for your reply! I generally understand what you mean, but there are > three cases, namely, no diagnosis, providing diagnosis, and providing > diagnosis & FixIt. Only by judg

[PATCH] D103385: [clang-tidy] bugprone-forwarding-reference-overload: support non-type template parameters

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. I've committed on your behalf in 68546c9d6fc54a7ca7ad487cd4b6a5dafea9b4f3 , thank you for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D106732: Support macro deprecation #pragma clang deprecated

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D106732#2911552 , @beanz wrote: > Covered taken #elif* directives per @aaron.ballmon's feedback. Thanks! > Handling non-taken #elif directives is non-trivial because clang skips > parsing the conditionals for non-taken

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM with the testing and formatting fix. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:307 +def err_pragma_include_instead_system_reserved : Erro

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D106614#2912292 , @yonghong-song wrote: >> This currently has no codegen, so it only adds the attribute to the AST and >> does nothing with it. Can you also add the codegen components to this patch? > > In one of my ear

[PATCH] D106614: [Clang] add btf_tag attribute

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1835 + let Args = [StringArgument<"BTFTag">]; + let Subjects = SubjectList<[Var, Function, Record, Field], ErrorDiag>; + let Documentation = [BTFTagDocs]; yonghong-song wrote: >

[PATCH] D102343: [clang][patch][FPEnv} Initialization of C++ globals not strictfp aware

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Giving my official LGTM now that there's been a week for folks to comment with additional concerns. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D106898#2913951 , @cjdb wrote: > fixes up formatting and testing > > Will merge post-CI. @aaron.ballman do you approve this to be cherry-picked > into LLVM 13? (cc @tstellar) Thanks for checking! I do approve it -- it w

[PATCH] D106732: Support macro deprecation #pragma clang deprecated

2021-07-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, thank you! I am excited to start using this shortly. :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106732/new/ https://r

[PATCH] D121078: Replace links to archived mailing lists by links to Discourse forums

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. In D121078#3368424 , @tonic wrote: > In D121078#3367950 , @aaron.ballman > wrote: > >> I've added comments to the few places I'd like to see a

[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this! I have a few thoughts on the renaming, but otherwise strongly support the direction here. > clang/lib/Tooling/Syntax/Pseudo/* => clang-tools-extra/pseudo/lib/* The usual naming conventions in clang-tools-extra is to use the

[PATCH] D120244: [clang][sema] Enable first-class bool support for C2x

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/test/Headers/stdbool.c:2 +// RUN: %clang_cc1 -fgnuc-version=4.2.1 -std=c11 -E -dM %s 2>&1 | FileCheck --check-prefix=CHECK-C11 %s +// R

[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121233#3369736 , @sammccall wrote: > In D121233#3369657 , @aaron.ballman > wrote: > >> Thank you for working on this! I have a few thoughts on the renaming, but >> otherwise st

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thanks for this! One thing I noticed is that we seem to be lacking a lot of Sema tests for the changes now that this is a type attribute. Of particular interest to me would be cases using `_Generic` and `__attribute__((overloadable))` to demonstrate what kind of t

[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121233#3370110 , @sammccall wrote: > I understand where you're coming from. But I think agreeing to move the code > was premature if it means either: > > - following all the precedents in clang-tools-extra, or > - takin

[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

2022-03-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. In D121233#3370821 , @sammccall wrote: > In D121233#3370177 , @aaron.ballman > wrote: > >> I agreed based on the understanding that the new cod

[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121233#3371422 , @sammccall wrote: > Thanks Aaron, and my apologies for being easily frustrated. No worries at all! I always appreciate our discussions, even when we don't initially agree. > In D121233#3370992

[PATCH] D121380: Pragma `clang fp eval_method` needs to take as input a supported value.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM with a tiny tweak to the diagnostic. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1493 + "'ignore', 'maytrap' or 'strict'|" + "'source'

[PATCH] D121078: Replace links to archived mailing lists by links to Discourse forums

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121078#3373081 , @SimplyDanny wrote: > I'm happy that you found a reasonable compromise. I like it too. ;) > > Now, I ask you to help me a little bit with the workflow and the test > failures. The review comments are a

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2733 +/// \endcode +AST_MATCHER_P(AttributedStmt, isAttr, attr::Kind, AttrKind) { + return llvm::any_of(Node.getAttrs(), sammccall wrote: > This definitely seems more

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2713-2714 +/// \endcode +extern const internal::VariadicDynCastAllOfMatcher +attributedStmt; + sammccall wrote: > aaron.ballman wrote: > > sammccall wrote: > > > jd

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:258 + // Fast-math is enabled. + if (getLangOpts().AllowFPReassoc || getLangOpts().AllowRecip) +PP.setCurrentFPEvalMethod(SourceLocation(), Shouldn't this be looking at `getLangOpts().

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:258 + // Fast-math is enabled. + if (getLangOpts().AllowFPReassoc || getLangOpts().AllowRecip) +PP.setCurrentFPEvalMethod(SourceLocation(), zahiraam wrote: > aaron.ballman wrote: > > S

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:83 +#pragma float_control(pop) + +int getFPEvalMethod() { What should happen in a case like this? ``` int whatever(float a, float b, float c) { #pragma float_control(pre

[PATCH] D121283: [Clang] Support multiple attributes in a single pragma

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thanks for this, I plan on giving it a more thorough review when I can. But the summary led me to a design question: why do we support multiple attribute *specifiers* in the same pragma? I would not expect to be able to mix attribute styles in the same pragma give

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:83 +#pragma float_control(pop) + +int getFPEvalMethod() { zahiraam wrote: > aaron.ballman wrote: > > What should happen in a case like this? > > ``` > > int whatever(float

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: arsenm. aaron.ballman added a subscriber: arsenm. aaron.ballman added a comment. Herald added a subscriber: wdng. Adding @arsenm because of this bit: > Note that the 'valid' list of processors for x86 is in > llvm/include/llvm/Support/X86TargetParser.def. At the m

[PATCH] D121245: [clang][parser] Allow GNU attributes before namespace identifier

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Oh wow, GCC has supported this for a long time; I wasn't aware of that. Thanks for this patch! Comment at: clang/lib/Parse/ParseDeclCXX.cpp:79 + + auto ReadLabelAttrubutes = [&] { +// Read label attributes, if present. Howev

[PATCH] D121201: [clang] Merge the SourceRange into ParsedAttributes

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: erichkeane. aaron.ballman added a comment. > I wasn't 100% whether to add the range to ParsedAttributes or even > ParsedAttributesView. I think `ParsedAttributesView` is the correct level for this -- I want to see us tracking the source range for all the parsed a

[PATCH] D121201: [clang] Merge the SourceRange into ParsedAttributes

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Sema/ParsedAttr.h:1105 void clearListOnly() { ParsedAttributesView::clearListOnly(); Range = SourceRange(); erichkeane wrote: > This is... oh boy. I'm hopeful you can remove this t

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Herald added a project: All. In D111400#985 , @cor3ntin wrote: > @hubert.reinterpretcast Gentle ping in case you didn't see Aaron's message - > there isn't too much urgency though Another ping on this since a few weeks

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } Do we also need something like

[PATCH] D120187: [clang-tidy] Allow newline characters as separators for checks in Clang-Tidy configurations

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, but please wait a day or two before landing in case @njames93 has further concerns. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D88905#3362347 , @kaz7 wrote: > At the beginning, this implementation extends `vector_type` attribute which > is GCC's attribute. So, this may cause future conflicts with GCC when they > extend it. But, now this patch

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM, though I'm not qualified to review the CPU specific bits in the .def file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410 _

[PATCH] D121373: [clang-tidy][docs] Fix wrong url in DontModifyStdNamespaceCheck

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121373/new/ https://reviews.llvm.org/D121373

[PATCH] D121372: [clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121372/new/ https://reviews.llvm.org/D121372

[PATCH] D121214: [clang-tidy][docs][NFC] Refer to the CERT rule in bugprone-shared-ptr-array-mismatch docs

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, I think this is a good incremental improvement until the check covers more of MEM51-CPP. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121214/new/ https://reviews

[PATCH] D117522: [clang-tidy] Add modernize-macro-to-enum check

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D117522#3364387 , @LegalizeAdulthood wrote: > Ping. Another week waiting for reviews... Thanks for the ping! FWIW, it's also not uncommon for there to be week delays (reviewers go on vacation, have other obligations,

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. It looks like there are some clang-format issues to handle as well. Comment at: clang/test/CodeGen/eval-method-fast-math.c:113-116 +#pragma float_control(precise, on) +int val2 = __FLT_EVAL_METHOD__; + } + return __FLT_EVAL_METHOD__; ---

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Please fix the clang format issue as well. Other than that and a nit, this LGTM. Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1587 + // The `minus` opera

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D88905#3378933 , @simoll wrote: > In D88905#3375676 , @aaron.ballman > wrote: > >> In D88905#3362347 , @kaz7 wrote: >> >>> At the beginning

[PATCH] D121532: [Clang][WIP] Fix Unevaluated Lambdas

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: erichkeane. aaron.ballman added a comment. Adding Erich to look at this WIP for early feedback as he's recently been looking at template instantiation guts rather deeply, but I added some questions. Comment at: clang/include/clang/AST/DeclCXX.h

[PATCH] D121283: [Clang] Support multiple attributes in a single pragma

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121283#3375806 , @egorzhdan wrote: > In D121283#3373560 , @aaron.ballman > wrote: > >> why do we support multiple attribute *specifiers* in the same pragma? I >> would not expe

[PATCH] D120770: [C2x] Implement literal suffixes for _BitInt

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Thanks for the reviews! I've commit in 8cba72177dcd8de5d37177dbaf2347e5c1f0f1e8 (LLVM bits) and 8cba72177dcd8de5d37177dbaf2347e5c1f0f1e8

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Sema bits look pretty reasonable to me (I don't feel qualified to review the codegen bits). Comment at: clang/lib/Sema/SemaExpr.cpp:10244-10245 + // This operation may not be performed on boolean vectors. + if (!AllowBoolOperation && (isBoolOrE

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:10244-10245 + // This operation may not be performed on boolean vectors. + if (!AllowBoolOperation && (isBoolOrExtVectorBoolType(LHSType) && + isBoolOrExtVectorBoolType(RHS

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } yonghong-song wrote: > aaron.b

[PATCH] D121245: [clang][parser] Allow GNU attributes before namespace identifier

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Might be worth adding a release note for it (does this close any bugs in the bug database? If so, it'd be worth mentioning those in the commit message and release note).

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D120952#3381224 , @ajohnson-uoregon wrote: > I still need to write tests but: I do have a use case for these over here: > https://github.com/ajohnson-uoregon/llvm-project/blob/feature-ajohnson/clang-tools-extra/clang-re

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thanks! Sema bits now LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88905/new/ https://reviews.llvm.org/D88905 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:5128-5130 + if (!CheckLocalVariableDeclaration(Info, VD)) { +return ESR_Failed; + } Comment at: clang/lib/AST/ExprConstant.cpp:5174-5

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:2132-2136 +for (Stmt *SubStmt : S->children()) + if (SubStmt && + !CheckConstexprFunctionStmt(SemaRef, Dcl, SubStmt, ReturnStmts, + Cxx1yLoc, Cxx

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/SemaCXX/constant-expression-cxx2b.cpp:60-61 + +constexpr int ke = k_evaluated(1); //expected-error {{constexpr variable 'ke' must be initialized by a constant expression}} \ + //expecte

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:2132-2136 +for (Stmt *SubStmt : S->children()) + if (SubStmt && + !CheckConstexprFunctionStmt(SemaRef, Dcl, SubStmt, ReturnStmts, + Cxx1yLoc, Cxx

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think we're pretty close; it looks like there's still one unresolved conversation about template instantiation needs and whether we can remove that code or not. Comment at: clang/include/clang/AST/TypeLoc.h:923 + void initializeLocal(ASTConte

[PATCH] D120949: [clang][AST matchers] adding attributedStmt AST matcher

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2733 +/// \endcode +AST_MATCHER_P(AttributedStmt, isAttr, attr::Kind, AttrKind) { + return llvm::any_of(Node.getAttrs(), ajohnson-uoregon wrote: > aaron.ballman wrote:

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D88905#3382881 , @simoll wrote: > In D88905#3382309 , @aaron.ballman > wrote: > >> Thanks! Sema bits now LGTM > > Awesome! Who would be a good fit for the codegen parts of this pat

[PATCH] D121245: [clang][parser] Allow GNU attributes before namespace identifier

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. In D121245#3382887 , @ArcsinX wrote: > In D121245#3380346 , @aaron.ballman > wrote: > >> LGTM! Might be worth adding a release note for it (doe

[PATCH] D121283: [Clang] Support multiple attributes in a single pragma

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Aside from a minor testing nit, this LGTM. Thank you for the new functionality! Comment at: clang/test/Parser/pragma-multiple-attributes.cpp:1-11 +// RUN: %clan

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/TreeTransform.h:6872 + const BTFTagAttributedType *oldType = TL.getTypePtr(); + StringRef Tag = oldType->getTag(); + QualType modifiedType = getDerived().TransformType(TLB, TL.getModifiedLoc()); y

[PATCH] D121497: Lex: add support for `{,u}i128` Microsoft extension

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. > The Windows SDK has occurrences of the i128 and ui128 suffix (at least in the > 10.0.22000.0 SDK, see intsafe.h). This adds support for the extension to > properly lex the literal. Something fishy is still going on here. I definitely see the use in intsafe.h, b

[PATCH] D120187: [clang-tidy] Allow newline characters as separators for checks in Clang-Tidy configurations

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. In D120187#3382973 , @SimplyDanny wrote: > In D120187#3375610 , @aaron.ballman > wrote: > >> LGTM, but please wait a day or two before landing i

[PATCH] D111400: [Clang] Implement P2242R3

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D111400#3383006 , @hubert.reinterpretcast wrote: > @aaron.ballman @cor3ntin, are we confident that testing the non-lambda cases > is sufficient to cover the lambda cases as well? I think lambdas are just odd enough tha

[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM aside from a tiny testing nit. It's interesting that WG14 doesn't seem to have a similar DR reported them that I can find (nothing for you to do about it). Comment at: clang/test/CXX/drs/dr2354.cpp:1 +/

[PATCH] D119609: [Clang][Sema] Prohibit expression statement in lambda default argument

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D119609#3384568 , @junaire wrote: > Hi @aaron.ballman @erichkeane, I have already left a comment in GCC's > Bugzilla, but unfortunately there's been no response for almost a week. I'm > even not sure there's really a bu

[PATCH] D121201: [clang] Merge the SourceRange into ParsedAttributes

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Just NFC nits from me with coding style stuff, so this LGTM! Feel free to fix the style nits when you land or land this as-is and do an NFC commit to fix them. ===

[PATCH] D63085: Provide a fix-it hint for -Wswitch, which adds missing cases. If there are >3 cases, the inserted text will contain newlines so it will not be shown in console output (but will be appl

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D63085#3384302 , @iamsergio wrote: > I don't think we need to worry about formatting, that's the IDE's job (and > whatever formatter it uses). > In general, the code that knows how to warn should also be the one that know

[PATCH] D120952: [clang][AST matchers] adding submatchers under cudaKernelCallExpr to match kernel launch config

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D120952#3384239 , @ajohnson-uoregon wrote: > For the specific argument matchers (`cudaBlockDim()`, `cudaStream()`, etc), I > agree, I'm not sure if there's any other use cases in tree. I wasn't aware > you could write

[PATCH] D120956: [clang][AST matchers] new AST matcher argumentsGivenCountIs(n) that checks the actual number of arguments given in a function call

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D120956#3384416 , @ajohnson-uoregon wrote: > When we're doing matcher generation, we aren't able to look up the > FunctionDecl and see if there are defaults (because the function name itself > might be a parameter for

[PATCH] D120959: [clang][AST matchers] new hasExpectedReturnType submatcher for ReturnStmts

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D120959#3384525 , @ajohnson-uoregon wrote: > This is our use case: > https://github.com/ajohnson-uoregon/llvm-project/blob/feature-ajohnson/clang-tools-extra/clang-rewrite/MatcherGenCallback.h#L365 > > I'm not sure if

[PATCH] D120296: [Attr] Fix a btf_type_tag AST generation bug

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120296/new/ https://reviews.llvm.org/D120296

[PATCH] D121497: Lex: add support for `{,u}i128` Microsoft extension

2022-03-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: urnathan, iains, ChuanqiXu. aaron.ballman added a comment. In D121497#3383910 , @compnerd wrote: > This was something that I was hitting an issue with. Does cl hit the same issue when building a module that includes intsafe

[PATCH] D121497: Lex: add support for `{,u}i128` Microsoft extension

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121497#3388024 , @compnerd wrote: > I don't have an example module sadly. It was something that I ran into with > Swift code import the WinSDK module defined in > https://github.com/apple/swift/blob/main/stdlib/public

[PATCH] D119470: [clang-tidy] Don't check decltype return types in `readability-const-return-type`

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp:56-58 +AST_MATCHER(QualType, isLocalConstQualified) { + return Node.isLoca

[PATCH] D120331: [clang-tidy][run-clang-tidy.py] Add --config-file= option

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. In D120331#3384889 , @SAtacker wrote: > Gentle reminder to commit on my behalf > @JonasToth > @alexfh > @aaron.ballman > @njames93 > @LegalizeAdulthood > > Thank yo

[PATCH] D121556: [randstruct] Add randomize structure layout support

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this new security feature! I like it and I think it's heading in the right direction. Can you please add a release note for the new functionality? This is missing tests for the Driver diagnostics, the Sema diagnostics (including existing

[PATCH] D120857: WIP [randstruct] Add randomize structure layout support

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This seems like a duplicate of https://reviews.llvm.org/D121556 -- should this review be abandoned? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120857/new/ https://reviews.llvm.org/D120857

[PATCH] D117522: [clang-tidy] Add modernize-macro-to-enum check

2022-03-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp:47 +CRLF, +CRLFCR, + }; LegalizeAdulthood wrote: > aaron.ballman wrote: > > I'm a bit confused by this one as this is not a valid line ending (it

[PATCH] D121955: [clang] NFC: Dead code removal in SemaDecl.cpp, CheckMultiVersionFunction().

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121955/new/ https://reviews.llvm.org/D121955

[PATCH] D121957: [clang] NFC: Redundant code removal in SemaDecl.cpp, CheckTargetCausesMultiVersioning().

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121957/new/ https://reviews.llvm.org/D121957

[PATCH] D121958: [clang] NFC: Remove forced type merging in multiversion function checks.

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. You should fix the clang-format issues (I leave @erichkeane to sign off on this one, but it looks reasonable to me). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121958/new/ https://reviews.llvm.org/D121958 ___

[PATCH] D121960: [clang] NFC: Rename 'MVType' variables to 'MVKind' for consistency with their type.

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121960/new/ https://reviews.llvm.org/D121960

[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Is there a need for this functionality? The text node dumper already dumps attributes associated with the function: https://godbolt.org/z/EbW8E74TT If the change is necessary, it needs some test coverage (I'd recommend adding the test to the `clang/test/AST` direc

[PATCH] D117522: [clang-tidy] Add modernize-macro-to-enum check

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D117522#3390136 , @LegalizeAdulthood wrote: > I think I've got all the changes incorporated, but I'm getting a test failure > so I haven't uploaded a new diff. > > Honestly, I don't understand the test failure output.

[PATCH] D121556: [randstruct] Add randomize structure layout support

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/AST/Randstruct.h:34 + +extern std::string SEED; + void wrote: > aaron.ballman wrote: > > Doing this with a global variable is unfortunate; it could make things > > harder when we multithread th

<    25   26   27   28   29   30   31   32   33   34   >