[PATCH] D72829: Implement -fsemantic-interposition

2020-01-29 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 241152. serge-sans-paille added a comment. Update user-level documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 241055. serge-sans-paille added a comment. @arichardson doc updated, any other advice? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. > I suppose you mean whether "SemanticInterposition" should be invalidated when > "PIC Level" does not exist or "PIE Level" exists. I am a bit inclined to make > it more flexible/orthogonal in the backend,

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240966. serge-sans-paille marked an inline comment as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files: clang/docs/ClangCommandLineReference.rst

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240844. serge-sans-paille added a comment. Make some tests more portable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/ https://reviews.llvm.org/D68720 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240813. serge-sans-paille added a comment. @MaskRay should we add a verifier step to check that pie/pic/semanticinterposition module flags are consistent, or leave that to clang ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 3 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:488 + if (Context.getLangOpts().SemanticInterposition && + (Context.getLangOpts().PICLevel && !Context.getLangOpts().PIE)) +//

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-27 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 2 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2685 + if (Args.hasArg(OPT_fsemantic_interposition)) +Opts.SemanticInterposition = 1; + MaskRay wrote: > `

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-27 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240486. serge-sans-paille added a comment. Improve & comment examples Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-25 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6d485ff455ea: Improve static checks for sprintf and __builtin___sprintf_chk (authored by serge-sans-paille). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-24 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240187. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files: clang/docs/ClangCommandLineReference.rst clang/include/clang/Basic/LangOptions.def

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-24 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 240110. serge-sans-paille added a comment. Formatting nits + rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239996. serge-sans-paille added a comment. Take into account pie/pic interaction with semantic-interposition More test case Remove premature release note entry Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. > I feel that we are still behind a complete `-fsemantic-interposition`... I > don't know whether we should mention that the option is experimental. So do I. I can mention that in the -help output and in the changelog. Repository: rG LLVM Github Monorepo

[PATCH] D71566: New checks for fortified sprintf

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239920. serge-sans-paille added a comment. clang-format update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239913. serge-sans-paille added a comment. Remove extra new lines. Add more test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239857. serge-sans-paille added a comment. Add Release note and doc. @MaskRay can you confirm current state is ok? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239837. serge-sans-paille added a comment. Formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files: clang/include/clang/Basic/LangOptions.def

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239809. serge-sans-paille added a comment. Take review into account Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239654. serge-sans-paille added a comment. Remove useless assert Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71566#1832394 , @aaron.ballman wrote: > (There are still some minor whitespace nits to resolve as well.) Strange, everything is passed through clang-format-diff :-/ Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. > I tried modifying `GlobalValue::maybeSetDsoLocal`: `setDSOLocal(true)` for > ExternalLinkage. Unfortunately that will break 1337 tests. If not so many > tests need fixing, I wish we can place `getParent() && > getParent()->getSemanticInterposition()` logic

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239598. serge-sans-paille added a comment. - extra test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-21 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. > Linkages which were not interposable before and can be interposable now: > available_externally, linkonce_odr, weak_odr, external, and appending. @MaskRay I understand the motivation behind that sentence, but do we want that change to be non-conditional,

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-21 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239286. serge-sans-paille added a comment. Take into account review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/ https://reviews.llvm.org/D72829 Files:

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-21 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239257. serge-sans-paille added a comment. Update warning category Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/ https://reviews.llvm.org/D68720 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-21 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239242. serge-sans-paille added a comment. More tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 Files:

[PATCH] D71566: New checks for fortified sprintf

2020-01-20 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239197. serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. Finer grain lower bound computations, and simpler control-flow for the checking function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-20 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 239166. serge-sans-paille added a comment. - Harmonize esp/rsp usage as hinted by @craig.topper - Fix argument detection Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/

[PATCH] D71566: New checks for fortified sprintf

2020-01-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 238868. serge-sans-paille added a comment. Update size computation + test case involving null byte inside the format string. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 238758. serge-sans-paille marked 5 inline comments as done. serge-sans-paille added a comment. Take into account some of the reviews Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 2 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:2910 + + if (Arg *A = Args.getLastArg(options::OPT_fnostack_clash_protection, +

[PATCH] D72869: Add __warn_memset_zero_len builtin as a workaround for glibc issue

2020-01-17 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd293417931d3: Add __warn_memset_zero_len builtin as a workaround for glibc issue (authored by serge-sans-paille). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72869: Add __warn_memset_zero_len builtin as a workaround for glibc issue

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 238614. serge-sans-paille added a comment. Add test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72869/new/ https://reviews.llvm.org/D72869 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D72869: Add __warn_memset_zero_len builtin as a workaround for glibc issue

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D72869#1824951 , @efriedma wrote: > This is very hacky, Yeah, I know... > but it might be the least-bad alternative. I mean, we could change D71082 > so it doesn't allow system

[PATCH] D72869: Add __warn_memset_zero_len builtin as a workaround for glibc issue

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added reviewers: rnk, george.burgess.iv, akhuang. Herald added a project: clang. Herald added a subscriber: cfe-commits. serge-sans-paille added a comment. @akhuang can you confirm this fixes your issue? I've tested locally and it works

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. >> The simplest one I can think of is to make `__warn_memset_zero_len` a >> recognized builtin that generates no code. > > +1, simple and easy. See https://reviews.llvm.org/D72869 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72869: Add __warn_memset_zero_len builtin as a workaround for glibc issue

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @akhuang can you confirm this fixes your issue? I've tested locally and it works fine on my side. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72869/new/ https://reviews.llvm.org/D72869

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71082#1824563 , @rnk wrote: > The simplest one I can think of is to make `__warn_memset_zero_len` a > recognized builtin that generates no code. +1, simple and easy. > I believe we also branched 10.0 between this

[PATCH] D71566: New checks for fortified sprintf

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @erik.pilkington up? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @MaskRay no example yet, I'd like your opinion on the approach first. It has the advantage of being non intrusive to the code base... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72829/new/

[PATCH] D72829: Implement -fsemantic-interposition

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added reviewers: MaskRay, hfinkel. Herald added subscribers: llvm-commits, cfe-commits, haicheng, hiraditya, eraman. Herald added projects: clang, LLVM. serge-sans-paille added a comment. @MaskRay no example yet, I'd like your opinion on

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @craig.topper up? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/ https://reviews.llvm.org/D68720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @akhuang : I've reported https://sourceware.org/bugzilla/show_bug.cgi?id=25399 to glibc. According to me this is more of a glibc problem than this patch, and as we have a workaround with `-fgnuc-version=5.0` I think we could apply the patch back.

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71082#1822925 , @akhuang wrote: > This caused a linker error in chromium: > > ld.lld: error: undefined symbol: __warn_memset_zero_len > > > Apparently now that the glibc memset is being used, __warn_memset_zero_len

[PATCH] D65616: Ignore -fsemantic-interposition/-fno-semantic-interposition flag for gcc compatibility

2020-01-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. Obsoleted by https://reviews.llvm.org/D72724, closing. Thanks @Romain-Geissler-1A for triggering that patch! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65616/new/ https://reviews.llvm.org/D65616

[PATCH] D72724: [Driver] Ignore -fno-semantic-interposition

2020-01-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @MaskRay: is that okay with you if I start implementing -fsemantic-interposition based on `dso_preemptable`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72724/new/ https://reviews.llvm.org/D72724

[PATCH] D72724: [Driver] Ignore -fno-semantic-interposition

2020-01-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille accepted this revision. serge-sans-paille added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72724/new/ https://reviews.llvm.org/D72724

[PATCH] D65616: Ignore -fsemantic-interposition/-fno-semantic-interposition flag for gcc compatibility

2020-01-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. (back on that one) The default in clang is implicitly `-fno-semantic-interposition`. I think we can safely support it, and either warn or error on `-fsemantic-interposition`. @hfinkel does that seem correct to you? Repository: rG LLVM Github Monorepo

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-11 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 237486. serge-sans-paille added a comment. - update warn_fe_stack_clash_protection_inline_asm location. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/ https://reviews.llvm.org/D68720

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 2 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:2254 +CGM.getDiags().Report(S.getAsmLoc(), + diag::warn_fe_stack_clash_protection_inline_asm); + }

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 9 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:2254 +CGM.getDiags().Report(S.getAsmLoc(), + diag::warn_fe_stack_clash_protection_inline_asm); + }

[PATCH] D71566: New checks for fortified sprintf

2020-01-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @erik.pilkington up? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D68720: Support -fstack-clash-protection for x86

2020-01-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 237298. serge-sans-paille added a comment. Take review into account. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/ https://reviews.llvm.org/D68720 Files:

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-10 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG921f871ac438: Allow system header to provide their own implementation of some builtin (authored by serge-sans-paille). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71374: Improve support of GNU mempcpy

2020-01-09 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcee4a1c95742: Improve support of GNU mempcpy (authored by serge-sans-paille). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2020-01-09 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @sylvestre.ledru : I'd like a confirmation from @efriedma first! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/ https://reviews.llvm.org/D71082 ___

[PATCH] D71374: Improve support of GNU mempcpy

2020-01-09 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @xbolva00 : gentle reminder :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374 ___ cfe-commits mailing list

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-06 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D61446#1805413 , @svenvh wrote: > This change seems to be causing a problem with the nightly packages from > apt.llvm.org. https://reviews.llvm.org/D72255 should do the trick (?) Repository: rG LLVM Github

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-02 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. serge-sans-paille added inline comments. Comment at: llvm/test/lit.site.cfg.py.in:6 +def cmake_bool(val): +return val.lower() in (1, "on", "yes", "true", "y",) + thakis

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-02 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG24ab9b537e61: Generalize the pass registration mechanism used by Polly to any third-party tool (authored by serge-sans-paille). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2019-12-18 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 234501. serge-sans-paille added a comment. Patch rebased, validation ongoing. I'll merge that once I'm back from holidays, don't feel like commiting that 3h before holidays. Thanks **a lot** @Meinersbur for all the reviews! Repository: rG LLVM

[PATCH] D71566: New checks for fortified sprintf

2019-12-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 234327. serge-sans-paille added a comment. Support %% and %c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71566/new/ https://reviews.llvm.org/D71566 Files:

[PATCH] D71566: New checks for fortified sprintf

2019-12-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 2 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:392 + EstimateSizeFormatHandler H(StrE); + StringRef StrRef = StrE->getString(); + const char *Str = StrRef.data();

[PATCH] D71566: New checks for fortified sprintf

2019-12-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 234282. serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. - Prevent assert upon wide string format - More test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71566: New checks for fortified sprintf

2019-12-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked 7 inline comments as done. serge-sans-paille added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:370 // FIXME: There are some more useful checks we could be doing here: // - Analyze the format string of sprintf to see how much of

[PATCH] D71566: New checks for fortified sprintf

2019-12-17 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 234262. serge-sans-paille added a comment. Take remarks into account: - support sprintf when the buffer has a known static size - use llvm::Optional - some extra minor tweaks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71566: New checks for fortified sprintf

2019-12-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added a reviewer: erik.pilkington. serge-sans-paille added a project: clang. Herald added subscribers: cfe-commits, dexonsmith. Implement a pessimistic evaluator of the minimal required size for a buffer based on the format string, and

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-16 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @efriedma validation passes without the checks you were pointed out, see https://github.com/serge-sans-paille/llvm-project/pull/4/checks Thanks for making the code simpler! Comment at: clang/lib/AST/Decl.cpp:3019 +if (SL.isValid()) +

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233924. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/ https://reviews.llvm.org/D71082 Files: clang/include/clang/AST/Decl.h clang/lib/AST/Decl.cpp clang/lib/CodeGen/CGExpr.cpp

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233923. serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. Take comment into account. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-14 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @xbolva00 : validation is ok: https://github.com/serge-sans-paille/llvm-project/pull/5/checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked an inline comment as done. serge-sans-paille added inline comments. Comment at: clang/lib/AST/Decl.cpp:3019 +if (SL.isValid()) + return SM.isInSystemHeader(SL); + } efriedma wrote: > I'm a little concerned about this; we're

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233797. serge-sans-paille added a comment. Added test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. [[edited the example to reflect actual state]] Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374 ___ cfe-commits mailing list

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71374#1783245 , @xbolva00 wrote: > LLVM already converts mempcpy to memcpy.. Indeed, the clang version I was using as base reference was clang-9, and the mempcpy optimisation at IR level got introduced after that.

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71374#1783032 , @Jim wrote: > I am curious what is difference of code generation after applying your > changes? Before, when compiling #define _GNU_SOURCE #include void* foo(void* to, void* from,

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233753. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/ https://reviews.llvm.org/D71082 Files: clang/include/clang/AST/Decl.h clang/lib/AST/Decl.cpp clang/lib/CodeGen/CGExpr.cpp

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-13 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233746. serge-sans-paille marked 6 inline comments as done. serge-sans-paille added a comment. Handle comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-12 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233648. serge-sans-paille added a comment. Improve test case portability. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/ https://reviews.llvm.org/D71082 Files:

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-12 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233587. serge-sans-paille added a comment. @Jim obviously :-) Thanks for spotting that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374 Files:

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-12 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 233585. serge-sans-paille added a comment. @george.burgess.iv : take into account reviews, extra testing and function renaming. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-12 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D71374#1780402 , @serge-sans-paille wrote: > On going validation: > https://github.com/serge-sans-paille/llvm-project/pull/5/checks Validation succeeded, waiting for review! Repository: rG LLVM Github Monorepo

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-11 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. On going validation: https://github.com/serge-sans-paille/llvm-project/pull/5/checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71374/new/ https://reviews.llvm.org/D71374

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-11 Thread serge via Phabricator via cfe-commits
serge-sans-paille marked an inline comment as done. serge-sans-paille added inline comments. Comment at: clang/lib/AST/Decl.cpp:3006 +bool FunctionDecl::isReplaceableSystemFunction() const { + FunctionDecl const *Definition; george.burgess.iv wrote: >

[PATCH] D71374: Improve support of GNU mempcpy

2019-12-11 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added a reviewer: ddunbar. Herald added a project: clang. Herald added a subscriber: cfe-commits. - Lower to the memcpy intrinsic - Raise warnings when size/bounds are known Repository: rG LLVM Github Monorepo

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @george.burgess.iv : up? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/ https://reviews.llvm.org/D71082 ___ cfe-commits mailing list

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. Validation OK: https://github.com/serge-sans-paille/llvm-project/pull/4/checks Comment at: clang/lib/AST/Decl.cpp:3006 +bool FunctionDecl::isReplaceableSystemFunction() const { + FunctionDecl const *Definition; Note to

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-09 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 232894. serge-sans-paille added a comment. - Be less intrusive in the getBuiltinID() system, just hook inside CGExpr.cpp - Take into account @george.burgess.iv remark on builtins referencing themselves in an override. Add a test case for that

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2019-12-07 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 232690. serge-sans-paille added a comment. @Meinersbur : with this version, validation passes using static build on three platforms, with the following config: -DLLVM_ENABLE_PROJECTS='polly;clang' -DPOLLY_ENABLE_GPGPU_CODEGEN=ON

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-06 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 232667. serge-sans-paille added a comment. Fix interaction with fortify warnings (cc @efriedma) Also I've checked interactions with the test suite I wrote here https://github.com/serge-sans-paille/fortify-test-suite/ and clang now passes all the

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-05 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 232425. serge-sans-paille marked an inline comment as done. serge-sans-paille added a comment. test case updated Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71082/new/

[PATCH] D71082: Allow system header to provide their own implementation of some builtin

2019-12-05 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added reviewers: mstorsjo, george.burgess.iv, efriedma. Herald added a project: clang. Herald added a subscriber: cfe-commits. If a system header provides an (inline) implementation of some of their function, clang still matches on the

[PATCH] D68720: Support -fstack-clash-protection for x86

2019-12-03 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @rnk up? the mozilla folks confirmed there's no significant regression (see https://bugzilla.mozilla.org/show_bug.cgi?id=1588710#c12). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2019-11-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @Meinersbur I have a strange symbol issue when activating the GPu part: https://github.com/serge-sans-paille/llvm-project/pull/2/checks?check_run_id=324901896#step:5:4888 Any hint? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2019-11-28 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @Alouest thanks for the reproducer. I confirm your issue, and also confirm that if you pass `-fexperimental-new-pass-manager -O1` to clang (i.e. use the new pass manager) it works fine. As far as I can tell, the segfault happens because `RegisterPass` also

[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

2019-11-26 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 231092. serge-sans-paille added a comment. Handle all @Meinersbur comment, rebuild on github with extra flags pending. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61446/new/

[PATCH] D68720: Support -fstack-clash-protection for x86

2019-11-25 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. @sylvestre.ledru backport for release/9.x branch: https://sergesanspaille.fedorapeople.org/0001-Stack-clash-mir-attempt.patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68720/new/

[PATCH] D68720: Support -fstack-clash-protection for x86

2019-11-25 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. For the record : this validates fine on OSX, Linux and Windows, using the github actions setup by @tstellar https://github.com/serge-sans-paille/llvm-project/pull/3 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D68720: Support -fstack-clash-protection for x86

2019-11-25 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D68720#1755546 , @xbolva00 wrote: > https://reviews.llvm.org/rG397fa687691876de9ff0fbaaf0def3ac5a48899c > > Commited? No, still waiting for @rnk feedback. This commit is just me using the wrong remote when pushing

<    2   3   4   5   6   7   8   9   >