Re: r331244 - Implement P0482R2, support for char8_t type.

2018-04-30 Thread Chandler Carruth via cfe-commits
I adjusted the test case in r331245 - it was failing for me and most of the build bots. Please check that I didn't miss anything. On Mon, Apr 30, 2018 at 10:06 PM Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Mon Apr 30 22:02:45 2018 > New Revision: 3

r331245 - Fix up r331244 - the emitted definition is weak_odr linkage. Should get

2018-04-30 Thread Chandler Carruth via cfe-commits
Author: chandlerc Date: Mon Apr 30 23:48:30 2018 New Revision: 331245 URL: http://llvm.org/viewvc/llvm-project?rev=331245&view=rev Log: Fix up r331244 - the emitted definition is weak_odr linkage. Should get the build bots to healthy again without a full revert. As the functionality added has noth

[PATCH] D46300: [Clang] Implement function attribute no_stack_protector.

2018-04-30 Thread Manoj Gupta via Phabricator via cfe-commits
manojgupta created this revision. manojgupta added reviewers: aaron.ballman, rsmith, rnk, void. This attribute tells clang to skip this function from stack protector when -stack-protector option is passed. GCC option for this is: __attribute__((__optimize__("no-stack-protector"))) and the equivale

r331244 - Implement P0482R2, support for char8_t type.

2018-04-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Apr 30 22:02:45 2018 New Revision: 331244 URL: http://llvm.org/viewvc/llvm-project?rev=331244&view=rev Log: Implement P0482R2, support for char8_t type. This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (Th

[libcxx] r331241 - Fix return type of isinf(double) and isnan(double) where possible.

2018-04-30 Thread Richard Smith via cfe-commits
Author: rsmith Date: Mon Apr 30 20:05:40 2018 New Revision: 331241 URL: http://llvm.org/viewvc/llvm-project?rev=331241&view=rev Log: Fix return type of isinf(double) and isnan(double) where possible. When using an old version of glibc, a ::isinf(double) and ::isnan(double) function is provided, r

[PATCH] D45532: [StaticAnalyzer] Checker to find uninitialized fields after a constructor call

2018-04-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Had a look at the actual code, came up with some comments, most are fairly minor, so good job! You did a good job explaining the overall idea, but a lot of specifics were difficult to understand, so i made a few comments on how to make the code a bit easier to read. > I kn

[PATCH] D30882: Add a callback for __has_include and use it for dependency scanning

2018-04-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: include/clang/Lex/PPCallbacks.h:263 + /// \brief Callback invoked when a has_include directive is read. + virtual void HasInclude(SourceLocation Loc, const FileEntry *File) { + } This callback seems pretty unhelpful in

[PATCH] D30881: Track skipped files in dependency scanning

2018-04-30 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. I plan to look into cleaning this up and addressing the review comments. Need to check if `DepCollectorPPCallbacks` has to be updated too. Comment at: lib/Frontend/DependencyFile.cpp:302 + SrcMgr::CharacteristicKind FileType) { + AddFi

[PATCH] D46287: [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets

2018-04-30 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai accepted this revision. smeenai added a comment. This revision is now accepted and ready to land. Makes sense to me. You may wanna wait for @zturner, but I can't really imagine any benefit to restricting this to MSVC. Repository: rC Clang https://reviews.llvm.org/D46287 __

[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

2018-04-30 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. In https://reviews.llvm.org/D43322#1083075, @arthur.j.odwyer wrote: > Sorry, I responded via email but I guess Phabricator didn't pick it up for > some reason. > See below. And then Phab *still* didn't pick up the important part... Okay, I'll try pasting it here.

[PATCH] D45177: CStringChecker, check strlcpy/strlcat

2018-04-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Whoops - this isn't quite correct because there's one more difference between strlcpy/strlcat and the standard strcpy/strcat/strncpy/strncat: the return value. After this patch the new functions are modeled as if they return a pointer into the string, which is incorrect and

r331238 - [ShadowCallStack] fix the docs

2018-04-30 Thread Kostya Serebryany via cfe-commits
Author: kcc Date: Mon Apr 30 17:15:56 2018 New Revision: 331238 URL: http://llvm.org/viewvc/llvm-project?rev=331238&view=rev Log: [ShadowCallStack] fix the docs Modified: cfe/trunk/docs/ShadowCallStack.rst Modified: cfe/trunk/docs/ShadowCallStack.rst URL: http://llvm.org/viewvc/llvm-project

[PATCH] D45291: [Driver] Infer Android sysroot location.

2018-04-30 Thread Stephen Hines via Phabricator via cfe-commits
srhines accepted this revision. srhines added a comment. This revision is now accepted and ready to land. Thanks for adding this simplified support. Sorry about the extreme delay in getting these reviewed. Repository: rC Clang https://reviews.llvm.org/D45291 __

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/google/IntegerTypesCheck.cpp:66 + Finder->addMatcher(typeLoc(loc(isInteger()), + unless(hasAncestor(callExpr( + callee(functionDecl(hasAttr(attr::Format))) -

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG with one comment. Thank you for the fix! Comment at: test/clang-tidy/google-runtime-int.cpp:77 +__attribute__((__format__ (__printf__, 1, 2))) +void myprintf(const char* s

r331233 - [Modules] Fix testcases from r331232

2018-04-30 Thread Bruno Cardoso Lopes via cfe-commits
Author: bruno Date: Mon Apr 30 15:57:02 2018 New Revision: 331233 URL: http://llvm.org/viewvc/llvm-project?rev=331233&view=rev Log: [Modules] Fix testcases from r331232 Modified: cfe/trunk/test/Modules/Inputs/non-ambiguous-enum/A.framework/Modules/module.modulemap cfe/trunk/test/Modules/

r331225 - [docs] Fix docs/InternalsManual.rst heading.

2018-04-30 Thread Fangrui Song via cfe-commits
Author: maskray Date: Mon Apr 30 13:51:50 2018 New Revision: 331225 URL: http://llvm.org/viewvc/llvm-project?rev=331225&view=rev Log: [docs] Fix docs/InternalsManual.rst heading. Modified: cfe/trunk/docs/InternalsManual.rst Modified: cfe/trunk/docs/InternalsManual.rst URL: http://llvm.org/v

[PATCH] D46293: [clang-tidy/google-runtime-int] Allow passing non-bitwidth types to printf()-style APIs

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton created this revision. benhamilton added reviewers: alexfh, bkramer. Herald added subscribers: cfe-commits, klimek. The `google-runtime-int` check currently fires on calls like: printf("%lu", (unsigned long)foo); However, the style guide says: > Where possible, avoid passing argum

[PATCH] D46241: [CodeGen] Recognize more cases of zero initialization

2018-04-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGExprConstant.cpp:1395 +static bool isZeroInitializer(ConstantEmitter &CE, const Expr *Init) { + QualType InitTy = Init->getType().getCanonicalType(); You should have a comment here clarifying that this

[PATCH] D34440: [Clang] Expand response files before loading compilation database

2018-04-30 Thread Chih-Hung Hsieh via Phabricator via cfe-commits
chh added a comment. Herald added a subscriber: llvm-commits. FYI, Android NDK has another use case in https://github.com/android-ndk/ndk/issues/680. It would be nice to have clang-tidy recognize the response file. Repository: rL LLVM https://reviews.llvm.org/D34440 __

[PATCH] D46190: For an ODR declaration, set the 'Used' bit on its associated declarations.

2018-04-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D46190#1082616, @CarlosAlbertoEnciso wrote: > My initial approach was based on the following test case: > > void Bar() { > typedef int I_Ref; > I_Ref var_bar; > } > > void Foo() { > typedef int I_Used; > I_Used var_foo; >

r331232 - [Modules] Handle ObjC/C ODR-like semantics for EnumConstantDecl

2018-04-30 Thread Bruno Cardoso Lopes via cfe-commits
Author: bruno Date: Mon Apr 30 15:14:29 2018 New Revision: 331232 URL: http://llvm.org/viewvc/llvm-project?rev=331232&view=rev Log: [Modules] Handle ObjC/C ODR-like semantics for EnumConstantDecl Support for ObjC/C ODR-like semantics with structural equivalence checking was added back in r306918.

r331231 - [CodeGen] Fix typo in comment form->from. NFC

2018-04-30 Thread Craig Topper via cfe-commits
Author: ctopper Date: Mon Apr 30 15:02:48 2018 New Revision: 331231 URL: http://llvm.org/viewvc/llvm-project?rev=331231&view=rev Log: [CodeGen] Fix typo in comment form->from. NFC Modified: cfe/trunk/lib/CodeGen/CGCall.cpp Modified: cfe/trunk/lib/CodeGen/CGCall.cpp URL: http://llvm.org/view

[PATCH] D46052: GNUstep Objective-C ABI version 2

2018-04-30 Thread Dustin L. Howett via Phabricator via cfe-commits
DHowett-MSFT added inline comments. Comment at: lib/CodeGen/CGObjCGNU.cpp:439 + ArrayRef IvarOffsets, + ArrayRef IvarAlign, + ArrayRef IvarOwnership); While we're here, is there v

[PATCH] D45444: [clang-tidy] WIP: implement new check for const-correctness

2018-04-30 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added a comment. > Why do you think that looping is required? From my understanding, we > need the first usage (DeclRefExpr) to get the analysis started. The > analysis itself will check all remaining uses. Is this necessary, > because we analysis on a `Expr` basis? Yes. the analyzer

[PATCH] D46165: [Modules] Handle ObjC/C ODR-like semantics for EnumConstantDecl

2018-04-30 Thread Bruno Cardoso Lopes via Phabricator via cfe-commits
bruno marked an inline comment as done. bruno added inline comments. Comment at: lib/Serialization/ASTReaderDecl.cpp:2568-2570 // ODR-based merging is only performed in C++. In C, identically-named things // in different translation units are not redeclarations (but may sti

[PATCH] D46024: [clang-format] Add SpaceBeforeCpp11BracedList option.

2018-04-30 Thread Ross Kirsling via Phabricator via cfe-commits
rkirsling added a comment. Rule has been published: https://webkit.org/code-style-guidelines/#spacing-braced-init Hopefully that suffices for motivation. :) Repository: rC Clang https://reviews.llvm.org/D46024 ___ cfe-commits mailing list cfe-co

[PATCH] D46022: [OpenCL] Restrict various keywords in OpenCL C++ mode

2018-04-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + svenvh wrote: > rjmccall wrote: > > svenvh wrote: > > > rjmccall wrote: > > > > svenvh wrote: > > > > > rjmccall wrote: > > > > > > You might consider parsi

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Oh, I see, it's not that the lifetime intrinsics don't handle pointers in the alloca address space, it's that we might have already promoted them into `DefaultAS`. Do the LLVM uses of lifetime intrinsics actually look through these address space casts? I'm wondering

[PATCH] D46287: [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets

2018-04-30 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: zturner, rnk, smeenai. Herald added subscribers: JDevlieghere, aprantl. -dwarf-column-info is omitted if -gcodeview is specified for msvc targets at the moment, but since -gcodeview is an option that can be specified for any target, there

[PATCH] D46286: [Driver] Don't warn about unused inputs in config files

2018-04-30 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: sepavloff, hans, rnk, hfinkel. This avoids warnings about unused linker parameters, just like other flags are ignored if they're from config files. Repository: rC Clang https://reviews.llvm.org/D46286 Files: lib/Driver/Driver.cpp

[PATCH] D46218: PR37275 packed attribute should not apply to base classes

2018-04-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D46218#1082834, @probinson wrote: > In https://reviews.llvm.org/D46218#1081933, @rjmccall wrote: > > > I wonder if that was originally just an oversight that got turned into > > official policy. Anyway, if it's the policy, it's what we have to

[PATCH] D45444: [clang-tidy] WIP: implement new check for const-correctness

2018-04-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 144617. JonasToth added a comment. - fix bad template instantiation Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45444 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/ConstCheck.cpp clang-tidy/cppco

[PATCH] D45679: [clang-tidy] Add a helper function isModified, that checks whether an expression is modified within a statement.

2018-04-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I migrated to the new `Decl` interface and adjusted my tests, there are no false positives left and I am not aware of more possible code constellation that would require testing. If you have time you could check my tests, maybe you find something I missed. Otherwise t

[PATCH] D46281: [clang-doc] Attaching a name to reference data

2018-04-30 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett updated this revision to Diff 144615. juliehockett marked 3 inline comments as done. juliehockett added a comment. Addressing comments https://reviews.llvm.org/D46281 Files: clang-doc/BitcodeWriter.cpp clang-doc/BitcodeWriter.h clang-doc/Representation.h clang-doc/Serialize

[PATCH] D45444: [clang-tidy] WIP: implement new check for const-correctness

2018-04-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 144616. JonasToth added a comment. - migrate to Decl interface - add template metaprogramming test Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45444 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/Co

r331218 - [MC] Change AsmParser to leverage Assembler during evaluation

2018-04-30 Thread Nirav Dave via cfe-commits
Author: niravd Date: Mon Apr 30 12:22:40 2018 New Revision: 331218 URL: http://llvm.org/viewvc/llvm-project?rev=331218&view=rev Log: [MC] Change AsmParser to leverage Assembler during evaluation Teach AsmParser to check with Assembler for when evaluating constant expressions. This improves the h

[PATCH] D45164: [MC] Change AsmParser to leverage Assembler during evaluation

2018-04-30 Thread Nirav Dave via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331218: [MC] Change AsmParser to leverage Assembler during evaluation (authored by niravd, committed by ). Herald added a subscriber: cfe-commits. Changed prior to commit: https://reviews.llvm.org/D4516

[PATCH] D46281: [clang-doc] Attaching a name to reference data

2018-04-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-doc/BitcodeWriter.cpp:275 +static SymbolID SID; void ClangDocBitcodeWriter::emitRecord(const SymbolID &Sym, RecordId ID) { 1. I'm not seeing where this is being changed? 2. This looks like some abstraction is

r331216 - AMDGPU: Add Vega12 and Vega20

2018-04-30 Thread Matt Arsenault via cfe-commits
Author: arsenm Date: Mon Apr 30 12:08:27 2018 New Revision: 331216 URL: http://llvm.org/viewvc/llvm-project?rev=331216&view=rev Log: AMDGPU: Add Vega12 and Vega20 Changes by Matt Arsenault Konstantin Zhuravlyov Added: cfe/trunk/test/CodeGenOpenCL/amdgpu-features.cl cfe/trunk/test/Cod

[PATCH] D46281: [clang-doc] Attaching a name to reference data

2018-04-30 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett created this revision. juliehockett added reviewers: sammccall, jakehehrlich, lebedev.ri. juliehockett added a project: clang-tools-extra. This adds the name of the referenced decl, in addition to its USR, to the saved data, so that the backend can look at an info in isolation and st

r331214 - clang-cl: Expose -fmerge-all-constants

2018-04-30 Thread Hans Wennborg via cfe-commits
Author: hans Date: Mon Apr 30 12:04:04 2018 New Revision: 331214 URL: http://llvm.org/viewvc/llvm-project?rev=331214&view=rev Log: clang-cl: Expose -fmerge-all-constants Now that constant merging is off by default, we'd like a way to enable it on Windows. Modified: cfe/trunk/include/clang/Dr

[PATCH] D45931: [ASTMatchers] Don't garble the profiling output when multiple TU's are processed

2018-04-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for looking at this. In https://reviews.llvm.org/D45931#1083184, @alexfh wrote: > From a user's perspective I'd probably prefer a different behavior of checks > profiling with multiple translation units: per-file table after each file and > an aggregate ta

[PATCH] D45292: [Driver] Obey computed sysroot when finding libc++ headers.

2018-04-30 Thread Dan Albert via Phabricator via cfe-commits
danalbert added a comment. Ping. Repository: rC Clang https://reviews.llvm.org/D45292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45291: [Driver] Infer Android sysroot location.

2018-04-30 Thread Dan Albert via Phabricator via cfe-commits
danalbert added a comment. Ping. Repository: rC Clang https://reviews.llvm.org/D45291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45931: [ASTMatchers] Don't garble the profiling output when multiple TU's are processed

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. From a user's perspective I'd probably prefer a different behavior of checks profiling with multiple translation units: per-file table after each file and an aggregate table at the end. An independent improvement could be to support TSV/CSV output and/or dumping to a fil

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D45927#1083051, @zinovy.nis wrote: > > I think, it's 13, if you choose to remove stars, and 17 otherwise. The > > difference is excessive spaces vs. required ones. Implementing proper logic > > may be involved, but we can simplify it to someth

r331211 - [OPENMP] Do not emit warning about non-declared target function params.

2018-04-30 Thread Alexey Bataev via cfe-commits
Author: abataev Date: Mon Apr 30 11:28:08 2018 New Revision: 331211 URL: http://llvm.org/viewvc/llvm-project?rev=331211&view=rev Log: [OPENMP] Do not emit warning about non-declared target function params. We should not emit warning that the parameters are not marked as declare target, these decl

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144600. yaxunl added a comment. Call Builder.CreateLifetimeStart/End. I cannot replace CodeGenFunction::EmitLifetimeStart with Builder.CreateLifetimeStart since we still need to check ShouldEmitLifetimeMarkers and do the address space cast. https://reviews

[PATCH] D46236: [Driver, CodeGen] rename options to disable an FP cast optimization

2018-04-30 Thread Sanjay Patel via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331209: [Driver, CodeGen] rename options to disable an FP cast optimization (authored by spatel, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.or

[PATCH] D46236: [Driver, CodeGen] rename options to disable an FP cast optimization

2018-04-30 Thread Sanjay Patel via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331209: [Driver, CodeGen] rename options to disable an FP cast optimization (authored by spatel, committed by ). Repository: rL LLVM https://reviews.llvm.org/D46236 Files: docs/ReleaseNotes.rst do

r331209 - [Driver, CodeGen] rename options to disable an FP cast optimization

2018-04-30 Thread Sanjay Patel via cfe-commits
Author: spatel Date: Mon Apr 30 11:19:03 2018 New Revision: 331209 URL: http://llvm.org/viewvc/llvm-project?rev=331209&view=rev Log: [Driver, CodeGen] rename options to disable an FP cast optimization As suggested in the post-commit thread for rL331056, we should match these clang options with t

[PATCH] D46233: [ASTMatchers] Overload isConstexpr for ifStmts

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/LibASTMatchersReference.html:179 -MatcherDecl>cxxMethodDeclMatcherCXXMethodDecl>... +Matcher

r331207 - Regenerated AST Matchers doc.

2018-04-30 Thread Alexander Kornienko via cfe-commits
Author: alexfh Date: Mon Apr 30 11:12:15 2018 New Revision: 331207 URL: http://llvm.org/viewvc/llvm-project?rev=331207&view=rev Log: Regenerated AST Matchers doc. Backported a minor fix to the comment in the header. Modified: cfe/trunk/docs/LibASTMatchersReference.html cfe/trunk/include/

r331206 - [OPENMP] Do not crash on codegen for CXX member functions.

2018-04-30 Thread Alexey Bataev via cfe-commits
Author: abataev Date: Mon Apr 30 11:09:40 2018 New Revision: 331206 URL: http://llvm.org/viewvc/llvm-project?rev=331206&view=rev Log: [OPENMP] Do not crash on codegen for CXX member functions. Non-static member functions should not be emitted as a standalone functions, this leads to compiler cras

[PATCH] D43322: Diagnose cases of "return x" that should be "return std::move(x)" for efficiency

2018-04-30 Thread Arthur O'Dwyer via Phabricator via cfe-commits
arthur.j.odwyer added a comment. Sorry, I responded via email but I guess Phabricator didn't pick it up for some reason. See below. Repository: rC Clang https://reviews.llvm.org/D43322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http:

[PATCH] D46233: [ASTMatchers] Overload isConstexpr for ifStmts

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: docs/LibASTMatchersReference.html:179 -MatcherDecl>cxxMethodDeclMatcher

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. > I think, it's 13, if you choose to remove stars, and 17 otherwise. The > difference is excessive spaces vs. required ones. Implementing proper logic > may be involved, but we can simplify it to something like "count all > non-space characters and a single space bet

[PATCH] D44788: Add an option to support debug fission on implicit ThinLTO.

2018-04-30 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: lib/Driver/ToolChains/CommonArgs.cpp:423 +Args.MakeArgString(Twine("-plugin-opt=objcopy=") + Objcopy)); +StringRef DWO_Dir = A->getValue(); +CmdArgs.push_back( Can we default this to a path alongside the outp

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1074400, @rjmccall wrote: > These functions must predate the addition of CreateLifetimeStart and > CreateLifetimeEnd methods on IRBuilder; we should just be calling those. Sorry. I think I misunderstood your comments. I will revise aga

[PATCH] D46022: [OpenCL] Restrict various keywords in OpenCL C++ mode

2018-04-30 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: lib/Parse/ParseStmtAsm.cpp:696 +return StmtError(); + } + rjmccall wrote: > svenvh wrote: > > rjmccall wrote: > > > svenvh wrote: > > > > rjmccall wrote: > > > > > You might consider parsing the statement normally an

[PATCH] D46022: [OpenCL] Restrict various keywords in OpenCL C++ mode

2018-04-30 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 144583. svenvh added a comment. Moved thread storage class specifier diagnosing to `ActOnVariableDeclarator`. https://reviews.llvm.org/D46022 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticParseKinds.td include/clang/

[PATCH] D44788: Add an option to support debug fission on implicit ThinLTO.

2018-04-30 Thread Yunlian Jiang via Phabricator via cfe-commits
yunlian added a comment. ping? https://reviews.llvm.org/D44788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144574. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D45900 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h test/CodeGenCXX/amdgcn_declspec_get.cpp Index: test/CodeGenCXX/amdgcn_decl

r331195 - [OPENMP] Do not crash on incorrect input data.

2018-04-30 Thread Alexey Bataev via cfe-commits
Author: abataev Date: Mon Apr 30 09:26:57 2018 New Revision: 331195 URL: http://llvm.org/viewvc/llvm-project?rev=331195&view=rev Log: [OPENMP] Do not crash on incorrect input data. Emit error messages instead of compiler crashing when the target region does not exist in the device code + fix cras

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length >

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Actually, just ignoring spaces may be not the best option. In https://reviews.llvm.org/D45927#1074593, @zinovy.nis wrote: > > I think spaces that will be removed should be counted - long long is 9. > > I thought about it, but what about "long long int >

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length >

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:33 + +bool IsNotSpace(const char& C) { + return !std::isspace(static_cast(C)); alexfh wrote: > Why `const char&` and not just `char`? Moreover, these two functions can be > repl

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE331189: [clangd] Using index for GoToDefinition. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D45717?vs=144561&id=144566#toc Repository: rCTE Clang Tools E

[clang-tools-extra] r331189 - [clangd] Using index for GoToDefinition.

2018-04-30 Thread Haojian Wu via cfe-commits
Author: hokein Date: Mon Apr 30 08:24:17 2018 New Revision: 331189 URL: http://llvm.org/viewvc/llvm-project?rev=331189&view=rev Log: [clangd] Using index for GoToDefinition. Summary: This patch adds index support for GoToDefinition -- when we don't get the definition from local AST, we query our

[PATCH] D46218: PR37275 packed attribute should not apply to base classes

2018-04-30 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment. In https://reviews.llvm.org/D46218#1081933, @rjmccall wrote: > I wonder if that was originally just an oversight that got turned into > official policy. Anyway, if it's the policy, it's what we have to do; LGTM. I think it's actually correct behavior. Why would an

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:33 + +bool IsNotSpace(const char& C) { + return !std::isspace(static_cast(C)); Why `const ch

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the review! Comment at: clangd/XRefs.cpp:277 +// it. +auto ToLSPLocation = [&HintPath]( +const SymbolLocation &Loc) -> llvm::Optional { sammccall wrote: > hokein

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 144561. hokein marked 7 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45717 Files: clangd/ClangdServer.cpp clangd/XRefs.cpp clangd/XRefs.h clangd/index/FileIn

r331177 - IWYU for llvm-config.h in clang. See r331124 for details.

2018-04-30 Thread Nico Weber via cfe-commits
Author: nico Date: Mon Apr 30 06:52:15 2018 New Revision: 331177 URL: http://llvm.org/viewvc/llvm-project?rev=331177&view=rev Log: IWYU for llvm-config.h in clang. See r331124 for details. Modified: cfe/trunk/lib/Driver/Driver.cpp cfe/trunk/lib/Driver/ToolChains/Clang.cpp cfe/trunk/li

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. A few more nits (and some ideas for further restructuring the merge logic). Otherwise LG, let's land this! Comment at: clangd/XRefs.cpp:215 - indexTopLevelDecls(AST.

r331176 - Remove unnecessary indirection. No behavior change.

2018-04-30 Thread Nico Weber via cfe-commits
Author: nico Date: Mon Apr 30 06:47:04 2018 New Revision: 331176 URL: http://llvm.org/viewvc/llvm-project?rev=331176&view=rev Log: Remove unnecessary indirection. No behavior change. Modified: cfe/trunk/lib/Driver/ToolChains/MSVC.cpp Modified: cfe/trunk/lib/Driver/ToolChains/MSVC.cpp URL: h

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Gentle ping. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46236: [Driver, CodeGen] rename options to disable an FP cast optimization

2018-04-30 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 144551. spatel added a comment. Patch updated: Added "By default" to the description in the user manual and release notes to make it clearer how this behaves. https://reviews.llvm.org/D46236 Files: docs/ReleaseNotes.rst docs/UsersManual.rst include/cl

r331152 - Rename DiagnosticClient to DiagnosticConsumer as per issue 5397.

2018-04-30 Thread Fangrui Song via cfe-commits
Author: maskray Date: Sun Apr 29 17:34:09 2018 New Revision: 331152 URL: http://llvm.org/viewvc/llvm-project?rev=331152&view=rev Log: Rename DiagnosticClient to DiagnosticConsumer as per issue 5397. Modified: cfe/trunk/docs/InternalsManual.rst cfe/trunk/include/clang/StaticAnalyzer/Core/P

[PATCH] D46258: [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331168: [clangd] Also use UTF-16 in index position. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D46258 Files: clang-too

[clang-tools-extra] r331168 - [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Haojian Wu via cfe-commits
Author: hokein Date: Mon Apr 30 04:40:02 2018 New Revision: 331168 URL: http://llvm.org/viewvc/llvm-project?rev=331168&view=rev Log: [clangd] Also use UTF-16 in index position. Reviewers: sammccall Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision:

[PATCH] D46258: [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 144540. hokein added a comment. Add a test. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46258 Files: clangd/index/SymbolCollector.cpp unittests/clangd/SymbolCollectorTests.cpp Index: unittests/clangd/SymbolCollectorTests.cpp ===

[PATCH] D46190: For an ODR declaration, set the 'Used' bit on its associated declarations.

2018-04-30 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. My initial approach was based on the following test case: void Bar() { typedef int I_Ref; I_Ref var_bar; } void Foo() { typedef int I_Used; I_Used var_foo; var_foo = 2; } void Test() { Foo(); } and the generated AST l

[PATCH] D44684: [mips] Improve handling of -fno-[pic/PIC] option

2018-04-30 Thread Simon Dardis via Phabricator via cfe-commits
sdardis accepted this revision. sdardis added a comment. This revision is now accepted and ready to land. LGTM, with a touch up of the error message to match the others we have regarding -mabicalls. Some other minor nits inlined. Comment at: include/clang/Basic/DiagnosticDrive

[PATCH] D46258: [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. (oops, meant to accept this - please do add a test if you can) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46258 ___ cf

[PATCH] D46258: [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Oops, I missed this, thanks! Possible to add a testcase? Any character that's not ASCII and is legal in an identifier should do it. http://en.cppreference.com/w/cpp/language/identifiers Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46258 _

[PATCH] D46258: [clangd] Also use UTF-16 in index position.

2018-04-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: jkorous, MaskRay, ioeric, ilya-biryukov, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46258 Files: clangd/index/SymbolCollector.cpp Index: clangd/index/SymbolCollector.cpp ==

[PATCH] D46176: Pull helper class Environment from clangFormat into libToolingCore [NFC]

2018-04-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 144524. ioeric added a comment. - Revert last revision. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Tooling/Core/Environment.h lib/Format/Format.cpp lib/Format/SortJavaScriptImports.cpp lib/Format/TokenAnalyzer.cpp

[PATCH] D46190: For an ODR declaration, set the 'Used' bit on its associated declarations.

2018-04-30 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. In https://reviews.llvm.org/D46190#1081836, @rsmith wrote: > In https://reviews.llvm.org/D46190#1081773, @rsmith wrote: > > > No, absolutely not. This would be insanely expensive, and marks entirely > > unrelated things "used". > > > My apologies, reading thi

r331164 - [Targets] Implement getConstraintRegister for ARM and AArch64

2018-04-30 Thread Mikhail Maltsev via cfe-commits
Author: miyuki Date: Mon Apr 30 02:11:08 2018 New Revision: 331164 URL: http://llvm.org/viewvc/llvm-project?rev=331164&view=rev Log: [Targets] Implement getConstraintRegister for ARM and AArch64 Summary: The getConstraintRegister method is used by semantic checking of inline assembly statements i

[PATCH] D45965: [Targets] Implement getConstraintRegister for ARM and AArch64

2018-04-30 Thread Mikhail Maltsev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331164: [Targets] Implement getConstraintRegister for ARM and AArch64 (authored by miyuki, committed by ). Repository: rC Clang https://reviews.llvm.org/D45965 Files: include/clang/Basic/TargetInfo.

[PATCH] D45444: [clang-tidy] WIP: implement new check for const-correctness

2018-04-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I will migrate to the new API today evening (european time). Why do you think that looping is required? From my understanding, we need the first usage (DeclRefExpr) to get the analysis started. The analysis itself will check all remaining uses. Is this necessary, becaus

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/trunk/clangd/SourceCode.cpp:38 +// 0xxx is ASCII, handled above. 10xxx is a trailing byte, invalid here. +// 1xxx is not valid UTF-8 at all. Assert because it's probably our bug. +assert((UTF8Length >

[PATCH] D45814: Fix an assertion when -print-prog-name=

2018-04-30 Thread Christian Bruel via Phabricator via cfe-commits
chrib added a comment. In https://reviews.llvm.org/D45814#1081203, @compnerd wrote: > Do you have commit access or do you need someone to commit this on your > behalf? can you commit it for me please ? thanks. Repository: rC Clang https://reviews.llvm.org/D45814 ___