[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-31 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/llvmlibc-implementation-in-namespace.cpp:16 + +namespace namespaceG { +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: '__llvm_libc' needs to be the outermost namespace. Can

[PATCH] D76744: [clang-tidy] Add check to ensure llvm-libc implementations are defined in correct namespace.

2020-03-24 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. Instead of this narrow check, what we really want is a check to ensure that all implementation detail resides in the namespace `__llvm_libc`. Anything outside would be special and requiring a `NOLINT...` for them is reasonable. Have you considered such an approach?

[PATCH] D76818: [clang-tidy] Add check llvmlibc-implementation-in-namespace.

2020-03-25 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/llvmlibc-implementation-in-namespace.cpp:30 +// Wrapped in correct namespace. +namespace __llvm_libc { +class ClassB; For completeness, can you include a nested namespace a

[PATCH] D70416: [Driver] Make -static-libgcc imply static libunwind

2019-11-19 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added a comment. This revision is now accepted and ready to land. Please wait for saugustine's acceptance. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70416/new/ https://reviews.llvm.org/D70416 _

[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 200577. sivachandra added a comment. Let -static-pie win if specified along with -pie or -static. Also, treat specifying -nopie/-no-pie along with -static-pie as an error. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra marked an inline comment as done. sivachandra added a comment. PTAL Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:311 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || - Args.hasArg(options::OPT_r)) + Args.hasArg(options::OPT

[PATCH] D59841: [Gnu Driver] Let -static-pie win if it is specified along with -pie or -static.

2019-05-21 Thread Siva Chandra via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC361312: Let -static-pie win if it is specified along with -pie or -static. (authored by sivachandra, committed by ). Changed prior to commit: https://reviews.llvm.org/D59841?vs=200577&id=200584#toc Rep

[PATCH] D62606: [Driver] -static-pie: add -z text

2019-05-29 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62606/new/ https://reviews.llvm.org/D62606 ___ cfe-

[PATCH] D59841: [Gnu Driver] Is -pie and -static-pie are both passed, let -static-pie win.

2019-03-26 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra created this revision. sivachandra added a reviewer: saugustine. Herald added a project: clang. Herald added a subscriber: cfe-commits. A static-pie binary is a PIE after all, so letting -static-pie win makes the resulting binary statically linked as well as being a PIE. Repository:

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

2021-03-01 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra created this revision. sivachandra added a reviewer: phosek. Herald added subscribers: jansvoboda11, dang. sivachandra requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The experimental option is named -experimental-link-llvmlibc.

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 328340. sivachandra added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97736/new/ https://reviews.llvm.org/D97736 Files: clang/include/clang/Driver/Options.td clang/lib/Dri

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:680 +for (StringRef Arg : CmdArgs) { + if (Arg == "-lm" || Arg == "-lc") { +// TODO: Add -lllvmlibc before -lpthread when LLVM libc has pthread phosek wrote: > Thi

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:680 +for (StringRef Arg : CmdArgs) { + if (Arg == "-lm" || Arg == "-lc") { +// TODO: Add -lllvmlibc before -lpthread when LLVM libc has pthread sivachandra wrote:

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D97736#2605432 , @echristo wrote: > In addition to the bikeshed below, I'm not a huge fan of this in general. I > think we should assume that the libc we link is complete and thus it would > just be named "libc." and in a

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D97736#2605432 , @echristo wrote: > In addition to the bikeshed below, I'm not a huge fan of this in general. I > think we should assume that the libc we link is complete and thus it would > just be named "libc." and in a

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 328380. sivachandra added a comment. Remove empty '//' in lit test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97736/new/ https://reviews.llvm.org/D97736 Files: clang/include/clang/Driver/Options

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

2021-03-04 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D97736#2605535 , @phosek wrote: > Have you considered using an input linker script? We could generate `libc.so` > that could look something like: > > INPUT(libllvmlibc.a /lib/libc.so) > > We would need to pass `--sysroot`

[PATCH] D104854: Introduce intrinsic llvm.isnan

2021-08-11 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:22193 +DAG.getConstant(0x45, DL, MVT::i8)); + + return DAG.getSetCC(DL, ResultVT, Extract, DAG.getConstant(1, DL, MVT::i8), While I do not understand t

[PATCH] D58307: [Clang Driver] Add support for "-static-pie" argument to the Clang driver.

2019-02-15 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This change mimics GCC's support for the "-static-pie" argument. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D58307 Files: clang/include/clang/Driver/Options.td clan

[PATCH] D58307: [Clang Driver] Add support for "-static-pie" argument to the Clang driver.

2019-02-20 Thread Siva Chandra via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL354502: [Clang Driver] Add support for "-static-pie" argument to the Clang driver. (authored by sivachandra, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D137338: Fix dupe word typos

2022-11-03 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added a comment. Changes in the libc directory LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137338/new/ https://reviews.llvm.org/D137338 ___ cfe-com

[PATCH] D154036: [libc] Add support for creating wrapper headers for offloading in clang

2023-07-06 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. The libc specific changes are really minimal straightforward. The GPU side, the clang driver changes etc. need a review by a GPU expert. Comment at: libc/include/CMakeLists.txt:8 +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + include(GetClangResourceDir)

[PATCH] D113946: [libc][clang-tidy] fix namespace check for externals

2021-11-15 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp:1 //===-- CalleeNamespaceCheck.cpp --===// // You should add tests for this exception check. See https://gith

[PATCH] D113946: [libc][clang-tidy] fix namespace check for externals

2021-11-16 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added a comment. For libc requirements, LGTM. Please wait for @aaron.ballman for stamping the clang-tidy parts. Comment at: clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp:39 +// intercepted. +static const char *FU

[PATCH] D145584: [libc] Add support for setjmp and longjmp in riscv

2023-03-24 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added inline comments. This revision is now accepted and ready to land. Comment at: libc/src/setjmp/riscv64/longjmp.cpp:54-55 + + LIBC_INLINE_ASM("seqz %0, %1" : "+r"(buf) : "r"(val) :); + LIBC_INLINE_ASM("add %0, %0, %1" : "+r"(b

[PATCH] D146973: [Clang] Implicitly include LLVM libc headers for the GPU

2023-03-27 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1230 + llvm::sys::path::append(P, "llvm-libc"); + CmdArgs.push_back("-c-isystem"); + CmdArgs.push_back(Args.MakeArgString(P)); jhuber6 wrote: > tra wrote: > > jhub

[PATCH] D146973: [Clang] Implicitly include LLVM libc headers for the GPU

2023-03-27 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1230 + llvm::sys::path::append(P, "llvm-libc"); + CmdArgs.push_back("-c-isystem"); + CmdArgs.push_back(Args.MakeArgString(P)); tra wrote: > sivachandra wrote: > >

[PATCH] D146973: [Clang] Implicitly include LLVM libc headers for the GPU

2023-03-27 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. In D146973#4225983 , @jdoerfert wrote: > For most of libc, we might get away with custom GPU headers but eventually it > will break "expected to work" user code, at the latest when we arrive at > libc++. > A user can, right

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-02-12 Thread Siva Chandra via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb7b28c6cfe04: [clang-tidy][libc] Add an inline function checker for the libc project. (authored by sivachandra). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D144509: [CMake] Bumps minimum version to 3.20.0.

2023-02-21 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra accepted this revision. sivachandra added a comment. Herald added subscribers: sstefan1, JDevlieghere. OK for libc. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144509/new/ https://reviews.llvm.org/D144509

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-25 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra created this revision. sivachandra added a reviewer: aaron.ballman. Herald added subscribers: ChuanqiXu, carlosgalvezp, ecnelises, tschuett, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. sivachandra requested review of this revision. Herald added a project:

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-25 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 492324. sivachandra added a comment. Use explicit type instead of auto. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 Files: clang-tools-extra/clang-tidy/llvm

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-26 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 492596. sivachandra added a comment. Use the HeaderFileExtensions pattern to match constructs in header files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 Fil

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-26 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 492597. sivachandra added a comment. Update release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 Files: clang-tools-extra/clang-tidy/llvmlibc/CMakeLis

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-26 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: clang-tools-extra/clang-tidy/llvmlibc/InlineFunctionDeclCheck.cpp:20 +void InlineFunctionDeclCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher(decl(functionDecl()).bind("func_decl"), this); +} Cloc

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-27 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 492661. sivachandra marked an inline comment as done. sivachandra added a comment. Limit the description in the release notes to one sentence. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-01-27 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added a comment. Limit the description in the release notes to one sentence. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 ___ cfe-commits mailing

[PATCH] D142592: [clang-tidy][libc] Add an inline function checker for the libc project.

2023-02-06 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra updated this revision to Diff 495265. sivachandra marked 14 inline comments as done. sivachandra added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142592/new/ https://reviews.llvm.org/D142592 Files: cla

[PATCH] D152226: [FunctionAttrs] Propagate some func/arg/ret attributes from caller to callsite (WIP)

2023-06-05 Thread Siva Chandra via Phabricator via cfe-commits
sivachandra added inline comments. Comment at: libc/CMakeLists.txt:22 +# that clang will use it. +if(LLVM_LIBC_MAKE_DISCOVERABLE) + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) Likely out of date and not required for this patch? Repository: rG LLVM Github Monorepo