[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 wrote

[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-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 or

[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 or

[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 +// CHECK-ELIDE-N

[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 approp

[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 th

[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 func

[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 i

[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] 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`. Repos

[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] 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 include/clang/

[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 a

[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? https:

[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] 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] 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 line

[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] 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&id=89688#toc Repository: r

[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 https://revi

[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 or

[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: lib/C

[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 sing

[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 include/clang/Basic/AttrD

[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 at

[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] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

2017-03-01 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Parse/ParseDeclCXX.cpp:3830-3837 + unsigned NumArgs; + // Some Clang-scoped attributes have some special parsing behavior. + if (ScopeName && ScopeName->getName() == "clang") +NumArgs = +ParseClangAttributeArgs(AttrNa

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

2017-03-01 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296649: Introduce an 'external_source_symbol' attribute that describes the origin (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D29819?vs=90042&id=90205#toc Repository: rL

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

2017-03-02 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 +// CHECK-ELIDE-N

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

2017-03-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman marked 3 inline comments as done. arphaman added inline comments. Comment at: lib/AST/DeclObjC.cpp:987 unsigned noParams = param_size(); if (noParams < 1 || noParams > 3) family = OMF_None; ahatanak wrote: > It seems like this code

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

2017-03-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90473. arphaman marked 3 inline comments as done. arphaman added a comment. The updated diff: - Warns for vector types. - Addresses Akira's comments. Repository: rL LLVM https://reviews.llvm.org/D30174 Files: include/clang/Basic/DiagnosticSemaKinds.t

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

2017-03-06 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297019: [Sema][ObjC] Warn about 'performSelector' calls with selectors (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D30174?vs=90473&id=90709#toc Repository: rL LLVM http

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

2017-03-06 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297023: [CodeGen][Blocks] Refactor capture handling in code that generates (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D30345?vs=90197&id=90712#toc Repository: rL LLVM

[PATCH] D30423: [ubsan] Detect UB loads from bitfields

2017-03-06 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/CodeGenCXX/ubsan-bitfields.cpp:21 + // CHECK: call void @__ubsan_handle_load_invalid_value + return s->e1; +} Can we avoid the check if the bitfield is 2 bits wide? Comment at: test/CodeGenObjC

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

2017-03-07 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaDeclObjC.cpp:4312 + for (const ParmVarDecl *P : Method->parameters()) { +if (P->getType()->isVectorType()) { + Loc = P->getLocStart(); bruno wrote: > Assuming objc/c++ can pass/return these, the c

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

2017-03-07 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90832. arphaman marked an inline comment as done. arphaman added a comment. Add a test for non-ext vector type Repository: rL LLVM https://reviews.llvm.org/D28670 Files: include/clang/AST/DeclBase.h include/clang/Basic/DiagnosticSemaKinds.td lib/A

[PATCH] D30729: [ubsan] Skip range checks for width-limited values

2017-03-08 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. You should also add a test for `enum E : unsigned`. https://reviews.llvm.org/D30729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30183: Add -iframeworkwithsysroot compiler option

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

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

2017-03-10 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, thanks for the fix. Do you need someone to commit it for you? https://reviews.llvm.org/D29944 ___ cfe-commits mailing list cfe-commits@

[PATCH] D30766: Add support for attribute "enum_extensibility"

2017-03-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: include/clang/Basic/Attr.td:887 +def EnumExtensibility : InheritableAttr { + let Spellings = [GNU<"enum_extensibility">]; + let Subjects = SubjectList<[Enum]>; We might as well have a C++11 spelling in the `clang` nam

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

2017-03-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D29944#697587, @redm123 wrote: > I guess so. I don't think I'm allowed to commit. So I would appreciate it. Sure, I will commit it right now. > Which release version would that be in? 4.1 I guess? It will be in the next major release: 5.0

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

2017-03-10 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297465: Print nested name specifiers for typedefs and type aliases (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D29944?vs=88376&id=91342#toc Repository: rL LLVM https://

[PATCH] D30183: Add -iframeworkwithsysroot compiler option

2017-03-13 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297614: Add -iframeworkwithsysroot compiler option (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D30183?vs=89152&id=91534#toc Repository: rL LLVM https://reviews.llvm.org

[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 htt

[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 http://list

[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 t

[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 include/clang/Frontend/CodeGenOptions.de

[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 methods/

[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 di

[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 o

[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 EnterDeclaratorSc

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

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 79556. arphaman added a comment. The updated diff has the following changes: - The default value for '-fstrict-return' is now the same across all platforms, the Darwin specific -fno-strict-return was removed. - The 'fno-strict-return' optimisation avoidance

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

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/AnalysisBasedWarnings.cpp:530 + // Don't need to mark Objective-C methods or blocks since the undefined + // behaviour optimization isn't used for them. +} mehdi_amini wrote: > Quuxplusone wrote: > > This see

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

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/CodeGenCXX/return.cpp:47 + // CHECK-NOSTRICT-OPT-NEXT: zext + // CHECK-NOSTRICT-OPT-NEXT: ret i32 +} mehdi_amini wrote: > Document what's going on in the tests please. > I added some comments that help explain w

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

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D27163#607078, @rsmith wrote: > A target-specific default for this, simply because there's a lot of code on > Darwin that happens to violate this language rule, doesn't make sense to me. > > Basing the behavior on whether a `-Wreturn-type`

[PATCH] D26465: [Diag] Optimize DiagnosticIDs::getDiagnosticSeverity

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Is there any way to test this change? > This saves more than 5% of the parsing time according to perf. That sounds great. What did you test the parsing on? Will this patch get similar improvements for code that compiles without errors and warnings?

[PATCH] D27214: [ObjC] Encode type arguments in property information string constants

2016-11-29 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: rjmccall, ahatanak. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch ensures that Objective-C type arguments are included in the string constants that have encoded information a

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

2016-11-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D26922#608815, @ahatanak wrote: > Yes, I meant ParseDecl:5266. Reading the comment in > ShouldEnterDeclaratorScope, it seemed to me that it shouldn't return true in > this context (when parsing an objective-c). > > Also, the following code (

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

2016-11-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D26922#608815, @ahatanak wrote: > Yes, I meant ParseDecl:5266. Reading the comment in > ShouldEnterDeclaratorScope, it seemed to me that it shouldn't return true in > this context (when parsing an objective-c). Yes, I agree that it's bette

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

2016-11-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 79722. arphaman added a comment. The updated patch performs the check in `ShouldEnterDeclaratorScope`. Repository: rL LLVM https://reviews.llvm.org/D26922 Files: lib/Parse/ParseDecl.cpp lib/Sema/SemaCXXScopeSpec.cpp test/SemaObjCXX/crash.mm Inde

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

2016-11-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. > Also, the following code (which is not valid) crashes with ToT trunk, > > @property (nonatomic) int OuterType::InnerType > > > but compiles without any errors with your patch applied. Do you know why > clang doesn't error out? This worked because clang continued

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

2016-11-30 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: bruno, akyrtzi. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. Code completion results for class methods already include instance methods from Objective-C root classes. This patch ensure

[PATCH] D27298: [Frontend] Fix an issue where a quoted search path is incorrectly removed as a duplicate header search path

2016-12-01 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: mehdi_amini, bruno. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. The commit r126167 started passing the `First` index into `RemoveDuplicates`, but forgot to update `0` to `First` in th

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

2016-12-01 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: rsmith, ahatanak. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch ensures that the switch warning "case value not in enumerated type" isn't shown for opaque enums. We don't kno

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

2016-12-01 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288334: [ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expression (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D26916?vs=78728&id=79893#toc Repository:

[PATCH] D27298: [Frontend] Fix an issue where a quoted search path is incorrectly removed as a duplicate header search path

2016-12-02 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL288491: [Frontend] Fix an issue where a quoted search path is incorrectly (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D27298?vs=79887&id=80038#toc Repository: rL LLVM h

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

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

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

2016-12-05 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaStmt.cpp:1165 if (!hasCasesNotInSwitch) SS->setAllEnumCasesCovered(); ahatanak wrote: > This function used to call setAllEnumCasesCovered() when parsing a switch > statement with an opaqu

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

2016-12-05 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 80285. arphaman marked 2 inline comments as done. arphaman added a comment. The updated patch addresses Bruno's comments. Repository: rL LLVM https://reviews.llvm.org/D16533 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp l

[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&id=80556#toc Repository: rL L

[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&id=80560#toc Repository: rL LLVM https://reviews.llvm.org/

[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&id=80757#toc Repository

[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: https://reviews.llvm.org/D27053

[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] 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 &LO) { + if (!LO.ObjC1 && !LO.ObjC2) +return false; LangOptions.ObjC1 should be always set if LangOptions.ObjC2 is set, so the second check is

[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 `ArrayR

[PATCH] D32081: Add support for editor placeholders to Clang's lexer

2017-04-19 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300667: Add support for editor placeholders to Clang (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D32081?vs=95596&id=95696#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D32176: Add #pragma clang attribute support for the external_source_symbol attribute

2017-04-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 95754. arphaman marked 4 inline comments as done. arphaman added a comment. Addressed Aaron's comments. Repository: rL LLVM https://reviews.llvm.org/D32176 Files: include/clang/Basic/Attr.td lib/Sema/SemaDeclAttr.cpp test/Misc/pragma-attribute-sup

[PATCH] D32176: Add #pragma clang attribute support for the external_source_symbol attribute

2017-04-19 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:5773 + // Check whether the attribute appertains to the given subject. + if (!Attr.diagnoseAppertainsTo(S, D)) +return true; I hoisted it after `diagnoseLangOpts` to keep some tests happy

[PATCH] D32176: Add #pragma clang attribute support for the external_source_symbol attribute

2017-04-19 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300712: Add #pragma clang attribute support to the external_source_symbol attribute (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D32176?vs=95754&id=95767#toc Repository:

[PATCH] D32010: [indexer] Record class template specializations using a new 'SpecializationOf' relationship

2017-04-20 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL300832: [index] Record class template specializations using a new 'SpecializationOf' (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D32010?vs=95112&id=95927#toc Repository:

[PATCH] D32020: [indexer] The relationship between the declarations in template specializations that 'override' declarations in the base template should be recorded

2017-04-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 95940. arphaman added a comment. Updated the relationship to be 'overrideOf | specializationOf' to differentiate it from regular 'overrideOf'. Repository: rL LLVM https://reviews.llvm.org/D32020 Files: lib/Index/IndexDecl.cpp lib/Index/IndexingCont

[PATCH] D25051: Fix PR 10758: Infinite recursion when dealing with copy-initialization

2017-04-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 96122. arphaman added reviewers: ahatanak, v.g.vassilev. arphaman added a comment. Rebased the patch. Repository: rL LLVM https://reviews.llvm.org/D25051 Files: include/clang/Sema/Sema.h lib/Sema/SemaInit.cpp test/SemaCXX/constructor-initializer.c

[PATCH] D25113: [Sema] Don't display an invalid redefinition error when dealing with a redefinition of a function whose previous definition was typo-corrected

2017-04-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 96123. arphaman added reviewers: ahatanak, v.g.vassilev. arphaman added a comment. Rebased the patch. Repository: rL LLVM https://reviews.llvm.org/D25113 Files: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp test/SemaCXX/typo-correction.cpp Ind

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Please post the diff with full context (git diff -U). Repository: rL LLVM https://reviews.llvm.org/D32348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: clang/test/Index/print-type.cpp:118 // CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0] -// CHECK: FieldDecl=qux:29:38 (Definition) [type=Qux, outer::inner::Bar::FooType>] [typekind=Unexposed] [templateargs/4= [type=int

[PATCH] D32424: Add a fix-it for -Wunguarded-availability

2017-04-24 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. This patch adds a fix-it for the -Wunguarded-availability warning. This fix-it is similar to the Swift one: it suggests that you wrap the statement in an `if (@available)` check. The produced fixits are indented (just like the Swift ones) to make them look nice i

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-24 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 see, thanks for explaining. LGTM. Do you need someone to commit it? https://reviews.llvm.org/D32348 ___ cfe-commits mailing list cfe-commit

[PATCH] D32389: [libclang] Expose some target information via the C API.

2017-04-24 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Maybe it would be better to introduce a `CXTargetInfo` type, and change the API to be: clang_getTranslationUnitTargetInfo clang_TargetInfo_getTriple clang_TargetInfo_getPointerWidth ? This way the `TargetInfo` functions will be cleanly separated, so we can extend

[PATCH] D32020: [indexer] The relationship between the declarations in template specializations that 'override' declarations in the base template should be recorded

2017-04-24 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301180: [index] The relation between the declarations in template specializations (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D32020?vs=95940&id=96396#toc Repository: rL

[PATCH] D32424: Add a fix-it for -Wunguarded-availability

2017-04-25 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 96538. arphaman added a comment. Now the patch takes the following situations into account: - Enclose only the statement in a `case`. - If the fixit has to enclose a declaration statement, then the fixit will try to enclose the appropriate uses as well. R

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-25 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Sure. You can ask Chris Lattner for commit access for future patches :) https://reviews.llvm.org/D32348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-25 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301328: [libclang] Check for a record declaration before a template specialization (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D32348?vs=96130&id=96590#toc Repository: r

[PATCH] D32348: [libclang] Check for a record declaration before a template specialization.

2017-04-25 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. @emilio, you can request to merge this into 4.0.1 by using a script called merge-request.sh (http://lists.llvm.org/pipermail/llvm-dev/2017-March/111530.html). Repository: rL LLVM https://reviews.llvm.org/D32348 ___ cfe

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

2017-04-25 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] D32389: [libclang] Expose some target information via the C API.

2017-04-26 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. It looks good, I have a couple of comments: Comment at: clang/include/clang-c/Index.h:1573 +CINDEX_LINKAGE void +clang_TargetInfo_dispose(CXTargetInfo info); + Please capitalize `Info` here and in the other parameter lists. =

<    9   10   11   12   13   14   15   >