[PATCH] D40566: Check if MemberExpr arguments are type-dependent.

2017-11-28 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. Fixes: PR28290 When checking an argument list, arguments from the templated class instance, were returning 'is dependent' based on the 'this' pointer. In that case, arguments were being marked dependent, and name lookup was delayed until template instantiation.

[PATCH] D40574: Bounds check argument_with_type_tag attribute.

2017-11-28 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. Fixes: PR28520 Perform a bounds check on a function's argument list, before accessing any index value specified by an 'argument_with_type_tag' attribute. https://reviews.llvm.org/D40574 Files: include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D40574: Bounds check argument_with_type_tag attribute.

2017-11-29 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 124783. mattd added a comment. - Removed the new lines. - Added white space between the data type and pointer character. - Updated the test to check the exact bounds, and over-bounds cases - Combined the diagnostic messages into one via 'select'

[PATCH] D40574: Bounds check argument_with_type_tag attribute.

2017-11-29 Thread Matt Davis via Phabricator via cfe-commits
mattd marked 6 inline comments as done. mattd added inline comments. Comment at: test/Sema/error-type-safety.cpp:3-4 + +static const int test_void + __attribute__((type_tag_for_datatype(test, void))) = 0; + aaron.ballman wrote: > Is this declaration necessary?

[PATCH] D40574: Bounds check argument_with_type_tag attribute.

2017-11-29 Thread Matt Davis via Phabricator via cfe-commits
mattd marked an inline comment as done. mattd added a comment. Thanks for the approval Aaron. I do not have commit access, would you mind submitting this on my behalf? https://reviews.llvm.org/D40574 ___ cfe-commits mailing list

[PATCH] D40398: Remove ValueDependent assertions on ICE checks.

2017-11-23 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. In the case of ill-formed templates, a value dependent name can reach the integral constant expression (ICE) check. After an error occurs following an ill-formed template, an ICE check can be performed on a template definition. That definition might contain an

[PATCH] D41421: Eliminate a magic number. NFC.

2017-12-19 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 127641. mattd added a comment. Thanks for the suggestion Eli. Took your initial suggestion. https://reviews.llvm.org/D41421 Files: lib/Frontend/PrintPreprocessedOutput.cpp Index: lib/Frontend/PrintPreprocessedOutput.cpp

[PATCH] D41421: Eliminate a magic number. NFC.

2017-12-19 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Thanks Eli! I do not have commit permissions, so someone else will have to commit this on my behalf. https://reviews.llvm.org/D41421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41421: Eliminate a magic number. NFC.

2017-12-19 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added a reviewer: bkramer. Calculate sizeof Buffer instead of using a magic value. https://reviews.llvm.org/D41421 Files: PrintPreprocessedOutput.cpp Index: PrintPreprocessedOutput.cpp ===

[PATCH] D40566: Check if MemberExpr arguments are type-dependent.

2017-12-02 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Thanks for the comments Eli! I agree, it makes sense to flag certain expressions to be type dependent at the earliest time of compilation. Clang already does this, as the Value/Type dependence is established upon Expr construction from MemberExpr construction. As we

[PATCH] D40398: Remove ValueDependent assertions on ICE checks.

2017-12-06 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. ping https://reviews.llvm.org/D40398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42248: [LangOpts] Add a LangOpt to represent "#pragma region" support.

2018-01-18 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added reviewers: rnk, rsmith. Both MS and PS4 targets are capable of recognizing the existence of: #pragma region, #pragma endregion. This patch adds a LangOpt and sets the value based on target information or MS compatibility. In the case of PS4 or MS we

[PATCH] D42248: [LangOpts] Add a LangOpt to represent "#pragma region" support.

2018-01-18 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. In https://reviews.llvm.org/D42248#980541, @majnemer wrote: > Why not always support the pragma regardless of the compiler mode? Our > "support" for it just ignores it anyway... Thanks for the reply @majnemer. I am not opposed to that idea. My change just operates

[PATCH] D42248: Always allow "#pragma region".

2018-01-25 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Ping. https://reviews.llvm.org/D42248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42248: Always allow "#pragma region".

2018-01-25 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Thanks @majnemer! Would you mind committing this on my behalf? I do not have commit access, thanks. https://reviews.llvm.org/D42248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

2018-01-25 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added a reviewer: majnemer. This change avoids the overhead of storing, and later crawling, an initializer list of all zeros for arrays. When LLVM visits this (llvm/IR/Constants.cpp) ConstantArray::getImpl() it will scan the list looking for an array of all

[PATCH] D42248: Always allow "#pragma region".

2018-01-26 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC323577: Always allow #pragma region. (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D42248 Files: lib/Lex/Pragma.cpp test/Frontend/region-pragmas.c Index:

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-01 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 132464. mattd added a comment. Updating the diff, missed a few deltas that should have been in the original patch. https://reviews.llvm.org/D42813 Files: include/clang/Sema/Scope.h lib/Sema/SemaStmt.cpp test/CodeGenCXX/debug-for-range-scope-hints.cpp

[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

2018-02-01 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Ping :) https://reviews.llvm.org/D42549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-01 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added a reviewer: rsmith. mattd edited the summary of this revision. This change aims to simplify debugging by annotating the range-for loop artificial variables (range, begin, end) with the scope depth. https://reviews.llvm.org/D42813 Files: SemaStmt.cpp

[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

2018-02-08 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 133540. mattd added a comment. Thanks for the test tips. I realize the original was a bit carried away, my apologies for that. This updated test visits the same code path that we're trying to test, and is much more concise.

[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

2018-02-08 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 133497. mattd added a comment. Thanks for the look @rjmccall . I tossed in the shortcut as you suggested. I also had to fix the instruction numbering in the test case. https://reviews.llvm.org/D42549 Files: lib/CodeGen/CGExprConstant.cpp

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-06 Thread Matt Davis via Phabricator via cfe-commits
mattd added inline comments. Comment at: lib/Sema/SemaStmt.cpp:2346 +// Assume the variables are nested in the inner scope (loop body). +const auto DepthStr = std::to_string(S->getDepth() >> 1); VarDecl *BeginVar = BuildForRangeVarDecl(*this, ColonLoc, AutoType,

[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

2018-02-09 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324776: [CodeGen] Use the zero initializer instead of storing an all zero… (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D42549 Files:

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-14 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325175: [Debug] Annotate compiler generated range-for loop variables. (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D42813 Files: include/clang/Sema/Scope.h

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-14 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 134263. mattd added a comment. - Added a division by 2 instead of the shift, it reads clearer. - Updated the associated comment, reflecting that we divide by two because the variables we are annotating are within the inner scope of the ranged-based for loop.

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-14 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 134272. mattd added a comment. Thanks @dblaikie! I renamed the test, and cleaned up per your suggestion. I originally regex'd the debug-info lines so that the test would verify that the names were artificial; however, being that we already match them as

[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

2018-02-14 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. > Great - can you commit this yourself or would you like me to do it for you? I've got it. Thanks! https://reviews.llvm.org/D42813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40398: Remove ValueDependent assertions on ICE checks.

2018-01-02 Thread Matt Davis via Phabricator via cfe-commits
mattd abandoned this revision. mattd added a comment. Abandoning as this is no longer a problem with release builds. https://reviews.llvm.org/D40398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41421: Eliminate a magic number. NFC.

2018-01-02 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. Ping :) I would like someone to commit this on my behalf, thanks! https://reviews.llvm.org/D41421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-27 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added a reviewer: void. Herald added a subscriber: dberris. This patch introduces `llvm_profile_set_dir_mode` and `llvm_profile_get_dir_mode` to the compiler-rt profile API. Originally, profile data was placed into a directory that was created with a

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-30 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. In https://reviews.llvm.org/D49953#1180466, @probinson wrote: > Is it possible/reasonable for the test to call __llvm_profile_recursive_mkdir > and then verify the mode of the created directory? > The test would have to be flagged as unsupported on Windows but that seems

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-30 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 158144. mattd added a comment. - Added a test that creates a directory via __llvm_profile_recursive_mkdir and verifies the mode. - I intend to only commit one of the two tests, but wanted to provide a more specific/detailed test. - I don't know if we really

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-31 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 158272. mattd added a comment. - Renamed the test output and test directory to clean up the more specific test example. https://reviews.llvm.org/D49953 Files: lib/profile/InstrProfilingUtil.c lib/profile/InstrProfilingUtil.h

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-31 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 158298. mattd added a comment. - Simplify the test case, let the compiler join the literals for us. https://reviews.llvm.org/D49953 Files: lib/profile/InstrProfilingUtil.c lib/profile/InstrProfilingUtil.h test/profile/instrprof-set-dir-mode.c

[PATCH] D49953: [compiler-rt] Add a routine to specify the mode used when creating profile dirs.

2018-07-31 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. mattd marked an inline comment as done. Closed by commit rCRT338456: [compiler-rt] Add a routine to specify the mode used when creating profile dirs. (authored by mattd, committed by ). Herald added subscribers: Sanitizers,

[PATCH] D50408: [analyzer] Avoid querying this-pointers for static-methods.

2018-08-07 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC339201: [analyzer] Avoid querying this-pointers for static-methods. (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D50408 Files:

[PATCH] D50408: [analyzer] Avoid querying this-pointers for static-methods.

2018-08-07 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added a reviewer: dcoughlin. Herald added subscribers: mikhail.ramalho, a.sidorin, szepet, xazax.hun. Herald added a reviewer: george.karpenkov. The loop-widening code processes c++ methods looking for `this` pointers. In the case of static methods (which do

[PATCH] D50410: Removing -debug-info-macros from option suggestions test

2018-08-16 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. In https://reviews.llvm.org/D50410#1201206, @acoomans wrote: > @mattd @Sunil_Srivastava if you have access to the PS4 SDK, could you tell if > the `-debug-info-macro` command line clang option is available? Thank you Hi @acoomans, The ps4 buildbot should be running

[PATCH] D50410: Removing -debug-info-macros from option suggestions test

2018-08-16 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. In https://reviews.llvm.org/D50410#1202597, @acoomans wrote: > @mattd thanks for confirming. I tried `clang -cc1as -target x86_64-scei-ps4 > -debug-info-macros` and got suggestions. > > @modocache @mattd Should we try to first land https://reviews.llvm.org/D50515 > to

[PATCH] D42248: Always allow "#pragma region".

2018-01-18 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 130523. mattd retitled this revision from "[LangOpts] Add a LangOpt to represent "#pragma region" support." to "Always allow "#pragma region".". mattd edited the summary of this revision. mattd added a comment. I'm certainly fine with always allowing this

[PATCH] D44901: [Diag] Avoid emitting a redefinition note if no location is available.

2018-03-26 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added reviewers: bruno, rsmith. The "previous definition is here" note is not helpful if there is no location information. The note will reference nothing in such a case. This patch first checks to see if there is location data, and if so the note diagnostic

[PATCH] D44901: [Diag] Avoid emitting a redefinition note if no location is available.

2018-03-28 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC328712: [Diag] Avoid emitting a redefinition note if no location is available. (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D44901 Files: lib/Sema/SemaDecl.cpp

[PATCH] D54048: [AST] Get aliased type info from an aliased TemplateSpecialization.

2018-11-03 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 172503. mattd added a comment. Thanks for the review @rjmccall. I have moved the type-alias check into TemplateSpecializationType's desugar method. I like this solution better. https://reviews.llvm.org/D54048 Files: include/clang/AST/Type.h

[PATCH] D54048: [AST] Get aliased type info from an aliased TemplateSpecialization.

2018-11-05 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC346146: [AST] Get aliased type info from an aliased TemplateSpecialization. (authored by mattd, committed by ). Repository: rC Clang https://reviews.llvm.org/D54048 Files: include/clang/AST/Type.h

[PATCH] D54048: [AST] Get aliased type info from an aliased TemplateSpecialization.

2018-11-04 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. In https://reviews.llvm.org/D54048#1286654, @rjmccall wrote: > That looks a lot better, thanks. Did you check whether any other tests > needed adjustment? That's not uncommon from this kind of desugaring change. > > If not, LGTM. Thanks again. I ran the typical

[PATCH] D54048: [AST] Get aliased type info from an aliased TemplateSpecialization.

2018-11-02 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added reviewers: aaron.ballman, rjmccall. Previously the TemplateSpecialization instance for 'template_alias', in the example below, returned the type info of the canonical type (int). This ignored the type alias if the template type happen to be aliased.

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

2018-12-12 Thread Matt Davis via Phabricator via cfe-commits
mattd marked 2 inline comments as done. mattd added inline comments. Comment at: lib/Sema/SemaDecl.cpp:10266 auto *FPT = NewFD->getType()->castAs(); - bool AnyNoexcept = HasNoexcept(FPT->getReturnType()); - for (QualType T : FPT->param_types()) -

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

2018-12-18 Thread Matt Davis via Phabricator via cfe-commits
mattd marked an inline comment as not done. mattd added a comment. In D55039#1334195 , @Rakete wrote: > Apart from the comments I think your patch LGTM, but I'll let someone else > hav the final say. Thanks for taking a peek! CHANGES SINCE LAST

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

2018-11-28 Thread Matt Davis via Phabricator via cfe-commits
mattd created this revision. mattd added reviewers: erik.pilkington, rsmith. The flag: `-Wc++17-compat-mangling` was not emitting a warning diagnostic in all cases, specifically if a function has parameters that happen to have function pointers that have noexecept parameters. For example:

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

2018-11-29 Thread Matt Davis via Phabricator via cfe-commits
mattd marked an inline comment as done. mattd added a comment. Thanks for the reviews and added example. I'll update the logic to account for the return type, and add @Rakete 's example to the existing test. Comment at: lib/Sema/SemaDecl.cpp:10225 +

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

2018-12-04 Thread Matt Davis via Phabricator via cfe-commits
mattd marked an inline comment as done. mattd added inline comments. Comment at: lib/Sema/SemaDecl.cpp:10266 auto *FPT = NewFD->getType()->castAs(); - bool AnyNoexcept = HasNoexcept(FPT->getReturnType()); - for (QualType T : FPT->param_types()) -

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

2018-12-03 Thread Matt Davis via Phabricator via cfe-commits
mattd updated this revision to Diff 176515. mattd added a comment. - Move the HasNoexcept lambda to its own static function. - Added an additional check in HasNoexcept to recursively check return values. - Modified the parameter check in Sema::CheckFunctionDeclaration to use llvm::any_of, all we

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

2019-01-10 Thread Matt Davis via Phabricator via cfe-commits
mattd added a comment. *Ping* to see if anyone else has any feedback towards this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55039/new/ https://reviews.llvm.org/D55039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D60850: [sema][objc] Minor refactor to OverrideSearch. NFCI.

2019-04-22 Thread Matt Davis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC358898: [sema][objc] Minor refactor to OverrideSearch. NFCI. (authored by mattd, committed by ). Herald added a project: clang. Herald added a subscriber: cfe-commits. Changed prior to commit: