[PATCH] D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies

2019-09-06 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. OK Probably the `ClassTemplateSpec` can not be handled in liberal way because the AST data structure for template specializations do not allow multiple instances with same argument values? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D66516: [clangd] Highlight typedefs to template parameters as template parameters

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. I'll send a separate change to fallback to a new highlighting type if the underlying type of a typedef is complicated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66516/new/ https://reviews.llvm.org/D66516

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 219100. ilya-biryukov added a comment. - Only highlight typedefs to non-composite types, simplifies everything Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66516/new/ https://reviews.llvm.org/D66516

r371208 - [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): pass a vector to EmitCheck()

2019-09-06 Thread Roman Lebedev via cfe-commits
Author: lebedevri Date: Fri Sep 6 07:19:04 2019 New Revision: 371208 URL: http://llvm.org/viewvc/llvm-project?rev=371208=rev Log: [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): pass a vector to EmitCheck() Will be easier to add a new 'check' in a follow-up. This was originally part of

r371207 - [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): refactor EmitGEPOffsetInBytes() helper

2019-09-06 Thread Roman Lebedev via cfe-commits
Author: lebedevri Date: Fri Sep 6 07:18:57 2019 New Revision: 371207 URL: http://llvm.org/viewvc/llvm-project?rev=371207=rev Log: [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): refactor EmitGEPOffsetInBytes() helper It shouldn't really be inlined into the EmitCheckedInBoundsGEP(). Refactoring

r371206 - [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): add some comments to pointer-overflow check

2019-09-06 Thread Roman Lebedev via cfe-commits
Author: lebedevri Date: Fri Sep 6 07:18:49 2019 New Revision: 371206 URL: http://llvm.org/viewvc/llvm-project?rev=371206=rev Log: [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): add some comments to pointer-overflow check It's rather eye-twiching, some comments may help here.. This was

[PATCH] D67274: [clangd] Improve output of semantic highlighting tests in case of failures

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: hokein. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Instead of matching lists of highlightings, we annotate input code with resulting highlightings and diff it against the

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 219097. bruntib added a comment. Usually I'm not a big fan of `auto`, but in this case it makes sense not to duplicate the type name in the same expression. I'll use this rule of thumb in the future, thanks :) Repository: rCTE Clang Tools Extra CHANGES

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

2019-09-06 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. @craig.topper Wasn't this committed at rL371169 ? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64672/new/ https://reviews.llvm.org/D64672 ___ cfe-commits mailing list

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-09-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added a comment. Thanks for following up! Comment at: clang-tidy/bugprone/InfiniteLoopCheck.cpp:53 + +/// \brief Return whether `Var` has a pointer of reference in `S`. +static bool hasPtrOrReferenceInStmt(const Stmt *S, const VarDecl *Var) { Please

r371205 - libclang depends on ClangDriverOptions since r352803

2019-09-06 Thread Nico Weber via cfe-commits
Author: nico Date: Fri Sep 6 06:57:12 2019 New Revision: 371205 URL: http://llvm.org/viewvc/llvm-project?rev=371205=rev Log: libclang depends on ClangDriverOptions since r352803 Without this, the build would sometimes fail with In file included from clang/tools/libclang/CIndexer.cpp:17:

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp:125 +// std::string s = "Hello World"s; +if (const UserDefinedLiteral *UDL = Parent.get()) + if (UDL->getLiteralOperatorKind() ==

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. your patch doesn't have a full context, please upload the patch with full context (`=U9`) or use Arcanist . > I'd think the check instead should be parametrized, so this patch should >

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov planned changes to this revision. ilya-biryukov added a comment. Now that I think about it more, maybe the simplest option is to not recurse into composite types at all E.g. a typedef to a template parameter will be highlighted as a template parameter. A typedef to a pointer

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

2019-09-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr accepted this revision. gribozavr added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:343 + /// to produce a good fix-it hint for most path-sensitive warnings. + void addFixItHint(const FixItHint ) { +

[PATCH] D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies

2019-09-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 6 inline comments as done. martong added inline comments. Comment at: clang/unittests/AST/ASTImporterODRStrategiesTest.cpp:36 + static constexpr auto *Definition = "void X(int a) {}"; + static constexpr auto *ConflictingDefinition = "void X(double a) {}"; +

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 219090. ilya-biryukov added a comment. - Replace UnderlyingTypeVisitor with a function - Remove PrintTo() - Also highlight references to typedefs - reformat Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D67058: [clang][CodeGen] Add alias for cpu_dispatch function with IFunc & Fix resolver linkage type

2019-09-06 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3002 false); llvm::Constant *Resolver = GetOrCreateLLVMFunction( MangledName + ".resolver", ResolverType, GlobalDecl{}, zsrkmyn wrote: > erichkeane wrote: >

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

2019-09-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 5 inline comments as done. lebedev.ri added inline comments. Herald added a subscriber: ychen. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4703-4720 +// 2) The sign of the difference between the computed address and the base +// pointer matches the

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

2019-09-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:491 + ArrayRef Ranges = None, + ArrayRef Fixits = None); NoQ wrote: > gribozavr wrote: > > I'm not sure

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 219088. bruntib edited the summary of this revision. bruntib added a comment. Thank you for the suggestion. I didn't know about this behavior of `%check_clang_tidy`. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION

[PATCH] D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies

2019-09-06 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/ASTImporterODRStrategiesTest.cpp:36 + static constexpr auto *Definition = "void X(int a) {}"; + static constexpr auto *ConflictingDefinition = "void X(double a) {}"; + BindableMatcher getPattern() {

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- accepted this revision. 0x8000- added a comment. This revision is now accepted and ready to land. Looks good to me. Thank you for the fix. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67265/new/ https://reviews.llvm.org/D67265

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tools-extra/test/clang-tidy/readability-magic-numbers.cpp:1 -// RUN: %check_clang_tidy %s readability-magic-numbers %t \ +// RUN: %check_clang_tidy -std=c++14 %s readability-magic-numbers %t \ // RUN: -config='{CheckOptions: \

[PATCH] D67185: [RISCV] Add support for -ffixed-xX flags

2019-09-06 Thread Simon Cook via Phabricator via cfe-commits
simoncook updated this revision to Diff 219068. simoncook edited the summary of this revision. simoncook added a comment. Update based on initial feedback/going down the providing error route. Unlike AArch64, which provides an error if a function tries to call a function with arguments and any

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: alexfh, Szelethus, 0x8000-, aaron.ballman. Herald added subscribers: cfe-commits, xazax.hun, whisperity. Herald added a project: clang. The following code snippet results a false positive report in the magic number checker: std::string

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

2019-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/google/RequireCategoryMethodPrefixesCheck.cpp:57 + } + std::string method_name = method_declaration->getNameAsString(); + auto owning_objc_class_interface = method_declaration->getClassInterface();

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-09-06 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment. Herald added a subscriber: ychen. This is very exciting! I didn't look closely at the actual instrumentation code, as rnk knows that better and had some good comments. Comment at: clang/include/clang/Driver/Options.td:500 def b : JoinedOrSeparate<["-"],

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. hokein retitled this revision from "[clangd] Collect location of macro definition in the ParsedAST allows semantic hightlighting macro

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 219067. hokein added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67264/new/ https://reviews.llvm.org/D67264 Files: clang-tools-extra/clangd/ParsedAST.cpp

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/ParsedAST.cpp:104 // *definitions* in the preamble region of the main file). class CollectMainFileMacroExpansions : public PPCallbacks { const SourceManager

[PATCH] D64644: [Sema] Fixes an assertion failure while instantiation a template with an incomplete typo corrected type

2019-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64644/new/ https://reviews.llvm.org/D64644 ___ cfe-commits mailing

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

2019-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Aside from the missing documentation bit, I think this LG. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp:29 + Options.getLocalOrGlobal("IncludeStyle", "llvm"))), +

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

2019-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D67140#1659978 , @Szelethus wrote: > In D67140#1659907 , @NoQ wrote: > > > In D67140#1659872 , @aaron.ballman > > wrote: > > > > > If

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67172#1660469 , @ilya-biryukov wrote: > Ok, agreed. Adding this indirection layer is probably making things a bit too > complex. I'll update the patch to clearly separate the std symbol mapping and > canonical includes. > >

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:780 + // Prefer a mapping from the system symbols. + if (SystemSymbols) { +if (auto Result = SystemSymbols->mapHeader(Header, QualifiedName)) what's the

[PATCH] D66791: [lldb][ELF] Read symbols from .gnu_debugdata sect.

2019-09-06 Thread Konrad Wilhelm Kleine via Phabricator via cfe-commits
kwk updated this revision to Diff 219038. kwk added a comment. - Fix spelling error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66791/new/ https://reviews.llvm.org/D66791 Files: lldb/CMakeLists.txt lldb/cmake/modules/LLDBConfig.cmake

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Not sure whether the new code is a win overall, it's still a bit messy Let me know what you think. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67172/new/ https://reviews.llvm.org/D67172

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 219061. ilya-biryukov added a comment. - Move system symbol mapping to a different class. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67172/new/ https://reviews.llvm.org/D67172 Files:

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

2019-09-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr accepted this revision. gribozavr added a comment. Still LGTM, just some nitpicks to replace iterator usage with index-based accesses (which I believe is simpler). Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:569

[clang-tools-extra] r371194 - [clangd] Use override keyword to override the base class method, NFC

2019-09-06 Thread Haojian Wu via cfe-commits
Author: hokein Date: Fri Sep 6 03:24:39 2019 New Revision: 371194 URL: http://llvm.org/viewvc/llvm-project?rev=371194=rev Log: [clangd] Use override keyword to override the base class method, NFC Modified: clang-tools-extra/trunk/clangd/ParsedAST.cpp Modified:

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Ok, agreed. Adding this indirection layer is probably making things a bit too complex. I'll update the patch to clearly separate the std symbol mapping and canonical includes. In D67172#1660435 , @hokein wrote: > And I'm

[PATCH] D67172: [clangd] Use pre-populated mappings for standard symbols

2019-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67172#1657590 , @ilya-biryukov wrote: > Also considered moving the std symbol mapping into a separate > (private-to-implementation) class, e.g. we don't use suffix mappings and > symbol mappings outside system includes. >

r371182 - Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType)

2019-09-06 Thread Matthias Gehre via cfe-commits
Author: mgehre Date: Fri Sep 6 01:56:30 2019 New Revision: 371182 URL: http://llvm.org/viewvc/llvm-project?rev=371182=rev Log: Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType) Reland after https://reviews.llvm.org/D66806 fixed the

r371168 - [X86] Pre-commit vector of __int128 test cases for D64672.

2019-09-06 Thread Craig Topper via cfe-commits
Author: ctopper Date: Thu Sep 5 23:02:06 2019 New Revision: 371168 URL: http://llvm.org/viewvc/llvm-project?rev=371168=rev Log: [X86] Pre-commit vector of __int128 test cases for D64672. Added: cfe/trunk/test/CodeGen/x86-vec-i128.c Added: cfe/trunk/test/CodeGen/x86-vec-i128.c URL:

r371169 - [X86] Prevent passing vectors of __int128 as in llvm IR

2019-09-06 Thread Craig Topper via cfe-commits
Author: ctopper Date: Thu Sep 5 23:02:13 2019 New Revision: 371169 URL: http://llvm.org/viewvc/llvm-project?rev=371169=rev Log: [X86] Prevent passing vectors of __int128 as in llvm IR As far as I can tell, gcc passes 256/512 bit vectors __int128 in memory. And passes a vector of 1 _int128 in

<    1   2