[PATCH] D29451: Add a prototype for clangd v0.1

2017-02-06 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. This might be a bad question, but is there any particular reason why you didn't use the YAML Traits API for parsing instead of the raw YAML Stream API? In my experience the traits based API is quite convenient for structured data like various options and parameters in

[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

2017-02-06 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. I feel like you should have at least one statement in the test that uses explicit 'this' to access a field/method. Does your patch handle fields/methods in base classes as well? I think 'this' might be implicitly converted in the base of the member expression. Also,

[PATCH] D27257: [CodeCompletion] Ensure that ObjC root class completes instance methods from protocols and categories as well

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 85400. arphaman added a comment. Add comment to parameter Repository: rL LLVM https://reviews.llvm.org/D27257 Files: lib/Sema/SemaCodeComplete.cpp test/Index/complete-objc-message.m Index: test/Index/complete-objc-message.m

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D28514#651724, @ahatanak wrote: > If they are equal, the loop can continue because a UsingDecl doesn't hide a > UsingShadowDecl that is tied to it. You're right, that would be better, I didn't notice that method before. Repository: rL

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 85398. arphaman added a comment. Verify that the using shadow decl can be hidden by its owning using decl. Repository: rL LLVM https://reviews.llvm.org/D28514 Files: lib/Sema/SemaLookup.cpp test/Index/complete-cached-globals.cpp Index:

[PATCH] D27257: [CodeCompletion] Ensure that ObjC root class completes instance methods from protocols and categories as well

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman marked an inline comment as done. arphaman added a comment. In https://reviews.llvm.org/D27257#652135, @bruno wrote: > How does this interact (if at all) with classes annotated with > `__attribute__((objc_root_class))`? The root classes are just classes without a superclass, the

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/AttrDocs.td:1005 +language=\ *identifier* + The source language in which this declaration was defined. + aaron.ballman wrote: > This being an identifier makes me wonder about languages that aren't

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 89298. arphaman marked 8 inline comments as done. arphaman added a comment. I've addressed Aaron's comments and made the language a string literal. Repository: rL LLVM https://reviews.llvm.org/D29819 Files: include/clang/Basic/Attr.td

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. The `performSelector` family of methods from Foundation use `objc_msgSend` to dispatch the selector invocations to objects. However, method calls to methods that return record types might have to use the `objc_msgSend_stret` as the return value won't find into

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/CodeGen/CodeGenFunction.h:2479 + llvm::Value *EmitObjCIsOSVersionAtLeast(ArrayRef Args); + I think it's better to treat this as a builtin in its own right, without including the ObjC part in the names. This

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D29819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30174#681801, @ahatanak wrote: > Do we still issue a warning even when the struct can be returned in a > register? For example, x86 can return a small struct (for example, a struct > with one int field) in a single register, in which case

[PATCH] D30183: Add -iframeworkwithsysroot compiler option

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. This patch adds support for a new `-iframeworkwithsysroot` compiler option which allows the user to specify a framework path that can be prefixed with the sysroot. This option is similar to the `-iwithsysroot` option that exists to supplement `-isystem`.

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/Attr.td:308-311 + // - An attribute requires delayed parsing (LateParsed is on) + // - An attribute has no GNU/CXX11 spelling + // - An attribute has no subject list + // - An attribute derives from a StmtAttr

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/Attr.td:308-311 + // - An attribute requires delayed parsing (LateParsed is on) + // - An attribute has no GNU/CXX11 spelling + // - An attribute has no subject list + // - An attribute derives from a StmtAttr

[PATCH] D29944: libclang: Print namespaces for typedefs and type aliases

2017-02-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/Misc/diag-template-diffing.cpp:27 // CHECK-ELIDE-NOTREE: no matching function for call to 'f' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument +//

[PATCH] D30131: [profiling] Don't skip non-base constructors if there is a virtual base (fixes PR31992)

2017-02-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/CodeGen/CodeGenPGO.cpp:631 + ((isa(D) && GD.getCtorType() != Ctor_Base && +!cast(D)->getParent()->getNumVBases()) || (isa(D) && GD.getDtorType() != Dtor_Base))) { I think it would be more

[PATCH] D30248: [libclang] Fix crash in member access code completion with implicit base

2017-02-22 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. It seems that unresolved member expressions have other lookup issues. For example, this will crash when code-completing as well: struct Foo { void foo() const; static void foo(bool); }; struct Bar: Foo { void foo(bool param) { this->Foo::foo(/*CC

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-22 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/CodeGenObjC/availability-check.m:16 + // CHECK: br i1 true + if (__builtin_available(ios 10, *)) +; Shouldn't this be `br i1 false`, since we are building for macOS so we have no iOS support at all?

[PATCH] D27827: [ObjC] CodeGen support for @available on macOS

2017-02-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Thanks for the explanation, now I get it! LGTM, with one request for change in the tests Comment at: test/CodeGenObjC/availability-check.m:22 + // CHECK: br i1 true + if (__builtin_available(macos 10.11, *)) +; Please add a

[PATCH] D28772: [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma in macro argument pre-expansion mode when skipping a function body

2017-02-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D28772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

2017-02-24 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. This patch refactors the code figures out which block captures need to be copied/destroyed using special copy/destroy code. This is a preparation patch for work on merging block copy/destroy routines. Thanks for taking a look! Repository: rL LLVM

[PATCH] D28772: [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma in macro argument pre-expansion mode when skipping a function body

2017-02-24 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296140: [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28772?vs=87801=89688#toc Repository: rL

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-24 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/Attr.td:308-311 + // - An attribute requires delayed parsing (LateParsed is on) + // - An attribute has no GNU/CXX11 spelling + // - An attribute has no subject list + // - An attribute derives from a StmtAttr

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30174#681890, @ahatanak wrote: > In https://reviews.llvm.org/D30174#681843, @arphaman wrote: > > > Yes, we do. Primarily for the following reason: even if some target may > > return a struct in a register, another target isn't guaranteed to

[PATCH] D30131: [profiling] PR31992: Don't skip interesting non-base constructors

2017-02-22 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. LGTM. One point to note, when we are displaying coverage for constructors that have both the base and complete versions instrumented, e.g.: class Foo { public: Foo() { } };

[PATCH] D28286: [CodeCompletion] Code complete the missing C++11 keywords

2017-02-13 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL295001: [CodeCompletion] Code complete the missing C++11 keywords (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28286?vs=83030=88271#toc Repository: rL LLVM

[PATCH] D29967: Get class property selectors from property decl if it exists

2017-02-14 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Can you please post the patch with full context (http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface)? https://reviews.llvm.org/D29967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D29886: [clangd] Wire up ASTUnit and publish diagnostics with it.

2017-02-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: clangd/ASTManager.cpp:69 + // our one-element queue is empty. + if (!RequestIsPending && !Done) +ClangRequestCV.wait(Lock); This is just a suggestion based on personal opinion: `RequestIsPending` and

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/AttrDocs.td:1007 + +defined_in=\ *string-literal* + The name of the source container in which the declaration was defined. The aaron.ballman wrote: > Would this hold something like a file name? If

[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

2017-02-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/CodeGenCXX/ubsan-suppress-null-checks.cpp:8 + int load_member() { +// CHECK: call void @__ubsan_handle_type_mismatch +// CHECK-NOT: call void @__ubsan_handle_type_mismatch I think this kind of check

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 88222. arphaman marked 9 inline comments as done. arphaman added a comment. Thanks for the feedback! I've addressed the majority of your comments. Repository: rL LLVM https://reviews.llvm.org/D29819 Files: include/clang/Basic/Attr.td

[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

2017-02-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Btw, you mentioned that 'this' must have been null-checked before the method is called. But what if it's called from some part of code that was compiled without `-fsanitize=null`? Wouldn't we still want at least one check to see if 'this' is null in a method?

[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

2017-02-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Thanks! I guess for the sake of completeness it might be useful for handle 'this' in parens as well, since it could up in macros: #define MEMBER(x) (x)->y ... MEMBER(this) ... Btw, I was curious if we could do a similar optimization in Objective-C, but

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. This patch adds an `external_source_symbol` attribute to Clang. This attribute specifies that a declaration originates from an external source and describes the nature of that source. This attribute is useful for mixed-language projects or project that use

[PATCH] D28772: [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma in macro argument pre-expansion mode when skipping a function body

2017-02-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 87801. arphaman added a comment. Sorry about the delay. As per Richard's suggestion, the updated patch now makes the `_Pragma` parser responsible for initiating the removal of cached tokens. Repository: rL LLVM https://reviews.llvm.org/D28772 Files:

[PATCH] D29768: [TargetInfo] Set 'UseSignedCharForObjCBool' to false by default

2017-02-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. The target-specific flag 'UseSignedCharForObjCBool' is used to determine the type for the Objective-C BOOL type. We should set it to `false` by default so that new targets can avoid setting it to `true`. Repository: rL LLVM https://reviews.llvm.org/D29768

[PATCH] D28286: [CodeCompletion] Code complete the missing C++11 keywords

2017-02-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D28286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29530: [ubsan] Reduce null checking of C++ object pointers (PR27581)

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D29530 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30009#678091, @hfinkel wrote: > I don't understand why it only supports some attributes. Is there some > handling that needs to take place (I don't see anything obvious in this > patch)? If most attributes will "just work", I'd much rather

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 88764. arphaman marked an inline comment as done. arphaman added a comment. The updated patch switches over to the opt-out approach, allows the C++11 style syntax and improves documentation. Repository: rL LLVM https://reviews.llvm.org/D30009 Files:

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: docs/LanguageExtensions.rst:2349 +attribute is supported by the pragma by referring to the +:doc:`individual documentation for that attribute `. arphaman wrote: > efriedma wrote: > > I'm wondering if we can tweak the

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: docs/LanguageExtensions.rst:2349 +attribute is supported by the pragma by referring to the +:doc:`individual documentation for that attribute `. efriedma wrote: > arphaman wrote: > > arphaman wrote: > > > efriedma

[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

2017-02-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D28670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. This patch adds support for the `#pragma clang attribute` directive that was proposed recently at http://lists.llvm.org/pipermail/cfe-dev/2017-February/052689.html. Initially it supports the `annotate`, `require_constant_initialization` and

[PATCH] D29944: libclang: Print namespaces for typedefs and type aliases

2017-02-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. I'm quite surprised by the fact that we have to change so many diagnostics in tests. Do these diagnostics have the full qualifiers for errors that occur with record types instead of typedefs? https://reviews.llvm.org/D29944

[PATCH] D30009: Add support for '#pragma clang attribute'

2017-02-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: docs/LanguageExtensions.rst:2349 +attribute is supported by the pragma by referring to the +:doc:`individual documentation for that attribute `. efriedma wrote: > I'm wondering if we can tweak the approach so that we

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292805: [Sema] UsingShadowDecl shouldn't be hidden by the UsingDecl that owns it (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28514?vs=85398=85414#toc Repository: rL

[PATCH] D27257: [CodeCompletion] Ensure that ObjC root class completes instance methods from protocols and categories as well

2017-01-24 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292932: [CodeCompletion] Ensure that ObjC root class completes instance (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D27257?vs=85400=85578#toc Repository: rL LLVM

[PATCH] D27257: [CodeCompletion] Ensure that ObjC root class completes instance methods from protocols and categories as well

2017-01-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. ping Repository: rL LLVM https://reviews.llvm.org/D27257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28349: [Frontend] The macro that describes the Objective-C bool type should be defined in C as well

2017-01-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D28349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25817: [Sema] Improve the error diagnostic for dot destructor calls on pointer objects

2017-01-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Are there any other comments for this patch? I would like to commit it in the next couple of days, as it was accepted and I believe I addressed Richard's concerns. Thanks Repository: rL LLVM https://reviews.llvm.org/D25817

[PATCH] D28772: [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma in macro argument pre-expansion mode when skipping a function body

2017-01-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: bruno, rsmith, akyrtzi. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. Herald added a subscriber: nemanjai. This patch fixes a token caching problem that currently occurs when clang is

[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

2017-01-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 84564. arphaman marked an inline comment as done. arphaman added a comment. Use better diagnostic message as suggested by Erik Repository: rL LLVM https://reviews.llvm.org/D28670 Files: include/clang/AST/DeclBase.h

[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

2017-01-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaDeclObjC.cpp:4337 + VersionTuple MethodVersion = Method->getVersionIntroduced(); + if (SemaRef.getASTContext().getTargetInfo().getPlatformMinVersion() >= + AcceptedInVersion && erik.pilkington

[PATCH] D28705: [Sema] Fix bug in handling of designated initializer

2017-01-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D28705 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D25213: Fix PR28181: Prevent operator overloading related assertion failure crash that happens in C only

2017-01-18 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping Repository: rL LLVM https://reviews.llvm.org/D25213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-18 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 84842. arphaman marked an inline comment as done. arphaman added a comment. Avoid the hidden declaration in `VisibleDeclsRecord::checkHidden` instead of the decl consumer in code-completion Repository: rL LLVM https://reviews.llvm.org/D28514 Files:

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-18 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:961 +// then incorrectly applied to the target declaration. This can be avoided +// by resetting the declaration that's being hidden. +if (Hiding && isa(Hiding)) ahatanak

[PATCH] D25817: [Sema] Improve the error diagnostic for dot destructor calls on pointer objects

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292615: [Sema] Improve the error diagnostic for dot destructor calls on pointer objects (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D25817?vs=75712=85135#toc Repository:

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaLookup.cpp:3433 + // is not hidden by the using declaration. + if (isa(ND) && isa(D)) +continue; ahatanak wrote: > Do we have to check that ND's UsingDecl is equal to D? Or we don't have

[PATCH] D28349: [Frontend] The macro that describes the Objective-C bool type should be defined in C as well

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292617: [Frontend] The macro that describes the Objective-C bool type should (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28349?vs=83354=85143#toc Repository: rL LLVM

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D28514#651675, @ahatanak wrote: > This is not invalid: > > namespace Foo { > class C { }; > } > namespace Bar { class C { }; } > > void foo1() { > using Foo::C; > { > using Bar::C; > } > } > I see, that could

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 85151. arphaman added a comment. Ensure that the UsingShadowDecl and UsingDecl are in the same DeclContext. Repository: rL LLVM https://reviews.llvm.org/D28514 Files: lib/Sema/SemaLookup.cpp test/Index/complete-cached-globals.cpp Index:

[PATCH] D25213: Fix PR28181: Prevent operator overloading related assertion failure crash that happens in C only

2017-01-19 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. arphaman marked an inline comment as done. Closed by commit rL292497: [Sema] Fix PR28181 by avoiding calling BuildOverloadedBinOp in C mode (authored by arphaman). Changed prior to commit:

[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

2017-02-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30345#688144, @rjmccall wrote: > You're doing this refactor to... support doing another refactor of the same > code? Why are these patches separate? Not quite, by "merging block copy/destroy routines" I meant that my next patch will try

[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

2017-02-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90033. arphaman marked 3 inline comments as done. arphaman added a comment. The updated patch uses just one enum and simplifies the capture search loops. Repository: rL LLVM https://reviews.llvm.org/D30345 Files: lib/CodeGen/CGBlocks.cpp Index:

[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

2017-02-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:1414 + +} // end anonymous namespace + vsk wrote: > I don't see the need for two GenericInfo types (although it's plausible it'll > make sense with your upcoming changes!). I had in mind a

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90042. arphaman marked 2 inline comments as done. arphaman added a comment. Use `ParseClangAttributeArgs` and add a string to an assert. Repository: rL LLVM https://reviews.llvm.org/D29819 Files: include/clang/Basic/Attr.td

[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-02-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Parse/ParseDeclCXX.cpp:3818-3819 + if (ScopeName && (ScopeName->getName() == "gnu" || +(ScopeName->getName() == "clang" && + AttrName->isStr("external_source_symbol" // GNU-scoped

[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

2017-03-01 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90197. arphaman marked 4 inline comments as done. arphaman added a comment. Addressed John's comments. Repository: rL LLVM https://reviews.llvm.org/D30345 Files: lib/CodeGen/CGBlocks.cpp Index: lib/CodeGen/CGBlocks.cpp

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: rjmccall, rsmith, mehdi_amini. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch adds a new clang flag called `-f[no-]strict-return`. The purpose of this flag is to control how

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 79396. arphaman added a comment. Fixed comment typo. Repository: rL LLVM https://reviews.llvm.org/D27163 Files: include/clang/AST/Decl.h include/clang/Basic/LangOptions.def include/clang/Driver/Options.td

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: aaron.ballman, manmanren. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch adds a new ``format_dynamic_key_arg``. It's intended to be used instead of ``format_arg`` for

[PATCH] D26672: Avoid -Wshadow warnings for parameters that shadow fields in setter-like methods

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping Repository: rL LLVM https://reviews.llvm.org/D26672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D27163#606695, @mehdi_amini wrote: > What is the justification for a platform specific default change here? The flag itself is platform agnostic, however, the default value is different on Darwin (-fno-strict-return). The reason for this

[PATCH] D21099: [Sema] Teach -Wcast-align to look at the aligned attribute of the declared variables

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a reviewer: arphaman. arphaman added a comment. This revision is now accepted and ready to land. LGTM, Thanks https://reviews.llvm.org/D21099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26849: [Sema] Set range end of constructors and destructors in template instantiations

2016-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. I think it LG, thanks for adding the test https://reviews.llvm.org/D26849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26916: [ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Parse/ParseObjc.cpp:2877 +if (GetLookAheadToken(1).is(tok::l_brace) && +ExprStatementTokLoc == AtLoc) { char ch = Tok.getIdentifierInfo()->getNameStart()[0]; bruno wrote: > Does this

[PATCH] D26922: [ObjC++] Don't enter a C++ declarator context when the current context is an Objective-C declaration

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D26922#607186, @ahatanak wrote: > I wonder whether it is possible to avoid calling > DeclScopeObj.EnterDeclaratorScope at ParseDecl.cpp:5317 instead of fixing > Sema::ActOnCXXEnterDeclaratorScope? > > I believe it's calling

[PATCH] D27299: [Sema] C++11 opaque enums should avoid the "case value not in enumerated type" switch warning

2016-12-08 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL289055: [Sema] Avoid "case value not in enumerated type" warning for C++11 opaque enums (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D27299?vs=79892=80757#toc Repository:

[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

2016-12-08 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping Repository: rL LLVM https://reviews.llvm.org/D27165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27053: [CodeCompletion] Provide Objective-C class property completion results

2016-12-08 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. arphaman marked an inline comment as done. Closed by commit rL289058: [CodeCompletion] Provide Objective-C class property completion results (authored by arphaman). Changed prior to commit:

[PATCH] D27607: [ubsan] Treat ObjC's BOOL as if its range is always {0, 1}

2016-12-09 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:1224 + const LangOptions ) { + if (!LO.ObjC1 && !LO.ObjC2) +return false; LangOptions.ObjC1 should be always set if LangOptions.ObjC2 is set, so the second check is

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 81584. arphaman marked 3 inline comments as done. arphaman added a comment. The updated patch removes the dependency on the "-Wreturn-type" diagnostic and verifies that functions that return a type with a non-trivial default constructor are always

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Sema/AnalysisBasedWarnings.h:93 - void IssueWarnings(Policy P, FunctionScopeInfo *fscope, - const Decl *D, const BlockExpr *blkExpr); + void IssueWarnings(Policy P, FunctionScopeInfo *fscope, Decl

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D27163#623811, @majnemer wrote: > My 2 cents: If making this a target-specific default is not OK, why not turn > on -fno-strict-return if -fapple-kext is specified? I believe that would > cover the critical use case in question. We've had

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:1078 + QualType T = FD->getReturnType(); + if (T.isTriviallyCopyableType(Context)) { +// Avoid the optimization for functions that return trivially copyable rjmccall wrote: >

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-16 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Driver/Options.td:1324 + HelpText<"Use C++ undefined behaviour optimization for control flow paths" + "that reach the end of the function without executing a required return">; +def fno_strict_return : Flag<["-"],

[PATCH] D27478: Make ASTContext::getDeclAlign return the correct alignment for FunctionDecls

2016-12-07 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Does this happen with blocks as well? https://reviews.llvm.org/D27478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26922: [ObjC++] Don't enter a C++ declarator context when the current context is an Objective-C declaration

2016-12-07 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288893: [ObjC++] Don't enter a C++ declarator scope when the current context is (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D26922?vs=79722=80556#toc Repository: rL

[PATCH] D16533: Bug 20796 - GCC's -Wstrict-prototypes warning not implemented in Clang

2016-12-07 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288896: Implement the -Wstrict-prototypes warning (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D16533?vs=80285=80560#toc Repository: rL LLVM

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D27163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name

2016-12-12 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: clang-tidy/readability/OneNamePerDeclarationCheck.cpp:133 +VariableLocation.setBegin(tidy::utils::lexer::findLocationAfterToken( +VariableLocation.getEnd(), Tokens, *Result.Context)); + } If you use

[PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. IMO, you can go ahead and commit a fix that removes the captures, and the fix can be reviewed post-commit. I don't think you should revert this patch as you'll have to remove the captures anyway before reinstating this patch, so might as well do it now. Repository:

[PATCH] D27257: [CodeCompletion] Ensure that ObjC root class completes instance methods from protocols and categories as well

2017-01-11 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D27257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-12 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL291757: Avoid multiple -Wunreachable-code diagnostics that are triggered by (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28231?vs=83819=84094#toc Repository: rL LLVM

[PATCH] D28670: [ObjC] Disallow vector parameters and return values in Objective-C methods on older X86 targets

2017-01-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: gparker42, mehdi_amini, erik.pilkington. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch adds a new error that disallows methods that have parameters/return values with a

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 83819. arphaman added a comment. Fix more issues with FIXIT for unary operators. Repository: rL LLVM https://reviews.llvm.org/D28231 Files: lib/Analysis/ReachableCode.cpp lib/Sema/AnalysisBasedWarnings.cpp test/Sema/warn-unreachable.c Index:

[PATCH] D28231: -Wunreachable-code: Avoid multiple diagnostics that are triggered by the same source range and fix the unary operator fixit source range

2017-01-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Analysis/ReachableCode.cpp:229 + if (SilenceableCondValNotSet && SilenceableCondVal->getBegin().isValid()) +*SilenceableCondVal = UO->getSourceRange(); + return UO->getOpcode() == UO_LNot && IsSubExprConfigValue;

  1   2   3   4   5   6   7   8   >