[PATCH] D56760: Add a new builtin: __builtin_dynamic_object_size

2019-01-15 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: george.burgess.iv, ahatanak, rjmccall, rsmith. Herald added subscribers: kristina, dexonsmith, jkorous. This builtin has the same UI as `__builtin_object_size`, but has the potential to be evaluated dynamically. It is meant t

[PATCH] D56523: Improve a -Wunguarded-availability note

2019-01-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/Sema/availability-guard-format.mm:6 @interface foo -- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been explicitly marked partial here}} +- (void) m

[PATCH] D56523: Improve a -Wunguarded-availability note

2019-01-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 181130. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Fix some triples in the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56523/new/ https://reviews.llvm.org/D56523 Files: clang/include/clang/

[PATCH] D56523: Improve a -Wunguarded-availability note

2019-01-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/test/Sema/availability-guard-format.mm:6 @interface foo -- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has

[PATCH] D56523: Improve a -Wunguarded-availability note

2019-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added subscribers: dexonsmith, jkorous. Mention the deployment target, and don't say "partial" which doesn't really mean anything to users. rdar://problem/33601513 Repository: rC Clang https://reviews.

[PATCH] D56469: [ObjC] Allow the use of implemented unavailable methods from within the @implementation context

2019-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56469/new/ https://reviews.llvm.org/D56469 ___

[PATCH] D56469: [ObjC] Allow the use of implemented unavailable methods from within the @implementation context

2019-01-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:7290 + // when it's actually defined and is referenced from within the + // @implementation itself. + if (const auto *MD = dyn_cast(OffendingDecl)) { Maybe add a sentence:

[PATCH] D56405: Split -Wdelete-non-virtual-dtor into two groups

2019-01-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 180690. erik.pilkington added a comment. This revision is now accepted and ready to land. Split -Wdelete-non-virtual-dtor into -Wdelete-non-abstract-non-virtual-dtor and -Wdelete-abstract-non-virtual-dtor. CHANGES SINCE LAST ACTION https://reviews

[PATCH] D56405: Split -Wdelete-non-virtual-dtor into two groups

2019-01-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington reopened this revision. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. This revision is now accepted and ready to land. I reverted my commit in r350639. Comment at: include/clang/Basic/DiagnosticGroups.td:108-109 def DeleteNo

[PATCH] D56405: Split -Wdelete-non-virtual-dtor into two groups

2019-01-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, aaron.ballman. Herald added subscribers: dexonsmith, jkorous. `-Wdelete-non-virtual-dtor` controlled two diagnostics: 1) calling a non-virtual dtor from an abstract class, and 2) calling a non-virtual dtor from a pol

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 180196. erik.pilkington marked 3 inline comments as done. erik.pilkington added a comment. Mention `__has_attribute` and the ignored without -fobjc-arc thing. @aaron.ballman: Do you have any more thoughts here? CHANGES SINCE LAST ACTION https://re

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 180154. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Remove support for parameter indices. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55865/new/ https://reviews.llvm.org/D55865 Files: clang/docs/Au

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/docs/AutomaticReferenceCounting.rst:1779 +externally-retained, unless the variable was explicitly qualified with +``__strong``. For instance, ``first_param`` is externally-r

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-03 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 180131. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Address John's comments. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55865/new/ https://reviews.llvm.org/D55865 Files: clang/docs/Automat

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:3787 +variable goes out of scope. Parameters and variables annotated with this +attribute are implicitly ``const``. + rjmccall wrote: > You should add a paragraph contrasting

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2019-01-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 179964. erik.pilkington marked 10 inline comments as done. erik.pilkington added a comment. Address review comments. Also, make the attribute apply to parameters via the function declaration instead to parameters directly. i.e.: __attribute__((objc

[PATCH] D55949: Correctly handle function pointers returning a type marked nodiscard

2019-01-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. Still LG, sorry for the delay! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55949/new/ https://reviews.llvm.org/D55949 __

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 179196. erik.pilkington marked 5 inline comments as done. erik.pilkington added a comment. Add some more Sema tests as per Aaron's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55865/new/ https://reviews.llvm.org/D55865 Files: c

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/SemaObjC/externally-retained.m:14 + + EXT_RET int (^d)() = ^{return 0;}; + EXT_RET ObjCTy *e = 0; aaron.ballman wrote: > Should this be useful for function pointer parameters as well? e.g., > ``` > t

[PATCH] D55949: Correctly handle function pointers returning a type marked nodiscard

2018-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. LGTM! Comment at: lib/AST/Expr.cpp:2281-2286 + // If there is no FunctionDecl for the call, check the return type of the + // callee to see if it

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3492 +def warn_ignored_objc_externally_retained : Warning< + "'objc_externally_retained' can only be applied to strong retainable " + "object pointer types with automatic storage

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 179137. erik.pilkington marked 8 inline comments as done. erik.pilkington added a comment. Address some review comments. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55865/new/ https://reviews.llvm.org/D55865 Files: clang/include

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Parse/ParsePragma.cpp:3161 + if (!Tok.is(tok::period)) { +PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_expected_period) +<< II; aaron.ballman wrote: > Can you reuse `di

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 178952. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Add Aaron's testcase, improve the documentation a bit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55628/new/ https://reviews.llvm.org/D55628 Files

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 178928. erik.pilkington marked 10 inline comments as done. erik.pilkington added a comment. Address @aaron.ballman comments, rebase onto r349535. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55865/new/ https://reviews.llvm.org/D5586

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3492 +def warn_ignored_objc_externally_retained : Warning< + "'objc_externally_retained' can only be applied to strong retainable " + "object pointer types with automatic storage

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Just to be clear, this is just a syntactic change from what I originally posted. The old `#pragma clang attribute push NoReturn (...)` is semantically equivalent to the new `#pragma clang attribute NoReturn.push (...)` CHANGES SINCE LAST ACTION https://review

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 178837. erik.pilkington added a comment. After looking through some users of `#pragma clang attribute`, I don't think that the begin/end solution is what we want here. Some users of this attribute write macros that can expand to different attributes

[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

2018-12-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, ahatanak, jordan_rose, aaron.ballman. Herald added subscribers: dexonsmith, jkorous. This attribute, called "objc_externally_retained", exposes clang's notion of pseudo-`__strong` variables in ARC. Pseudo-strong var

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/docs/LanguageExtensions.rst:2667 +Because multiple push directives can be nested, if you're writing a macro that +expands to ``_Pragma("clang attribute")`` it's good hygiene to add a label to +your push/pop directives. A po

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 178254. erik.pilkington marked 7 inline comments as done. erik.pilkington added a comment. Address @aaron.ballman comments. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55628/new/ https://reviews.llvm.org/D55628 Files: clang/docs

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-14 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/test/Sema/pragma-attribute-label.c:7 + +#pragma clang attribute pop // expected-error{{'#pragma clang attribute pop' with no matching '#pragma clang attribute push'}} +#pra

[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

2018-12-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: arphaman, aaron.ballman. Herald added subscribers: dexonsmith, jkorous. One problem with defining macros that expand to _Pragma("clang attribute")` is that they don't nest very well: // In some header... #define ASSUME_X

[PATCH] D55097: [constexpr][c++2a] Try-catch blocks in constexpr functions

2018-12-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. LGTM, but you should probably let @rsmith have the final word! Comment at: lib/Sema/SemaDeclCXX.cpp:1916-1919 +for (Stmt *SubStmt : S->children()) + if (SubStmt && + !CheckConstexprFunctionStmt(SemaRef, Dcl, SubStmt, ReturnStmt

[PATCH] D55097: [constexpr][c++2a] Try-catch blocks in constexpr functions

2018-12-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Hi Bruno, thanks for working on this! Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2370 + "use of this statement in a constexpr %select{function|constructor}0 " + "is incompatible with C++ standards before C++20">, + InGroup, Defaul

[PATCH] D55039: [sema] Warn of mangling change if function parameters are noexcept.

2018-11-29 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. It seems like this check isn't really doing enough to catch this break in full generality. For instance, the mangling of the following changes from C++14 to 17, but isn't diagnosed here: template struct something {}; void f(something) {} The right thing to

[PATCH] D54414: [Sema] Make sure we substitute an instantiation-dependent default template parameter

2018-11-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: rsmith. Herald added a subscriber: dexonsmith. Previously, we'd accept the attached test because we didn't substitute into `void_t` when we really ought to of. Fixes llvm.org/PR39623 Thanks! Repository: rC Clang https

[PATCH] D54344: [Clang][CodeGen][CXX]: Workaround __attribute((no_destroy)) crash/incorrect code generation.

2018-11-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D54344#1294960, @kristina wrote: > In https://reviews.llvm.org/D54344#1294942, @erik.pilkington wrote: > > > LGTM too, with one small fix in test. Thanks for working on this! > > > Well, I figured since the assertion being tripped was (

[PATCH] D54344: [Clang][CodeGen][CXX]: Workaround __attribute((no_destroy)) crash/incorrect code generation.

2018-11-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. LGTM too, with one small fix in test. Thanks for working on this! Comment at: test/CodeGenCXX/attr-no-destroy-d54344.cpp:4 +// RUN: %clang_cc1 -std=c++2a -emit-llvm -O0 -triple x86_64-unknown-linux-gnu -D

[PATCH] D54344: [Clang][CodeGen][CXX]: Workaround __attribute((no_destroy)) crash/incorrect code generation.

2018-11-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. I have a few nits, but I think this looks about right. I reduced this testcase with creduce, can you use the minimized version? Also, I think it makes more sense to put the test into `test/CodeGenCXX` and verify the `-emit-llvm-only` output is correct with FileC

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-11-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Lex/ModuleMap.cpp:1198-1203 +// If the header in the module map refers to a symlink, Header.Entry +// refers to the actual file. The callback should be notified of both. +if (!FullPathAsWritten.empty() && +

[PATCH] D54344: [Clang][CodeGen][CXX]: Workaround __attribute((no_destroy)) crash/incorrect code generation.

2018-11-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a reviewer: erik.pilkington. erik.pilkington added a comment. Have you tried running creduce on the preprocessed source? We should really have a real reproducer for this, otherwise its really hard to tell what the underlying problem is. https://reviews.llvm.org/D54344

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-11-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D53522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D54055: CXXNameMangler::mangleFunctionParam: fix assertion

2018-11-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Can you give an example of some code that triggered this with your patch applied? Even if it isn't a real reproducer right now, it would help to try to understand whats happening here. Repository: rC Clang https://reviews.llvm.org/D54055 _

[PATCH] D54010: [CodeGen] Fix a crash when updating a zeroinitialize designated initializer

2018-11-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1142 + llvm_unreachable("Unexpected Base constant type!"); +} rjmccall wrote: > Is `getAggregateElement` not good enough here? No, `getAggregateElement` is perfect,

[PATCH] D54010: [CodeGen] Fix a crash when updating a zeroinitialize designated initializer

2018-11-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 172306. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Use `getAggregateElement`. Thanks! https://reviews.llvm.org/D54010 Files: clang/lib/CodeGen/CGExprConstant.cpp clang/test/CodeGen/designated-initializers.

[PATCH] D54010: [CodeGen] Fix a crash when updating a zeroinitialize designated initializer

2018-11-01 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, ahatanak. Herald added a subscriber: dexonsmith. LLVM IR, in it's infinite wisdom, doesn't relate `ConstantAggregate` and `ConstantAggregateZero` through inheritance, so make sure we handle both cases here. Fixes a

[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

2018-10-30 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp:23 // this check should only be applied to ObjC sources. - if (!getLangOpts().ObjC1 && !getLangOpts().ObjC2) { + if (!getLangOpts().ObjC) { return

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-10-30 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Lex/ModuleMap.h:649-650 + ///This can differ from \c Header's name due to symlinks. void addHeader(Module *Mod, Module::Header Header, - ModuleHeaderRole Role, bool Imported = false

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-10-30 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 171719. erik.pilkington marked 7 inline comments as done. erik.pilkington added a comment. Address review comments. Thanks! https://reviews.llvm.org/D53522 Files: clang/include/clang/Lex/ModuleMap.h clang/lib/Frontend/DependencyFile.cpp clang/

[PATCH] D53621: Support for groups of attributes in #pragma clang attribute

2018-10-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/docs/LanguageExtensions.rst:2666 - #pragma clang attribute push(__attribute__((annotate("custom"))), apply_to = function) + #pragma clang attribute push (__attribute__(

[PATCH] D53621: Support for groups of attributes in #pragma clang attribute

2018-10-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 171218. erik.pilkington marked an inline comment as done. erik.pilkington added a comment. Add documentation and release notes, `{}`s. Thanks! https://reviews.llvm.org/D53621 Files: clang/docs/LanguageExtensions.rst clang/docs/ReleaseNotes.rst

[PATCH] D53621: Support for groups of attributes in #pragma clang attribute

2018-10-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: aaron.ballman, arphaman. Herald added a subscriber: dexonsmith. This patch allows pushing an empty `#pragma clang attribute push`, then adding multiple attributes to it, then popping them all with `#pragma clang attribute po

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaLambda.cpp:510 +for (const auto &Capture: Captures) { + if (Capture.Id && Capture.Id->getName() == Param->getName()) { +Error = true; Rakete wrote: > erik.pilkington

[PATCH] D53595: [C++17] Reject shadowing of capture by parameter in lambda

2018-10-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Thanks for working on this! Can you update www/cxx_dr_status.html too? Comment at: lib/Sema/SemaLambda.cpp:507 + bool Error = false; + if (getLangOpts().CPlusPlus17) { +// Resolution of CWG 2211 in C++17 renders shadowing ill-f

[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

2018-10-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 170703. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Fix some spacing mistakes. Thanks! https://reviews.llvm.org/D53547 Files: clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp clang-tools-extra/

[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

2018-10-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a subscriber: jingham. erik.pilkington added inline comments. Comment at: clang/lib/Basic/IdentifierTable.cpp:166-167 // in non-arc mode. - if (LangOpts.ObjC2 && (Flags & KEYARC)) return KS_Enabled; - if (LangOpts.ObjC2 && (Flags & KEYOBJC2)) return KS_

[PATCH] D53547: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

2018-10-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, rsmith. Herald added a subscriber: dexonsmith. We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and

[PATCH] D53522: [Frontend] Include module map header declaration in dependency file output

2018-10-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: bruno, rsmith. Herald added a subscriber: dexonsmith. This patch makes clang include headers found in modulemap files in the `.d` file. This is necessary to capture symlinked headers, which previously were ignored, since onl

[PATCH] D53154: [CodeGen] Handle extern references to OBJC_CLASS_$_*

2018-10-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, ahatanak, jfb. Herald added a subscriber: dexonsmith. Some ObjC users declare a `extern` variable named `OBJC_CLASS_$_Foo`, then use it's address as a `Class`. I.e., one could define `isInstanceOfF`: BOOL isInsta

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 168939. erik.pilkington added a comment. Merge the common pointers rather than trying to use the previous one. Thanks! https://reviews.llvm.org/D53046 Files: clang/include/clang/AST/DeclTemplate.h clang/lib/AST/DeclTemplate.cpp clang/lib/Sema/

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D53046#1259933, @rjmccall wrote: > The linking does actually happen in this test case, right? Can we just do > something when linking them to unify their `Common` structures? Yep, that would work too I think. We can't properly merge

[PATCH] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 168912. erik.pilkington added a comment. Actually run the tests! https://reviews.llvm.org/D53048 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td clang/test/Sema/implicit-int-conversion.c

[PATCH] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/test/Sema/implicit-int-conversion.c:1-4 +// RUN: %clang_cc1 -Wconversion -Wno-implicit-int-conversion -DSMALL=char -DBIG=int -DNO_DIAG +// RUN: %clang_cc1 -Wno-conversion -Wimplicit-int-conversion -DSMALL=char -DBIG=int +

[PATCH] D53048: [Basic] Split out -Wimplicit-int-conversion and -Wimplicit-float-conversion from -Wconversion

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, aaron.ballman. Herald added a subscriber: dexonsmith. These two diagnostics are noisy, so its reasonable for users to opt-out of them when -Wconversion is enabled. Fixes rdar://45058981 Thanks for taking a look! R

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:10015 // merged. if (MergeFunctionDecl(NewFD, OldDecl, S, MergeTypeWithPrevious)) { NewFD->setInvalidDecl(); The problem is here, MergeFunctionDecl() needs the injecte

[PATCH] D53046: [Sema] Fix an error-on-valid with friends and templates

2018-10-09 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. Clang used to error out on the attached testcase, due to multiple definitions of `foo`. The problem is that multiple FunctionTemplateDecl::Common pointers are created

[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.

2018-10-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/AST/DeclTemplate.h:1771-1779 + void setIsSpecializedMember(bool V = true) { IsSpecializedMember = V; } + + /// If this class template specialization was declared at class scope (DR727). + /// For example,

[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.

2018-10-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 168352. erik.pilkington added a comment. Address @rsmith's review comments. https://reviews.llvm.org/D52521 Files: clang/include/clang/AST/DeclTemplate.h clang/lib/Sema/SemaTemplateInstantiate.cpp clang/test/SemaCXX/member-spec-dr727.cpp Inde

[PATCH] D52791: [Diagnostics] Check for misleading variable declarations

2018-10-02 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Thanks for working on this! Comment at: include/clang/Basic/DiagnosticSemaKinds.td:318-320 +def warn_misleading_var_type_decl : Warning< + "misleading variable declaration, supposed to be a pointer type instead ?">, + InGroup>; ---

[PATCH] D52675: [clang] Properly apply attributes on explicit instantiations of static data members

2018-09-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added reviewers: rsmith, rjmccall. erik.pilkington added a comment. Add some reviewers. Repository: rC Clang https://reviews.llvm.org/D52675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D52339#1249457, @aaron.ballman wrote: > However, short of that concern, this LGTM. I've spoken with the paper author > for the WG14 paper and I think this approach fits their general proposal, so > I don't think we'll have divergence

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! This doesn't really affect CUDA or OpenCL more than any change to the compiler, so I don't think it makes sense to block this until we hear from them. Repository: rC Clang https://reviews.llvm.org/D52339 __

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-28 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/Sema/SemaDecl.cpp:16320 +// Check for other kinds of shadowing not already handled. +CheckShadow(New, PrevDecl, R); + I don't think we should do this for scoped enums in C++, i.e. this should be fine

[PATCH] D52574: NFC: Fix some darwin linker warnings introduced in r338385

2018-09-26 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: xbolva00, kristina, asb. Herald added subscribers: kadircet, jocewei, PkmX, dexonsmith, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, jrtc27, ioeric, niosHD, sabuasal, apazos, simoncook, johnrusso,

[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.

2018-09-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:143 TSK_ExplicitSpecialization && !Function->getClassScopeSpecializationPattern())) break; It loo

[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.

2018-09-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. Previously, we stopped early on a class-scope explicit specialization, leading us to lose enclosing levels of template arguments. I'm not entirely convinced that this

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added reviewers: jlebar, Anastasia. erik.pilkington added subscribers: jlebar, Anastasia. erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/Features.def:233 EXTENSION(cxx_variadic_templates, LangOpts.CPlusPlus) +EXTENSION(cxx_fixed_enum

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. > There's no reason to make this an `ObjC2`-only feature; we should probably > eliminate that distinction throughout the compiler. Sure, I was just writing a proposal to do that: http://lists.llvm.org/pipermail/cfe-dev/2018-September/059468.html Repository:

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/Features.def:90 FEATURE(objc_default_synthesize_properties, LangOpts.ObjC2) -FEATURE(objc_fixed_enum, LangOpts.ObjC2) +FEATURE(objc_fixed_enum, true) FEATURE(objc_instancetype, LangOpts.ObjC2)

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D52339#1242126, @aaron.ballman wrote: > In https://reviews.llvm.org/D52339#1242118, @jfb wrote: > > > In https://reviews.llvm.org/D52339#1242103, @aaron.ballman wrote: > > > > > In https://reviews.llvm.org/D52339#1242086, @jfb wrote: >

[PATCH] D52339: Support enums with a fixed underlying type in all language modes

2018-09-20 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. A significant number of internal C users have been complaining about the lack of support for fixed enums. We already support this in Objective-C mode, as well as in C

[PATCH] D52271: [Sema] Ensure that we retain __restrict qualifiers when substituting a reference type.

2018-09-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 166224. erik.pilkington added a comment. Sure, the new patch just preserves __restrict qualifiers. Thanks! https://reviews.llvm.org/D52271 Files: clang/lib/Sema/TreeTransform.h clang/test/SemaCXX/subst-restrict.cpp Index: clang/test/SemaCXX/su

[PATCH] D52271: [Sema] Ensure that we retain __restrict qualifiers when substituting a reference type.

2018-09-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rsmith, rjmccall. Herald added a subscriber: dexonsmith. Fixes rdar://43760099. Thanks for taking a look! Repository: rC Clang https://reviews.llvm.org/D52271 Files: clang/lib/Sema/TreeTransform.h clang/test/SemaCXX/

[PATCH] D52253: Fix an assert in the implementation of -Wquoted-include-in-framework-header

2018-09-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 166070. erik.pilkington added a comment. Sure, the new patch moves the test to double-quotes.m and gives it a more meaningful name. Thanks! https://reviews.llvm.org/D52253 Files: clang/lib/Lex/HeaderSearch.cpp clang/test/Modules/Inputs/double-

[PATCH] D52253: Fix an assert in the implementation of -Wquoted-include-in-framework-header

2018-09-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Lex/HeaderSearch.cpp:670 if (IsIncludeeInFramework) { NewInclude += StringRef(ToFramework).drop_back(10); // drop .framework NewInclude += "/"; Crash was here, if ToFramework is empty

[PATCH] D52253: Fix an assert in the implementation of -Wquoted-include-in-framework-header

2018-09-18 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: bruno. Herald added a subscriber: dexonsmith. rdar://43692300 Repository: rC Clang https://reviews.llvm.org/D52253 Files: clang/lib/Lex/HeaderSearch.cpp clang/test/Frontend/Inputs/Radar43692300/Headers/Headers/File.

[PATCH] D51997: [clang] Make sure attributes on member classes are applied properly

2018-09-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Looks good to me! @rsmith should probably have the final word though. Thanks for fixing this. Repository: rC Clang https://reviews.llvm.org/D51997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D51997: [clang] Make sure attributes on member classes are applied properly

2018-09-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1267-1269 + // Instantiate the attributes on both the template declaration and the associated record declaration. + SemaRef.InstantiateAttrsForDecl(TemplateArgs, Pattern, Inst, La

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-09-12 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D48896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-09-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D51189#1211910, @steven_wu wrote: > I feel like this is a much tricky situation than just new and init. Following > example is the same situation. > > __attribute__((objc_root_class)) > @interface NSObject > - (void) foo; > - (

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-09-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 164316. erik.pilkington marked 4 inline comments as done. erik.pilkington added a comment. Address @arphaman's review comments. https://reviews.llvm.org/D51189 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/DeclObjC.h clan

[PATCH] D51697: [Sema] Clean up some __builtin_*_chk diagnostics

2018-09-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: aaron.ballman, rsmith. Herald added subscribers: kristina, dexonsmith. Namely, print the likely macro name when it's used, and include the actual computed sizes in the diagnostic message, which are sometimes not obvious. rda

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-09-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 164064. erik.pilkington added a comment. Ping! In the new patch: - Uncomment __cpp_lib_node_extract, reverting r340544 - Rebase/Clean up the diff a bit https://reviews.llvm.org/D48896 Files: libcxx/include/__hash_table libcxx/include/__node_han

[PATCH] D51649: [Sema] Don't warn about omitting unavailable enum constants in a switch

2018-09-04 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added a subscriber: dexonsmith. rdar://42717026 Thanks for taking a look! Repository: rC Clang https://reviews.llvm.org/D51649 Files: clang/lib/Sema/SemaStmt.cpp clang/test/Sema/switch-availability

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In https://reviews.llvm.org/D51189#1211754, @arphaman wrote: > Hmm, I don't think this solution is ideal, we'd rather have an attribute > somewhere for other consumers of availability annotations. Does MyObject have > an implicit decl of `new`, or are we referri

[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added a reviewer: arphaman. Herald added a subscriber: dexonsmith. rdar://18335828 Thanks! Erik Repository: rC Clang https://reviews.llvm.org/D51189 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/DeclObjC.h cl

[PATCH] D51172: [libcxx] Comment out #define __cpp_lib_node_extract, we only support half of that functionality

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Landed as r340544. @hans: Can you cherry-pick? Repository: rCXX libc++ https://reviews.llvm.org/D51172 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D51172: [libcxx] Comment out #define __cpp_lib_node_extract, we only support half of that functionality

2018-08-23 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: ldionne, mclow.lists, hans. Herald added a reviewer: EricWF. Herald added subscribers: dexonsmith, christof. The other half of this is in https://reviews.llvm.org/D48896, so we shouldn't claim that we support this feature. Th

[PATCH] D48896: [libcxx][c++17] P0083R5: Splicing Maps and Sets Part 2: merge

2018-08-21 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Ping! https://reviews.llvm.org/D48896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   >