[PATCH] D112413: [X86] Add -mskip-rax-setup support to align with GCC

2021-10-27 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Driver/Options.td:3193 +def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group, Flags<[NoXarchOption]>, + HelpText<"Skip setting up RAX register when passing variable arguments (x86 only)">; def mstackrealign

[PATCH] D111952: [clang] [MinGW] Guess the right ix86 arch name spelling as sysroot

2021-10-27 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/MinGW.h:63 + static void FixTripleArch(const Driver &D, llvm::Triple &Triple, +const llvm::opt::ArgList &Args); Use `functionName` for newer functions. (It's unf

[PATCH] D112349: [Verifier] Add verification logic for GlobalIFuncs

2021-10-31 Thread Fangrui Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG848812a55e53: [Verifier] Add verification logic for GlobalIFuncs (authored by ibookstein, committed by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D112971: [NFC] Remove LinkAll*.h

2021-11-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay 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/D112971/new/ https://reviews.llvm.org/D112971

[PATCH] D112913: Misleading bidirectional detection

2021-11-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. > Context not available. If you don't use `arc diff 'HEAD^'` to upload a Diff, please use -U9 https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface Comment at: clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cp

[PATCH] D112913: Misleading bidirectional detection

2021-11-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision. MaskRay added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/MisleadingBidirectional.cpp:19 + +static bool ContainsMisleadingBidi(StringRef Buffer, bool HonorLineBreaks=true) { + const char* CurPtr = Buffer.begin(); --

[PATCH] D112913: Misleading bidirectional detection

2021-11-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-misleading-bidirectional.cpp:1 +// RUN: %check_clang_tidy %s misc-misleading-bidirectional %t + The test misses many interesting cases. Repository: rG LLVM Github Mono

[PATCH] D112916: Confusable identifiers detection

2021-11-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-homoglyph.cpp:4 +int fo; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: fo is confusable with 𝐟o [misc-homoglyph] +int 𝐟o; `[[@LINE-1]]` is deprecated lit feature. Use `[[#@

[PATCH] D110663: [Driver] Support Debian multiarch style lib/clang/14.0.0/x86_64-linux-gnu runtime path and include/x86_64-linux-gnu/c++/v1 libc++ path

2021-11-02 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Herald added a subscriber: luke957. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110663/new/ https://reviews.llvm.org/D110663 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D112349: [Verifier] Add verification logic for GlobalIFuncs

2021-11-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Sorry for being late to the party. Itay's explanation is correct to me. I don't know much about multiversioned functions. My reply below if for ifunc. - On ELF, an alias is just a symbol sharing st_shndx/st_value with another symbol. It is not by name. The target symbol

[PATCH] D113370: [Driver] Change Linux::isPIEDefault to true for all Android versions

2021-11-07 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: danalbert, srhines. Herald added a subscriber: danielkiss. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently any API level>=16 uses default PIE. If API level<16 is too

[PATCH] D113372: [Driver] Add CLANG_DEFAULT_PIE to emulate GCC --enable-default-pie

2021-11-07 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: foutrelis, manojgupta, sylvestre.ledru, thesamesam, tstellar. Herald added a subscriber: mgorny. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. In 2015-05, GCC added the conf

[PATCH] D113372: [Driver] Add CLANG_DEFAULT_PIE to emulate GCC --enable-default-pie

2021-11-07 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 385375. MaskRay added a comment. add a test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113372/new/ https://reviews.llvm.org/D113372 Files: clang/CMakeLists.txt clang/include/clang/Config/config.h.cmake

[PATCH] D112868: [Sema] Diagnose and reject non-function ifunc resolvers

2021-11-08 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D112868#3105942 , @aaron.ballman wrote: > One thing that surprises me is that the test changes are in Sema but the code > changes are in CodeGen. I see that this test actually emits LLVM IR. Should > it be moved (as an NFC c

[PATCH] D112868: [CodeGen] Diagnose and reject non-function ifunc resolvers

2021-11-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. I assume that dancing with GlobalValue makes this difficult to implement in lib/Sema. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112868/new/ https://reviews.llvm.org/D112868

[PATCH] D112890: headers: optionalise some generated resource headers

2021-11-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. I remember that `NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py` needs to be the first line... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112890/new/ https://reviews.llvm.org/D112890 ___

[PATCH] D112890: headers: optionalise some generated resource headers

2021-11-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. But thanks for the work: people not enabling RISCV should not incur so much overhead. I hope that RISC-V vector contributors can really bear the cost in mind. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112890/new/ http

[PATCH] D113370: [Driver] Change Linux::isPIEDefault to true for all Android versions

2021-11-11 Thread Fangrui Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa77d1f68a002: [Driver] Change Linux::isPIEDefault to true for all Android versions (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D11337

[PATCH] D110663: [Driver] Support Debian multiarch style lib/clang/14.0.0/x86_64-linux-gnu runtime path and include/x86_64-linux-gnu/c++/v1 libc++ path

2021-11-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110663/new/ https://reviews.llvm.org/D110663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D97446: Change some addUsedGlobal to addUsedOrCompilerUsedGlobal

2021-02-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 326480. MaskRay edited the summary of this revision. MaskRay added a comment. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. Adopted rnk's list (Thanks!) Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D97447: Add GNU attribute 'retain'

2021-02-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 326513. MaskRay marked 2 inline comments as done. MaskRay added a comment. Improve documentation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97447/new/ https://reviews.llvm.org/D97447 Files: clang/include/

[PATCH] D97447: Add GNU attribute 'retain'

2021-02-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:74 +COFF and Mach-O targets (Windows and Apple platforms), this attribute prevents +the definition and its symbol from being removed by the linker. On ELF +targets, it has no effect on its own, and

[PATCH] D97528: [Driver] Don't pass -ffile-compilation-dir through to cc1

2021-02-25 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay 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/D97528/new/ https://reviews.llvm.org/D97528 __

[PATCH] D97447: Add GNU attribute 'retain'

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. I have performed a large-scale internal test. I don't find any problem with a toolchain built with D97446 /D97447 /D97448 . Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D97446: Change some addUsedGlobal to addUsedOrCompilerUsedGlobal

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 326739. MaskRay added a comment. Simplify with `CodeGenModule::getTriple()` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97446/new/ https://reviews.llvm.org/D97446 Files: clang/lib/CodeGen/CGDecl.cpp clan

[PATCH] D97446: Change some addUsedGlobal to addUsedOrCompilerUsedGlobal

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG28cb620321f5: Change some addUsedGlobal to addUsedOrCompilerUsedGlobal (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D97447: Add GNU attribute 'retain'

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 326766. MaskRay added a comment. Improve doc as rnk suggested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97447/new/ https://reviews.llvm.org/D97447 Files: clang/include/clang/Basic/Attr.td clang/includ

[PATCH] D97447: Add GNU attribute 'retain'

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8afdacba9dcd: Add GNU attribute 'retain' (authored by MaskRay). Changed prior to commit: https://reviews.llvm.org/D97447?vs=326766&id=326839#toc

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. I am supportive of getting rid of InlineAsmDiagnosticHandler, too. The updated AMDGPU tests suggeste that previously `MCContext::reportError` may be called with no `SrcMgr` or `InlineSrcMgr`, so the error is propagated to the temporary `SourceMgr()`. The `LLCDiagnosticH

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-02-26 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/CodeGen/CodeGenAction.cpp:477 + StringRef Message = D.getMessage(); + if (Message.startswith("error: ")) +Message = Message.substr(7); `StringRef::consume_front` I know you are moving code, but do you kn

[PATCH] D97706: Make -f[no-]split-dwarf-inlining CC1 default align with driver default (no inlining)

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added a reviewer: dblaikie. Herald added subscribers: jansvoboda11, dang. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Verified that the below is still true: - `clang -g` => `splitDebugInli

[PATCH] D97706: Make -f[no-]split-dwarf-inlining CC1 default align with driver default (no inlining)

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd942a82a076d: Make -f[no-]split-dwarf-inlining CC1 default align with driver default (no… (authored by MaskRay). Repository: rG LLVM Github Monore

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Is the https://github.com/ClangBuiltLinux/linux/issues/1269 unreachable error fixed? Reproduce: git clone https://android.googlesource.com/kernel/common.git --branch android-4.19-stable cd common PATH=path/to/your/clang/bin:$PATH make -s -j 30 LLVM=1 O=/tmp/out/a

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. LG. Can you attach an example triggering clang `InlineAsmDiagHandler2`? I want to check what the diagnostic looks like now. Comment at: clang/include/clang/Basic/DiagnosticFrontendKinds.td:22 def note_fe_inline_asm_here : Note<"instantiated into assem

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay 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/D97449/new/ https://reviews.llvm.org/D97449 __

[PATCH] D97449: [Diagnose] Unify MCContext and LLVMContext diagnosing

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added inline comments. Comment at: llvm/include/llvm/MC/MCContext.h:67 class SourceMgr; + template class function_ref; With `std::function`, this can be dropped. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM to 1 on ELF/Mach-O if CC1 -munwind-tables is specified

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: dexonsmith, jansvoboda11. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. % diff <(gcc -fno-asynchronous-unwind-tables -dM -E a.c) <(gcc -dM -E a.c) 130a131 > #define __G

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 327320. MaskRay retitled this revision from "Define __GCC_HAVE_DWARF2_CFI_ASM to 1 on ELF/Mach-O if CC1 -munwind-tables is specified" to "Define __GCC_HAVE_DWARF2_CFI_ASM if applicable". MaskRay edited the summary of this revision. MaskRay added a comment. C

[PATCH] D97755: [IRSymTab] Set FB_used on llvm.compiler.used symbols

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 327909. MaskRay added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add a clang/test/CodeGen/ test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97755/new/ https://reviews.ll

[PATCH] D97755: [IRSymTab] Set FB_used on llvm.compiler.used symbols

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/test/CodeGen/thinlto-inline-asm2.c:10 + +//--- a.c +const char *ref() { tejohnson wrote: > Is this other file needed for the test? This is test the limitation. If we fix the tracking for inline asm references (thi

[PATCH] D97894: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: mgorny, manojgupta. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D97894 Files: clang/lib/Driver/ToolChains

[PATCH] D97755: [IRSymTab] Set FB_used on llvm.compiler.used symbols

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 327958. MaskRay edited the summary of this revision. MaskRay added a comment. Add llvm-nm checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97755/new/ https://reviews.llvm.org/D97755 Files: clang/test/Cod

[PATCH] D97755: [IRSymTab] Set FB_used on llvm.compiler.used symbols

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG584cb67d2df3: [IRSymTab] Set FB_used on llvm.compiler.used symbols (authored by MaskRay). Changed prior to commit: https://reviews.llvm.org/D97755

[PATCH] D97894: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Thanks. This looks just looks me untested and likely uneeded logic. My notes about --gcc-toolchain= and --prefix (-B) https://lore.kernel.org/linux-kbuild/20210303230708.l6pbk5o5nc2qa...@google.com/ In the presence of --gcc-toolchain= (even if it equals `$prefix/usr`),

[PATCH] D97902: [Driver] Clarify --gcc-toolchain

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: nathanchance, nickdesaulniers. Herald added subscribers: jansvoboda11, dang. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. And add tests: when both --prefix(-B) and --gcc-too

[PATCH] D97902: [Driver] Clarify --gcc-toolchain

2021-03-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a subscriber: aaron.ballman. MaskRay added a comment. This is motivated by Linux kernel folks' confusion on `--gcc-toolchain` https://lore.kernel.org/linux-kbuild/20210303230708.l6pbk5o5nc2qa...@google.com/ (it confused me, even if I had stared at this piece code a few times before!

[PATCH] D97916: [Driver][RISCV] Support parsing multi-lib config from GCC.

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/Arch/RISCV.cpp:727 +{ + /* Default code model is small(medlow). */ + StringRef CodeModel; `//` Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:1595 +return GCCPath.st

[PATCH] D97902: [Driver] Clarify --gcc-toolchain

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/docs/ClangCommandLineReference.rst:23 -Add to search path for binaries and object files used implicitly +Search $prefix/$triple-$file and $prefix$file for executables, libraries, includes and data files used by the compiler. If

[PATCH] D97902: [Driver] Clarify --gcc-toolchain

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 328220. MaskRay marked 2 inline comments as done. MaskRay added a comment. comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97902/new/ https://reviews.llvm.org/D97902 Files: clang/docs/ClangCommandLine

[PATCH] D97902: [Driver] Clarify --gcc-toolchain

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 328227. MaskRay added a comment. Add more information to --gcc-toolchain. Reference --gcc-toolchain in --prefix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97902/new/ https://reviews.llvm.org/D97902 Files:

[PATCH] D97894: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97894#2602638 , @mgorny wrote: > Well, I think this was mostly 'just in case' condition, so I guess it's fine. > Let's just wait for @manojgupta to give it some more testing. Thanks. I sent D97902

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. @jansvoboda11 :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97743/new/ https://reviews.llvm.org/D97743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: hubert.reinterpretcast, manojgupta, nickdesaulniers, phosek. Herald added a subscriber: danielkiss. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. In GCC, if `-B $prefix` is

[PATCH] D97736: [Driver] Add a experimental option to link to LLVM libc.

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. If the end goal is to provide a complete libc, and currently the usage is expected to shadow system libc (this has to be very careful, as I don't know how shadowing some important components like pthread shall work), perhaps the name should convey this point? ===

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97993#2605157 , @manojgupta wrote: > I am not sure of the rationale or upside of this change and why do we want to > drop gcc detection? GCC does not need to do the GCC detection because it has > the needed information at con

[PATCH] D98022: [clang] Fix typos in the default logic for CLANG_DEFAULT_UNWINDLIB

2021-03-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98022/new/ https://reviews.llvm.org/D98022

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97993#2607523 , @manojgupta wrote: > Another concern is people generally want clang to work out of box without any > special arguments. As a user, after installing clang's distro package or > building from source, I expect t

[PATCH] D98023: [clang] Don't make the g++ driver imply an explicitly shared libunwind

2021-03-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. I have tested the following configurations on x86_64-linux-gnu and I don't find a difference. CC=/tmp/RelA/bin/clang CXX=/tmp/RelA/bin/clang++ $CC -c a.c $CC a.o '-###' &> a/c.raw.txt $CC a.o --rtlib=compiler-rt --unwindlib=none '-###' &> a/c.rt.none.txt $CC

[PATCH] D98023: [clang] Don't default to a specifically shared libunwind on mingw with a g++ driver

2021-03-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. In D98023#2607944 , @mstorsjo wrote: > In D98023#2607854 , @MaskRay wrote: > >> I have tested the following configurations on x86_64-linux-gnu and I don't >>

[PATCH] D98022: [clang] Fix typos in the default logic for CLANG_DEFAULT_UNWINDLIB

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. The test should be fixable with explicit `--unwindlib=platform`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98022/new/ https://reviews.llvm.org/D98022 ___ cfe-commits mailing

[PATCH] D98131: [Driver] Pass --unwindlib=platform to tests that check unwinder

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay 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/D98131/new/ https://reviews.llvm.org/D98131 __

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 328836. MaskRay added a comment. Add release note Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97993/new/ https://reviews.llvm.org/D97993 Files: clang/docs/ReleaseNotes.rst clang/lib/Driver/ToolChains/Gnu

[PATCH] D98135: [OpenMP][InstrProfiling] Fix a missing instr profiling counter

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. I know nearly nothing about OpenMP.. You need a `%clang_cc1 -disable-llvm-passes` test to demonstrate the codegen change (`call void @llvm.instrprof.increment({{.*}})`). Oh, it is unfortunate that there isn't sufficient llvm.instrprof.increment test under clang/test R

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:1911 + SmallVector Prefixes; + if (TargetTriple.isAndroid()) +Prefixes.assign(D.PrefixDirs.begin(), D.PrefixDirs.end()); srhines wrote: > danalbert wrote: > > I'm not entirely su

[PATCH] D98022: [clang] Fix typos in the default logic for CLANG_DEFAULT_UNWINDLIB

2021-03-06 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D98022#2609597 , @mstorsjo wrote: > In D98022#2609380 , @MaskRay wrote: > >> The test should be fixable with explicit `--unwindlib=platform`. > > Sure, but this change also was meant to b

[PATCH] D98158: [Driver] Pass --unwindlib=platform to tests that check unwinder

2021-03-07 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay 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/D98158/new/ https://reviews.llvm.org/D98158 __

[PATCH] D98142: [clang] Don't set CLANG_DEFAULT_UNWINDLIB to none if rtlib is set to compiler-rt

2021-03-08 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. The merit is less CMake magic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98142/new/ https://reviews.llvm.org/D98142 _

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97743#2613629 , @jansvoboda11 wrote: > Could the logic be implemented in the driver? > > LGTM regardless. No. `Res` is a `clang::CompilerInvocation` object. `CompilerInvocation` is not in the driver... Repository: rG LLV

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc11ff4bbada3: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97743#2614792 , @thakis wrote: > This seems to break tests everywhere: > http://45.33.8.238/linux/41275/step_7.txt My bad. Fixed by df67d3526962ae51446b1390e7c40e045e580ec2

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97743#2614827 , @thakis wrote: > Still broken: http://45.33.8.238/linux/41278/step_7.txt b4948c27d2e40586c0c4fa7cbf20b9c40a9f7584 The green Harbomaster mi

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 329441. MaskRay added a comment. Move to driver Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97743/new/ https://reviews.llvm.org/D97743 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Preprocessor

[PATCH] D98135: [OpenMP][InstrProfiling] Fix a missing instr profiling counter

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a subscriber: vsk. MaskRay added a comment. This revision is now accepted and ready to land. LG, but I hope an OpenMP expert can take a look. Perhaps @vsk can comment on why we hardly have any `@llvm.instrprof.increment` IR test for clang -fprofile-i

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-09 Thread Fangrui Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9d117e7b2a39: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D97743: Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

2021-03-10 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. There are some side effects: because -D is passed as command line options, it has `` in its filename, so `isWrittenInBuiltinFile` will not match it (`isWrittenInBuiltinFile` can match other built-in macros)... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D97894: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection

2021-03-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D97894#2620077 , @manojgupta wrote: > @MaskRay I have verified that Chrome OS builds are not affected by this > change. Thank you for testing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D97894: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection

2021-03-11 Thread Fangrui Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8d8a9190db19: [Driver] Drop $sysroot/usr special case from Gentoo gcc-config detection (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9

[PATCH] D98458: Revert "[CodeGenModule] Set dso_local for Mach-O GlobalValue"

2021-03-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. > Mach-O doesn't support dso_local and this change broke XNU because of the use > of dso_local. Can you elaborate on the unsupportness? For example, the backend can ignore dso_local if it does not want to support it. Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D97993: [Driver] Suppress GCC detection under -B for non-Android

2021-03-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. @tstellar :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97993/new/ https://reviews.llvm.org/D97993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D98061: [InstrProfiling] Generate runtime hook for ELF platforms

2021-03-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. > There are also going to be binaries in our system build that don't use foo.h > and ideally shouldn't have any overhead since nothing inside them is > instrumented (they should behave as if -fprofile-instr-generate wasn't set > for them at all). That's not the case tod

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: asb, craig.topper, HsiangKai, khchen. Herald added subscribers: vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones,

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-14 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 330548. MaskRay added a comment. fix comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98610/new/ https://reviews.llvm.org/D98610 Files: clang/include/clang/Basic/Attr.td clang/lib/Driver/ToolChains/Cl

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay marked 2 inline comments as done. MaskRay added inline comments. Comment at: llvm/lib/Target/RISCV/RISCVMCInstLower.cpp:247 } + return false; } jrtc27 wrote: > true, surely? false. We want to call `EmitToStreamer(*OutStreamer, TmpInst);` If a pseud

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 330744. MaskRay marked 8 inline comments as done. MaskRay added a comment. Mention supported targets in clang/include/clang/Basic/AttrDocs.td Use 4 llc RUN lines and --riscv-no-aliases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:53 +void RISCVInstrInfo::getNoop(MCInst &NopInst) const { + if (STI.getFeatureBits()[RISCV::FeatureStdExtC]) jrtc27 wrote: > I will forever wonder why TII didn't make it `MCIns

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay updated this revision to Diff 330759. MaskRay marked 5 inline comments as done. MaskRay added a comment. Change check prefixes from 32/64 to RV32/RV64 Rebase and use `MCInst getNop` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98610/new/

[PATCH] D98610: [RISCV] Support clang -fpatchable-function-entry && GNU function attribute 'patchable_function_entry'

2021-03-15 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: llvm/test/CodeGen/RISCV/patchable-function-entry.ll:24 +; RVC-NEXT: c.jr ra +; CHECK: .section __patchable_function_entries,"awo",@progbits,f1{{$}} +; 32: .p2align 2 jrtc27 wrote: > Is there a benefit

[PATCH] D113840: [Driver][Android] Remove unneeded isNoExecStackDefault

2021-11-13 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. MaskRay added reviewers: danalbert, pirama. Herald added a subscriber: danielkiss. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ld.lld used by Android ignores .note.GNU-stack and defaults to noexecs

[PATCH] D113840: [Driver][Android] Remove unneeded isNoExecStackDefault

2021-11-17 Thread Fangrui Song via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG062ef8f6b472: [Driver][Android] Remove unneeded isNoExecStackDefault (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113840/new/ https:

[PATCH] D113250: [clang][driver] Add -fplugin-arg- to pass arguments to plugins

2021-11-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision. MaskRay added a comment. This revision now requires changes to proceed. The idea LGTM. You need a test in `test/Driver` checking how the driver option maps to the CC1 option. You may check whether `REQUIRES: plugins, examples` is needed. ===

[PATCH] D113250: [clang][driver] Add -fplugin-arg- to pass arguments to plugins

2021-11-17 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Then please also update `docs/ClangPlugins.rst` to use driver option instead of CC1 `-plugin-arg` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113250/new/ https://reviews.llvm.org/D113250

[PATCH] D113250: [clang][driver] Add -fplugin-arg- to pass arguments to plugins

2021-11-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/docs/ClangPlugins.rst:133 +Clang plugins can receive arguments from the compiler driver command +line via the `fplugin-arg--` option. + Mention whether `` can contain `-` Comment at: clang/test/F

[PATCH] D113250: [clang][driver] Add -fplugin-arg- to pass arguments to plugins

2021-11-19 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/docs/ClangPlugins.rst:131 + +The clang compiler driver accepts the `fplugin` option to load a plugin. +Clang plugins can receive arguments from the compiler driver command Comment at: clang/docs

[PATCH] D114268: [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment

2021-11-19 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. > Add names to pgo registers for clarity. This may increase memory usage. Unless this is very helpful I might omit it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D110663: [Driver] Support Debian multiarch style lib/clang/14.0.0/x86_64-linux-gnu runtime path and include/x86_64-linux-gnu/c++/v1 libc++ path

2021-11-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110663/new/ https://reviews.llvm.org/D110663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D113372: [Driver] Add CLANG_DEFAULT_PIE to emulate GCC --enable-default-pie

2021-11-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113372/new/ https://reviews.llvm.org/D113372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D114229: [clang][driver] Always add LTO options when using GNU toolchain

2021-11-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision. MaskRay added a comment. This revision now requires changes to proceed. Request changes according to the outstanding comment "But in general I'm not in favor of adding a dependence on having the LTO plugin available to all non-lld links by default." A

[PATCH] D113250: [clang][driver] Add -fplugin-arg- to pass arguments to plugins

2021-11-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added inline comments. This revision is now accepted and ready to land. Comment at: clang/examples/CallSuperAttribute/CallSuperAttrInfo.cpp:150 + if (args[0] == "help") { +llvm::errs() << "Help for the CallSuperAttr plugin goes

[PATCH] D110663: [Driver] Support Debian multiarch style lib/clang/14.0.0/x86_64-linux-gnu runtime path and include/x86_64-linux-gnu/c++/v1 libc++ path

2021-11-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D110663#3148690 , @sylvestre.ledru wrote: > I am not sure why you are pinging this review often?! Maybe chat with people > who gave you feedback before directly?! https://llvm.org/docs/CodeReview.html "If it is not urgent, t

[PATCH] D110663: [Driver] Support Debian multiarch style lib/clang/14.0.0/x86_64-linux-gnu runtime path and include/x86_64-linux-gnu/c++/v1 libc++ path

2021-11-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D110663#3149389 , @lebedev.ri wrote: > Were you able to actually reproduce the problem that lead to revert of > D107799 , or is this based on blind guesses? The patch will fix the "lib/clang

<    14   15   16   17   18   19   20   21   22   23   >