[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: hokein. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp test/clang-tidy/cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170605. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp test/clang-tid

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:58 + const QualType Rhs) { + assert(Lhs->isRealType()); // Either integer or floating point. + assert(Rhs->isFloatingType()); // Floating point only

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170846. gchatelet added a comment. - Update documentation, makes returning code path more explicit. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppc

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:58 + const QualType Rhs) { + assert(Lhs->isRealType()); // Either integer or floating point. + assert(Rhs->isFloatingType()); // Floating point only

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170851. gchatelet added a comment. - Add documentation to ReleaseNotes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppcoreguidelines/NarrowingConver

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1273986, @JonasToth wrote: > Please add a short notice in the release notes for this change. Sorry I keep on missing to update doc/release notes. Do you see anything else to add to the Patch? Repository: rCTE Clang Tools Extra h

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170878. gchatelet marked an inline comment as done. gchatelet added a comment. - Join the two parts of the ReleaseNotes update Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversions

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added a comment. In https://reviews.llvm.org/D53488#1274205, @JonasToth wrote: > Did you run this code over a real-world code-base and did you find new stuff > and/or false positives or the like? Yes I did run it over our code base. I didn'

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1275786, @hokein wrote: > In https://reviews.llvm.org/D53488#1275750, @gchatelet wrote: > > > In https://reviews.llvm.org/D53488#1274205, @JonasToth wrote: > > > > > Did you run this code over a real-world code-base and did you find ne

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171692. gchatelet added a comment. - Add more checks, disable bool implicit casts warning, enable ternary operator warnings. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsC

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. So I've updated the code to add more narrowing conversions. It now tests constant expressions against receiving type, do not warn about implicit bool casting, handles ternary operator with constant expressions. I ran it on our code base: results look legit. I'll ping b

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. So I ran `llvm/tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py` The bare version produces `65664` unique findings. The version restricted to `cppcoreguidelines-narrowing-conversions` produces `4323` unique findings. That's about `+7%` of findings. I can post s

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171717. gchatelet marked 4 inline comments as done. gchatelet added a comment. - Remove leftover Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppcore

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Here are 15 random ones from **llvm** synced at `8f9fb8bab2e9b5b27fe40d700d2abe967b99fbb5`. lib/Target/ARM/AsmParser/ARMAsmParser.cpp:3802:31: warning: narrowing conversion from 'int' to 'unsigned int' [cppcoreguidelines-narrowing-conversions] tools/dsymutil/Mach

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171826. gchatelet marked 12 inline comments as done. gchatelet added a comment. - Address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppco

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:42 + unless(hasParent(castExpr())), + unless(isInTemplateInstantiation())) + .b

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-05 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 8 inline comments as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:164 + while (i) { +// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'int' to 'bool' [cppcoreguidelines-

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-06 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 172778. gchatelet marked 7 inline comments as done. gchatelet added a comment. - Addressing comments and enhancing diagnostics Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversions

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:178 + return; +// Conversions to unsigned integer are well defined and follow modulo 2 +// arithmetic. JonasToth wrote: > I am surprised by `follo

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 172904. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-08 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Is this good enough to go? @JonasToth Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173343. gchatelet marked 13 inline comments as done. gchatelet added a comment. - Addressing comments, adding Option to disable FP to FP narrowing warnings, handling FP literals. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173633. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Address comments + fix hex values display Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsChec

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:178 + return; +// Conversions to unsigned integer are well defined and follow modulo 2 +// arithmetic. JonasToth wrote: > gchatelet wrote: > > Jon

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173836. gchatelet marked 6 inline comments as done. gchatelet added a comment. - Address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppcor

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:299 + Rhs->isCXX11ConstantExpr(Context, &Constant)) { +if (Constant.isFloat()) + diagIfNarrowFloatingPointConstant(Context, SourceLoc, Lhs, Rhs, Constant); -

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173844. gchatelet added a comment. - Remove debugging leftover Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cppcoreguidelines/NarrowingConversionsChe

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1296940, @JonasToth wrote: > So, finally LGTM :) > Please give @aaron.ballman a chance to comment, as he reviewed too. > > Thanks for your patch! Thank you for bearing with me. Waiting for input from @aaron.ballman Repository: r

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Thx for the review. I have two suggestions in the comments let me know what you think. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:79-81 + // TODO: Provide an automatic fix if the number is exactly representable in the d

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 174044. gchatelet marked 7 inline comments as done. gchatelet added a comment. - State char signess clearly Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-t

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 174374. gchatelet marked 13 inline comments as done. gchatelet added a comment. - Addressed comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp clang-tidy/cpp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:79-81 + // TODO: Provide an automatic fix if the number is exactly representable in the destination type. + f += 2.0; + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowi

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175030. gchatelet marked an inline comment as done. gchatelet added a comment. - Refactored the code to make it simpler, added more tests Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/Narrowing

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:42-44 i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-n

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175033. gchatelet marked an inline comment as done. gchatelet added a comment. - Reverting the WarnOnFloatingPointNarrowingConversion option to be on by default Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cpp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175139. gchatelet added a comment. - Added a new option warn about wrong type literals Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguide

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:42-44 i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-n

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175203. gchatelet marked 16 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files: clang-ti

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Thank you for bearing with me @aaron.ballman. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:259-263 +void NarrowingConversionsCheck::handleIntegralToBoolean( +const ASTContext &Context, SourceLocation SourceLoc, const Exp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175204. gchatelet added a comment. - Fixing documentation. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsC

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175231. gchatelet marked 4 inline comments as done. gchatelet added a comment. - Removed redundant options in regression tests Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D53488#1307834 , @aaron.ballman wrote: > LGTM! Thx ! \O/ Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 _

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL347570: [clang-tidy] Improving narrowing conversions (authored by gchatelet, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D60719: Fixing freestanding for memcpy.

2019-04-15 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D60719 Files: clang/lib/CodeGen/CodeGenModule.cpp llvm/lib/

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 195369. gchatelet added a comment. Add test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60719/new/ https://reviews.llvm.org/D60719 Files: clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGen/freesta

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-17 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D60719#1469958 , @t.p.northover wrote: > I think it'd be pretty unpopular with the people I know who use freestanding. > They're mostly working on microcontrollers and compiling -Oz so the extra > code size would be untenab

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-18 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D60719#1470632 , @t.p.northover wrote: > > IIUC freestanding environment should not rely on memcpy being present so my > > take on it was that by "fixing" freestanding I could have my cake and eat > > it too. > > The formal

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, mgrang, hiraditya. Herald added projects: clang, LLVM. POC for the rfc http://lists.llvm.org/pipermail/llvm-dev/2019-April/131973.html Repository: rG LLVM Github Monorepo

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 198436. gchatelet added a comment. Herald added a subscriber: jdoerfert. - Add documentation. - Fix permissive HasNoRuntimeAttribute Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61634/new/ https://reviews.ll

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1493350 , @theraven wrote: > I wonder if a list of comma-separated names is the right approach. Would it > make more sense to add a new attribute for each of the helpers, such as > `#no-runtime-for-memcpy`? That shou

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-06-06 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 203386. gchatelet added a comment. - Add documentation. - Fix permissive HasNoRuntimeAttribute - Mark interleave as disabled in the documentation. - Use no-builtin instead of no-runtime-for. - Adding an llvm.memcpy.inline intrinsic. - Adding __builtin_memcpy

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-07-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1586047 , @tejohnson wrote: > Checking in to see where we are on this issue. I haven't had any time to work > on 4 but hopefully can start on that soon. But it needs the first part done > to be effective. Thx for th

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1493927 , @efriedma wrote: > I would be careful about trying to over-generalize here. There are a few > different related bits of functionality which seem to be interesting, given > the discussion in the llvm-dev thr

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1494518 , @alexandre.isoard wrote: > I'm not convinced by the approach. > > Can it still recognize the loop idiom into memcpy implementation but use > `memmove` (as only `memcpy` has been blacklisted)? Yes it can an

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1498376 , @efriedma wrote: > I still think there are really two things you're trying to accomplish here, > which should be handled separately. > > 1. Add a function attribute that works like -fno-builtin-memcpy current

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a subscriber: tejohnson. gchatelet added a comment. In D61634#1500453 , @efriedma wrote: > My main blocker is that I want to make sure we're moving in the right > direction: towards LLVM IR with clear semantics, towards straightforward >

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-15 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1502201 , @tejohnson wrote: > Using function level attributes instead of module flags does provide finer > grained control and avoids the conservativeness when merging IR for LTO. The > downsides I see, mostly just in

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. AFAIU here is a coarse plan of what needs to happen 1. Add a `no-builtin` clang function attribute that has the same semantic as the `no-builtin` cmd line argument 2. Propagate it to

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 200998. gchatelet added a comment. - Use no-builtin instead of no-runtime-for. - Use one attribute per runtime function to make merging easier. The patch is still WIP and needs more work. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, seiya, jsji, atanasyan, MaskRay, jrtc27, jakehehrlich, kbarton, hiraditya, nemanjai, sdardis. Herald added a reviewer: JDevlieghere. Herald added a reviewer: alexshap. Herald

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 219923. gchatelet marked an inline comment as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67499/new/ https://reviews.llvm.org/D67499 Files: clang/lib/A

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371742: [Alignment] Move OffsetToAlignment to Alignment.h (authored by gchatelet, committed by ). Herald added a subscriber: kristina. Changed prior to commit: https://reviews.llvm.org/D67499?vs=219923&

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert. Herald added subscribers: cfe-commits, mgrang. Herald added a project: clang. This is a follow up on https://reviews.llvm.org/D61634 This patch is simpler and only adds the no_built

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-09-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1679331 , @tejohnson wrote: > In D61634#1635595 , @tejohnson wrote: > > > I had some time to work on this finally late last week. I decided the most > > straightforward thing wa

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 221924. gchatelet marked 11 inline comments as done. gchatelet added a comment. - Address aaron ballman comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. @aaron.ballman thx a lot for the review. I really appreciate it, especially because I'm not too familiar with this part of the codebase. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1092 + // Wildcard is a super set of all builtins, we keep only this

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 221939. gchatelet added a comment. - Checks function name validity and errors when passed 0 argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/i

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. @tejohnson I believe this is the missing part for D67923 . I'm unsure if we still need the `BitVector` at all in the `TLI` since it could be a simple attribute lookup on the function. Do you see any problematic interactions with the i

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222163. gchatelet added a comment. - Update documentation and rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/include/clang/Basic/Attr.td clan

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya, eraman, nhaehnle, jvesely, arsenm, jholewinski. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this thre

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, asbirlea, hiraditya. Herald added a reviewer: jdoerfert. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this thread

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222372. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68141/new/ https://reviews.llvm.org/D68141 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGC

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222380. gchatelet marked an inline comment as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/ https://reviews.llvm.org/D68142 Files: clang/lib/C

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373195: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned) (authored by gchatelet, committed by ). Changed prior to commit: https://reviews.llvm.org/D68142?vs=222380&id=222381#toc Repository: r

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. This patch broke polly, I'm working on a fix. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/ https://reviews.llvm.org/D68142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D68142#1687693 , @gchatelet wrote: > This patch broke polly, I'm working on a fix. https://reviews.llvm.org/rL373199 Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/ https://reviews.

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222400. gchatelet marked an inline comment as done. gchatelet added a comment. Herald added a reviewer: bollu. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68141/new/ https://reviews.llvm.

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373207: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned) (authored by gchatelet, committed by ). Changed prior to commit: https://reviews.llvm.org/D68141?vs=222400&id=222409#toc Repository:

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp:65 -static constexpr unsigned kTagGranuleSize = 16; +static const Align kTagGranuleSize = Align(16); arichardson wro

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 7 inline comments as done. gchatelet added a comment. thx @aaron.ballman , I'm waiting for your reply before uploading the new patch (some of my comments won't have the accompanying code update sorry) Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1072 +NoBuiltin

[PATCH] D68268: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added a reviewer: bollu. Herald added subscribers: llvm-commits, cfe-commits, asbirlea, hiraditya. Herald added a reviewer: jdoerfert. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an

[PATCH] D68274: [Alignment][Clang][NFC] Add CharUnits::getAsAlign

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: cfe-commits, jholewinski. Herald added a project: clang. This is a prerequisite to removing `llvm::GlobalObject::setAlignment(unsigned)`. This is patch is part of a series to introduce an Alignment type

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-10-02 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp:65 -static constexpr unsigned kTagGranuleSize = 16; +static const Align kTagGranuleSize = Align(16); arichardson wro

[PATCH] D68379: FunctionDecl::isThisDeclarationADefinition is useless in ProcessDeclAttribute

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is for illustration purposes and not to be submitted Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68379 Files: clang/lib/Sema/SemaDeclAttr.cpp Index: clang/lib/Se

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 3 inline comments as done. gchatelet added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1098-1099 + + if (D->hasAttr()) +D->dropAttr(); + gchatelet wrote: > aaron.ballman wrote: > > Just making sure I understand the semantics

[PATCH] D68268: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222991. gchatelet marked 6 inline comments as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68268/new/ https://reviews.llvm.org/D68268 Files: clang/lib/C

[PATCH] D68268: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4027 - ST->setAlignment(Alignment); + ST->setAlignment(Align(Alignment)); Value *V = propagateMetadata(ST, E->Scalars); courbet wrote: > I don't think

[PATCH] D68274: [Alignment][Clang][NFC] Add CharUnits::getAsAlign

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 5 inline comments as done. gchatelet added inline comments. Comment at: clang/lib/CodeGen/CGObjCMac.cpp:6323 GV->setSection("__DATA, __objc_data"); - GV->setAlignment( - CGM.getDataLayout().getABITypeAlignment(ObjCTypes.ClassnfABITy)); + GV->setAlignm

[PATCH] D68274: [Alignment][Clang][NFC] Add CharUnits::getAsAlign

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222994. gchatelet marked an inline comment as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68274/new/ https://reviews.llvm.org/D68274 Files: clang/inclu

[PATCH] D68274: [Alignment][Clang][NFC] Add CharUnits::getAsAlign

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373592: [Alignment][Clang][NFC] Add CharUnits::getAsAlign (authored by gchatelet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://

[PATCH] D68268: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

2019-10-03 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373595: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned) (authored by gchatelet, committed by ). Changed prior to commit: https://reviews.llvm.org/D68268?vs=222991&id=223000#toc Repository:

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-08 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1098-1099 + + if (D->hasAttr()) +D->dropAttr(); + aaron.ballman wrote: > gchatelet wrote: > > gchatelet wrote: > > > aaron.ballman wrote:

[PATCH] D68701: Adds a isDefinitionKind to FunctionDecl

2019-10-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Tentatively fixing the bug described in https://reviews.llvm.org/D68028#inline-614831. This is not a good solution though since `isThisDeclarationADefinition` still doesn't work as expected.

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1098-1099 + + if (D->hasAttr()) +D->dropAttr(); + gchatelet wrote: > aaron.ballman wrote: > > gchatelet wrote: > > > gchatelet wrote: > >

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 224082. gchatelet added a comment. - Address aaron ballman comments - Checks function name validity and errors when passed 0 argument. - Update documentation and rebase - Rewrote mergeNoBuiltinAttr - Address comments Repository: rG LLVM Github Monorepo

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 224085. gchatelet added a comment. - Remove leftovers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/include/clang/Basic/Attr.td clang/include/clang

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 224271. gchatelet added a comment. - rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/Att

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. It should be ready to submit, @aaron.ballman @courbet can you take a final look? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 ___

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 224285. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/inclu

  1   2   3   >