[PATCH] D67140: [analyzer][NFC] Fix inconsistent references to checkers as "checks"

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Yay thanks!! In my understanding "check" is a feature of the tool, while "checker" is an entity within the tool that implements that feature. In most cases there's no difference, though, so yeah,

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:133 std::unique_ptr> InEH; + const bool WarnForDeadNestedAssignments; Szelethus wrote: > Szelethus wrote: > > NoQ wrote: > > > I suggest we adopt the idiom

[PATCH] D65527: Avoid assemble step in verbose-output-quoting.c

2019-09-03 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen updated this revision to Diff 218588. ychen added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65527/new/ https://reviews.llvm.org/D65527 Files: clang/test/Driver/verbose-output-quoting.c Index:

[PATCH] D65527: Avoid assemble step in verbose-output-quoting.c

2019-09-03 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. > Would that work for this test also? Yes, that sounds good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65527/new/ https://reviews.llvm.org/D65527 ___ cfe-commits mailing

[PATCH] D67141: [DebugInfo] Emit DW_TAG_enumeration_type for referenced global enumerator.

2019-09-03 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen created this revision. ychen added reviewers: akhuang, rnk, probinson. Herald added a project: clang. Herald added a subscriber: cfe-commits. This essentially reverts changes from r361400. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D67141 Files:

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:133 std::unique_ptr> InEH; + const bool WarnForDeadNestedAssignments; Szelethus wrote: > NoQ wrote: > > I suggest we adopt the idiom of passing the

[PATCH] D67091: Fix for headers having the same name as a directory

2019-09-03 Thread Kousik Kumar via Phabricator via cfe-commits
kousikk added a comment. Sure I'll add a test case! Comment at: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp:196 + return llvm::ErrorOr>(std::make_error_code(std::errc::is_a_directory)); +} + } arphaman wrote: > This change

[PATCH] D67140: [analyzer][NFC] Fix inconsistent references to checkers as "checks"

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added reviewers: gribozavr, alexfh. Szelethus added subscribers: gribozavr, alexfh. Szelethus added a comment. @gribozavr, @alexfh this isn't a particularly exciting patch, but it does highlight a fundamental difference in between the analyzer and clang-tidy, so I added you for the

[PATCH] D67140: [analyzer][NFC] Fix inconsistent references to checkers as "checks"

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, Charusso, baloghadamsoftware, rnkovacs, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Traditionally,

[PATCH] D65182: [analyzer] Add fix-it hint support.

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 218575. NoQ added a comment. Make fix-it hints attachable to any `PathDiagnosticPiece`, rather than to `PathDiagnostic` as a whole. This basically allows attaching a fixit to any note in the report. For now the plist consumer only supports attaching fixits to

[PATCH] D67052: Add reference type transformation builtins

2019-09-03 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver marked an inline comment as done. zoecarver added inline comments. Comment at: libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_remove_reference.sh.cpp:13 +// variants listed in the RUN script. +// +// Impl Compile Time Object

[PATCH] D67052: Add reference type transformation builtins

2019-09-03 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver marked an inline comment as done. zoecarver added inline comments. Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1095 + default: +assert(false && "Not a reference type specifier"); + } Mordante wrote: > Wouldn't it be better to use

[PATCH] D67052: Add reference type transformation builtins

2019-09-03 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver added a comment. In D67052#1656319 , @mclow.lists wrote: > If you're going to do `__add__lvalue_reference`, `__add_rvalue_reference`, > and `__remove_reference`, why not go all the way and add `__is_reference`, > `__is_lvalue_reference` and

[PATCH] D66361: Improve behavior in the case of stack exhaustion.

2019-09-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D66361#1656037 , @rsmith wrote: > In D66361#1655903 , @krytarowski > wrote: > > > This change broke on NetBSD. > > > >

[PATCH] D67135: Support proto repeated field in performence-inefficient-vector-operation

2019-09-03 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention new option in Release Notes. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst:9 +When EnableProto, also finds calls that add element to protobuf repeated field +in a loop without

[PATCH] D67127: [clang-scan-deps] add skip excluded conditional preprocessor block preprocessing optimization

2019-09-03 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added inline comments. Herald added a subscriber: wuzish. Comment at: clang/include/clang/Frontend/CompilerInstance.h:256 + /// preprocessor. + void setAdditionalPPCallbacks(std::unique_ptr PPC); + This kinda sounds like it can be called multiple

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: clang/docs/UndefinedBehaviorSanitizer.rst:177 ``-fsanitize=undefined``. + - ``-fsanitize=pointer-offsetting``: Enables ``nullptr-and-nonzero-offset`` + and ``pointer-overflow``. lebedev.ri wrote: > vsk wrote: >

[PATCH] D66572: [analyzer] NFC: BugReporter Separation Ep.I.

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked 2 inline comments as done. NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:186 + /// ranges. + void addRange(SourceRange R) { +assert((R.isValid() || Ranges.empty()) && "Invalid range can only be used "

[PATCH] D67135: Support proto repeated field in performence-inefficient-vector-operation

2019-09-03 Thread Cong Liu via Phabricator via cfe-commits
congliu created this revision. congliu added a reviewer: gribozavr. Herald added a project: clang. Herald added a subscriber: cfe-commits. Finds calls that add element to protobuf repeated field in a loop without calling Reserve() before the loop. Calling Reserve() first can avoid unnecessary

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang/docs/UndefinedBehaviorSanitizer.rst:177 ``-fsanitize=undefined``. + - ``-fsanitize=pointer-offsetting``: Enables ``nullptr-and-nonzero-offset`` + and ``pointer-overflow``. vsk wrote: > Why does this

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 218556. lebedev.ri marked 7 inline comments as done. lebedev.ri added a comment. @vsk thank you for taking a look! Review notes addressed, except grouping one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D67113: ICK_Function_Conversion and ICK_Qualification are third kind conversions

2019-09-03 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert updated this revision to Diff 218550. aaronpuchert added a comment. Remove wrong changes in SemaExprCXX.cpp. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67113/new/ https://reviews.llvm.org/D67113 Files:

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: clang/docs/UndefinedBehaviorSanitizer.rst:177 ``-fsanitize=undefined``. + - ``-fsanitize=pointer-offsetting``: Enables ``nullptr-and-nonzero-offset`` + and ``pointer-overflow``. Why does this need to be a

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: llvm/docs/ReleaseNotes.rst:59 + ``getelementptr inbounds`` can not change the null status of a pointer, + meaning it can not produce non-null pointer given null base pointer, and + likewise given non-null base pointer it can not

[PATCH] D66822: Hardware cache line size builtins

2019-09-03 Thread JF Bastien via Phabricator via cfe-commits
jfb requested changes to this revision. jfb added a comment. This revision now requires changes to proceed. Sorry for the delayed response, I was on vacation. Thanks for tackling it! I don't think this is the approach I would take. From my dev meeting lightning talk I would instead: 1. Add to

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: llvm/docs/ReleaseNotes.rst:59 + ``getelementptr inbounds`` can not change the null status of a pointer, + meaning it can not produce non-null pointer given null base pointer, and + likewise given non-null base pointer it can not

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 218542. lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. `clang/docs/ReleaseNotes.rst`: also mention C17 verse in addition to C++ verse. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: llvm/docs/ReleaseNotes.rst:59 + ``getelementptr inbounds`` can not change the null status of a pointer, + meaning it can not produce non-null pointer given null base pointer, and + likewise given non-null base pointer it can not

[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

2019-09-03 Thread JF Bastien via Phabricator via cfe-commits
jfb added a comment. In D67023#1654704 , @aaron.ballman wrote: > In D67023#1654070 , @jfb wrote: > > > I refer you to http://wg21.link/p0883 > > I don’t think this diagnostic should be added to clang until p0883

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 2 inline comments as done. lebedev.ri added inline comments. Comment at: llvm/docs/ReleaseNotes.rst:59 + ``getelementptr inbounds`` can not change the null status of a pointer, + meaning it can not produce non-null pointer given null base pointer, and +

r370825 - [libclang][test][NFC] Split off fixture from tests.

2019-09-03 Thread Jan Korous via cfe-commits
Author: jkorous Date: Tue Sep 3 15:01:46 2019 New Revision: 370825 URL: http://llvm.org/viewvc/llvm-project?rev=370825=rev Log: [libclang][test][NFC] Split off fixture from tests. Added: cfe/trunk/unittests/libclang/TestUtils.h Modified: cfe/trunk/unittests/libclang/LibclangTest.cpp

[PATCH] D66121: Debug Info: Nest Objective-C property function decls inside their container.

2019-09-03 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Can you prepare an NFC patch with just the changes relating to adding `ObjCPropertyImplDecl::get{Getter,Setter}MethodDecl`? I don't get why the redeclaration logic is changing. What happens when a normal method is implemented? Is that not linked up as a

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: llvm/docs/ReleaseNotes.rst:59 + ``getelementptr inbounds`` can not change the null status of a pointer, + meaning it can not produce non-null pointer given null base pointer, and + likewise given non-null base pointer it can not

[PATCH] D66572: [analyzer] NFC: BugReporter Separation Ep.I.

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:186 + /// ranges. + void addRange(SourceRange R) { +assert((R.isValid() || Ranges.empty()) && "Invalid range can only be used "

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 218533. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Reworded `(ptr - intptr_t(ptr)) -> nullptr` ubsan message to be less specific. Currently, `EmitCheckedInBoundsGEP()` is used sparsely, a lot of `GEP inbounds` are created

[PATCH] D65256: [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownership qualifications as unavailable if the union is declared in a system header

2019-09-03 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Herald added a subscriber: ributzka. Okay, now that I understand the source-compatibility issues a little better, I think this approach is probably okay. If it causes trouble, we can consider special-casing these headers to treat the member as `__unsafe_unretained`

[PATCH] D65182: [analyzer] Add fix-it hint support.

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: clang/test/Analysis/dead-stores.c:11 long idx=abc+3*5; // expected-warning {{never read}} expected-warning{{unused variable 'idx'}} + // expected-remark-re@-1.*}}:11 - {{.*}}:18 - ''}} }

[PATCH] D65182: [analyzer] Add fix-it hint support.

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked an inline comment as done. NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:491 + ArrayRef Ranges = None, + ArrayRef Fixits = None); gribozavr

[PATCH] D64480: [ASTImporter] Added visibility context check for TypedefNameDecl.

2019-09-03 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/unittests/AST/ASTImporterVisibilityTest.cpp:343 +::testing::Values( +std::make_tuple(ExternTypedef, ExternTypedef, ExpectLink), +std::make_tuple(ExternTypedef, AnonTypedef, ExpectNotLink),

[PATCH] D64480: [ASTImporter] Added visibility context check for TypedefNameDecl.

2019-09-03 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. In D64480#1654354 , @balazske wrote: > In D64480#1653629 , @shafik wrote: > > > It is worth noting that: > > > > typedef int T; > > typedef int T; > > > > > > is not valid C99 see

[PATCH] D67127: [clang-scan-deps] add skip excluded conditional preprocessor block preprocessing optimization

2019-09-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: Bigcheese, dexonsmith, aganea. Herald added subscribers: ributzka, tschuett, jsji, jkorous, MaskRay, kbarton, mgorny, nemanjai. Herald added a project: clang. This patch adds an optimization to clang-scan-deps and clang's preprocessor

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:133 std::unique_ptr> InEH; + const bool WarnForDeadNestedAssignments; NoQ wrote: > I suggest we adopt the idiom of passing the `Checker` object around

[PATCH] D66836: [libc++] Add `__truncating_cast` for safely casting float types to integers

2019-09-03 Thread Louis Dionne via Phabricator via cfe-commits
ldionne commandeered this revision. ldionne edited reviewers, added: EricWF; removed: ldionne. ldionne added a comment. Herald added a subscriber: jkorous. Taking over because Eric is on vacation. I think everything has been addressed at this point. @scanon do you see anything else that needs

[PATCH] D66733: [analyzer] Add a checker option to detect nested dead stores

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:133 std::unique_ptr> InEH; + const bool WarnForDeadNestedAssignments; I suggest we adopt the idiom of passing the `Checker` object around and asking it

[PATCH] D67091: Fix for headers having the same name as a directory

2019-09-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Thanks for fixing this! Could you add a test case which verifies that the assertion no longer happens? Let me know if you need help coming up with a test. Comment at: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp:196 +

[PATCH] D67079: [analyzer] CastValueChecker: Model inheritance

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/DynamicType.cpp:42 + return MR->StripCasts(); +} + NoQ wrote: > Charusso wrote: > > Probably a consistent way of `MemRegion` handling is more appropriate. > Pointer casts are quite a can

[PATCH] D67079: [analyzer] CastValueChecker: Model inheritance

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/DynamicType.cpp:42 + return MR->StripCasts(); +} + Charusso wrote: > Probably a consistent way of `MemRegion` handling is more appropriate. Pointer casts are quite a can of worms. I suggest

[PATCH] D67079: [analyzer] CastValueChecker: Model inheritance

2019-09-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h:24 + DynamicTypeInfo(QualType ty, bool CanBeSub = true) + : Ty(ty), CanBeASubClass(CanBeSub) {} `Ty(Ty)` is the idiom here.

[PATCH] D67052: Add reference type transformation builtins

2019-09-03 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. If you're going to do `__add__lvalue_reference`, `__add_rvalue_reference`, and `__remove_reference`, why not go all the way and add `__is_reference`, `__is_lvalue_reference` and `__is_rvalue_reference`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D46791: Make -gsplit-dwarf generally available

2019-09-03 Thread Jake Ehrlich via Phabricator via cfe-commits
jakehehrlich added a comment. This is obsolete I think. Clang doesn't use llvm-objcopy for this anymore if I understand correct. @pcc should be able to confirm. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D46791/new/ https://reviews.llvm.org/D46791

[PATCH] D59922: [Attributor] Deduce "no-capture" argument attribute

2019-09-03 Thread Johannes Doerfert via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jdoerfert marked an inline comment as done. Closed by commit rL370817: [Attributor] Deduce no-capture argument attribute (authored by jdoerfert, committed by ). Changed prior to commit:

[PATCH] D59922: [Attributor] Deduce "no-capture" argument attribute

2019-09-03 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert marked 6 inline comments as done. jdoerfert added inline comments. Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2618 +else + Attrs.emplace_back(Attribute::get(Ctx, "no-capture-maybe-returned")); + } uenoku wrote: > Maybe we need an

[PATCH] D66830: Consumed checker: various improvements

2019-09-03 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. Likely best to separate these changes into separate/standalone patches - easier to review/see what's changing, what the motivation is, etc. (I'm probably OK with some breakage here - to the best of my knowledge these attributes haven't achieved widespread adoption, so

[PATCH] D66572: [analyzer] NFC: BugReporter Separation Ep.I.

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Also, thank you @gribozavr for your comments -- its very nice to have someone review a bigger part of our development interface who is knowledgeable about Clang, but not the Static Analyzer specifically. Looking at your inlines, these are very fair criticisms, I

[PATCH] D46791: Make -gsplit-dwarf generally available

2019-09-03 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added inline comments. Comment at: test/Driver/split-debug.c:28 +// MACOSX-CHECK-ACTIONS: objcopy{{.*}}--extract-dwo{{.*}}"split-debug.dwo" +// MACOSX-CHECK-ACTIONS: objcopy{{.*}}--strip-dwo{{.*}}"split-debug.o" split dwarf does not make sense on macOS

[PATCH] D67024: [analyzer] NFC: Replace intrusive list of bug reports with a vector of pointers.

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. Other then the things @gribozavr mentioned, LGTM. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:458 +public: + typedef llvm::SmallVector, 4> ReportList; + using iterator =

[PATCH] D67084: [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is not checked.

2019-09-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp:240 + Arg = Arg->IgnoreImpCasts(); + if (isa(Arg)) + Arg = cast(Arg)->getSubExpr(); The bug claims that this is only for handling negative

[PATCH] D67052: Add reference type transformation builtins

2019-09-03 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added inline comments. Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1095 + default: +assert(false && "Not a reference type specifier"); + } Wouldn't it be better to use `llvm_unreachable("Not a reference type specifier");` Maybe also move this

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 218519. lebedev.ri added a comment. Add test that show that `__builtin_offsetof()` / `((uintptr_t)(&(((S *)nullptr)->y)))` are already not sanitized. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67122/new/

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: compiler-rt/test/ubsan/TestCases/Pointer/index-overflow.cpp:15 + // ERR2: runtime error: pointer index expression with base {{.*}} overflowed to + // ERR1: runtime error: subtracting integral value of non-null pointer 0x{{.*}} from

[PATCH] D66328: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial

2019-09-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea marked an inline comment as done. aganea added inline comments. Comment at: lib/CodeGen/CGDebugInfo.cpp:3581 +llvm::DILocalScope *PrevScope = +!LexicalBlockStack.empty() +? dyn_cast(LexicalBlockStack.back()) aganea wrote: > rnk

[PATCH] D66328: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial

2019-09-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added inline comments. Comment at: lib/CodeGen/CGDebugInfo.cpp:3581 +llvm::DILocalScope *PrevScope = +!LexicalBlockStack.empty() +? dyn_cast(LexicalBlockStack.back()) rnk wrote: > Is it OK to look up the lexical block stack at this

[PATCH] D66328: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial

2019-09-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea updated this revision to Diff 218515. aganea marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66328/new/ https://reviews.llvm.org/D66328 Files: include/clang/AST/GlobalDecl.h lib/CodeGen/CGDebugInfo.cpp lib/CodeGen/CGDeclCXX.cpp

[PATCH] D64671: [clang-tidy] New check: misc-init-local-variables

2019-09-03 Thread Jussi Pakkanen via Phabricator via cfe-commits
jpakkane marked 6 inline comments as done. jpakkane added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp:31-32 + + if (!MatchedDecl->isLocalVarDecl()) +return; + aaron.ballman wrote: > jpakkane wrote: > >

[PATCH] D66990: [clangd] Add distinct highlightings for declarations of functions and methods

2019-09-03 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. In D66990#1655175 , @ilya-biryukov wrote: > In D66990#1655030 , @nridge wrote: > > > I was hoping though that a patch like this, which would bring us largely to > > parity with Eclipse

Re: [PATCH] D66361: Improve behavior in the case of stack exhaustion.

2019-09-03 Thread Joerg Sonnenberger via cfe-commits
On Tue, Sep 03, 2019 at 06:02:28PM +, Richard Smith - zygoloid via Phabricator via cfe-commits wrote: > rsmith added a comment. > > In D66361#1655903 , @krytarowski > wrote: > > > This change broke on NetBSD. > > > >

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D67122#1656205 , @lebedev.ri wrote: > In D67122#1656189 , @aaron.ballman > wrote: > > > One fear I have with this is in expansions of the `offsetof` macro, where > > it is a

[PATCH] D64671: [clang-tidy] New check: misc-init-local-variables

2019-09-03 Thread Jussi Pakkanen via Phabricator via cfe-commits
jpakkane updated this revision to Diff 218511. jpakkane added a comment. Updated patch as per review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64671/new/ https://reviews.llvm.org/D64671 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-09-03 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Hi! We've noticed that for our arm bots, we're getting some flaky builds that sometimes fail with `error: array designators are a C99 extension [-Werror,-Wc99-designator]` and sometimes don't fail. 2 questions: 1. I can't see it off the patch immediately, but do

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D67122#1656189 , @aaron.ballman wrote: > One fear I have with this is in expansions of the `offsetof` macro, where it > is a common implementation strategy to cast a null pointer to be of the > correct type when

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. One fear I have with this is in expansions of the `offsetof` macro, where it is a common implementation strategy to cast a null pointer to be of the correct type when calculating member offsets. Do you think you will be able to distinguish between null pointer

[PATCH] D67048: [AMDGPU] Set default flat work group size to (1, 256) for HIP

2019-09-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370808: [AMDGPU] Set default flat work group size to (1,256) for HIP (authored by yaxunl, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: vsk, filcab, rsmith, aaron.ballman, vitalybuka, rjmccall, Sanitizers. lebedev.ri added projects: clang, Sanitizers. Herald added subscribers: arphaman, dberris. Herald added a project: LLVM. Quote from

[PATCH] D64672: [X86] Prevent passing vectors of __int128 as in llvm IR

2019-09-03 Thread Craig Topper via Phabricator via cfe-commits
craig.topper updated this revision to Diff 218506. craig.topper added a comment. Change test name and adjust to the changes I think @rksimon was asking for. I haven't commited the test yet. I'd like to verify that the before version of the test is how you would like it pre-committed CHANGES

[PATCH] D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour

2019-09-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 218507. lebedev.ri added a comment. NFC, fixup docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67122/new/ https://reviews.llvm.org/D67122 Files: clang/docs/ReleaseNotes.rst

r370808 - [AMDGPU] Set default flat work group size to (1, 256) for HIP

2019-09-03 Thread Yaxun Liu via cfe-commits
Author: yaxunl Date: Tue Sep 3 11:50:24 2019 New Revision: 370808 URL: http://llvm.org/viewvc/llvm-project?rev=370808=rev Log: [AMDGPU] Set default flat work group size to (1,256) for HIP Differential Revision: https://reviews.llvm.org/D67048 Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp

[PATCH] D66983: [WebAssembly] Add wasm-specific vector shuffle builtin and intrinsic

2019-09-03 Thread Thomas Lively via Phabricator via cfe-commits
tlively abandoned this revision. tlively added a comment. Abandoning in favor of @sunfish's idea for introducing a cost mechanism for shuffle masks in DAGCombiner. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66983/new/

r370807 - Unbreak the build after r370798

2019-09-03 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue Sep 3 11:24:56 2019 New Revision: 370807 URL: http://llvm.org/viewvc/llvm-project?rev=370807=rev Log: Unbreak the build after r370798 Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp Modified:

[PATCH] D67119: On PowerPC, Secure-PLT by default for FreeBSD 13 and higher

2019-09-03 Thread Dimitry Andric via Phabricator via cfe-commits
dim created this revision. dim added reviewers: emaste, jhibbits, hfinkel. Herald added subscribers: steven.zhang, shchenz, jsji, MaskRay, kbarton, krytarowski, nemanjai. Herald added a project: clang. In https://svnweb.freebsd.org/changeset/base/349351, FreeBSD 13 and higher transitioned to

[PATCH] D66988: [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes

2019-09-03 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. *ping* Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66988/new/ https://reviews.llvm.org/D66988 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D46791: Make -gsplit-dwarf generally available

2019-09-03 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D46791/new/ https://reviews.llvm.org/D46791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D67117: [clangd] Split Preamble.h out of ClangdUnit.h. NFC

2019-09-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov 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/D67117/new/ https://reviews.llvm.org/D67117

[PATCH] D66361: Improve behavior in the case of stack exhaustion.

2019-09-03 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D66361#1655903 , @krytarowski wrote: > This change broke on NetBSD. > > http://lab.llvm.org:8011/builders/netbsd-amd64/builds/22003/steps/run%20unit%20tests/logs/FAIL%3A%20Clang%3A%3Astack-exhaustion.cpp Test disabled for

r370801 - Disable stack exhaustion test on NetBSD, where either the detection or

2019-09-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Sep 3 11:00:44 2019 New Revision: 370801 URL: http://llvm.org/viewvc/llvm-project?rev=370801=rev Log: Disable stack exhaustion test on NetBSD, where either the detection or recovery mechanism does not appear to work. Modified:

[PATCH] D67117: [clangd] Split Preamble.h out of ClangdUnit.h. NFC

2019-09-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, javed.absar, ilya-biryukov, mgorny. Herald added a project: clang. Add comment describing use of preamble in clangd. Remove deps on ClangdUnit.h where possible. Repository:

[PATCH] D66333: [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message

2019-09-03 Thread Kristóf Umann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370798: [analyzer] NonNullParamChecker and CStringChecker parameter number in checker… (authored by Szelethus, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.

r370798 - [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message

2019-09-03 Thread Kristof Umann via cfe-commits
Author: szelethus Date: Tue Sep 3 10:57:01 2019 New Revision: 370798 URL: http://llvm.org/viewvc/llvm-project?rev=370798=rev Log: [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message There are some functions which can't be given a null pointer as parameter

r370795 - [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'.

2019-09-03 Thread Richard Smith via cfe-commits
Author: rsmith Date: Tue Sep 3 10:49:51 2019 New Revision: 370795 URL: http://llvm.org/viewvc/llvm-project?rev=370795=rev Log: [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'. Don't turn the boxes green yet, since Clang 9 hasn't been released. Modified:

[PATCH] D67113: ICK_Function_Conversion and ICK_Qualification are third kind conversions

2019-09-03 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert created this revision. aaronpuchert added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. Not sure if this has any effect, but it was inconsistent before. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D67113 Files:

[PATCH] D66748: [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 218485. jsji added a comment. Add range check and tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66748/new/ https://reviews.llvm.org/D66748 Files: clang/include/clang/Basic/BuiltinsPPC.def

[PATCH] D67112: [Sema] Add implicit cast for conversion of function references

2019-09-03 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert created this revision. aaronpuchert added a reviewer: rsmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. aaronpuchert marked 2 inline comments as done. aaronpuchert added a comment. If anyone shares my feeling that the boolean output parameters of

[PATCH] D66665: [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+

2019-09-03 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370792: [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+ (authored by tra, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior

[PATCH] D67112: [Sema] Add implicit cast for conversion of function references

2019-09-03 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert marked 2 inline comments as done. aaronpuchert added a comment. If anyone shares my feeling that the boolean output parameters of `CompareReferenceRelationship` should rather move to the return value, I would be happy to do that. Comment at:

r370792 - [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+

2019-09-03 Thread Artem Belevich via cfe-commits
Author: tra Date: Tue Sep 3 10:31:58 2019 New Revision: 370792 URL: http://llvm.org/viewvc/llvm-project?rev=370792=rev Log: [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+ vote.ballot instruction is gone in recent CUDA versions and vote.sync.ballot can not be used

[PATCH] D66361: Improve behavior in the case of stack exhaustion.

2019-09-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. This change broke on NetBSD. http://lab.llvm.org:8011/builders/netbsd-amd64/builds/22003/steps/run%20unit%20tests/logs/FAIL%3A%20Clang%3A%3Astack-exhaustion.cpp (view as text) TEST 'Clang :: SemaTemplate/stack-exhaustion.cpp' FAILED

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-03 Thread David Gatwood via Phabricator via cfe-commits
dgatwood marked 17 inline comments as done. dgatwood added inline comments. Comment at: clang-tools-extra/clang-tidy/google/RequireCategoryMethodPrefixesCheck.cpp:57 + } + std::string method_name = method_declaration->getNameAsString(); + auto owning_objc_class_interface =

[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji marked 2 inline comments as done. jsji added inline comments. Comment at: clang/test/CodeGen/builtins-ppc-error.c:78 +void testDSS(int index) { + vec_dss(index); //expected-error {{argument to '__builtin_altivec_dss' must be a constant integer}} + wuzish

[PATCH] D66699: [PowerPC][Altivec] Fix constant argument for vec_dss

2019-09-03 Thread Jinsong Ji via Phabricator via cfe-commits
jsji updated this revision to Diff 218479. jsji added a comment. Add range check and test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66699/new/ https://reviews.llvm.org/D66699 Files: clang/include/clang/Basic/BuiltinsPPC.def

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-03 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:70 +- New :doc:`google-objc-require-category-method-prefixes + ` check. Please sort new checks list alphabetically. CHANGES SINCE LAST ACTION

[PATCH] D65917: [clang-tidy] Added check for the Google style guide's category method naming rule.

2019-09-03 Thread David Gatwood via Phabricator via cfe-commits
dgatwood updated this revision to Diff 218478. dgatwood added a comment. Incorporated feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65917/new/ https://reviews.llvm.org/D65917 Files: clang-tools-extra/clang-tidy/google/CMakeLists.txt

  1   2   >