[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea approved this pull request. LGTM. Perhaps you might want to wait a few days before commiting, in case others would like to comment. https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lis

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,283 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,283 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea commented: The patch looks good to me, but I have one last question: https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [llvm] Add support for Windows Secure Hot-Patching (PR #138972)

2025-05-16 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -176,6 +176,21 @@ class CallerSym : public SymbolRecord { uint32_t RecordOffset = 0; }; +class HotPatchFuncSym : public SymbolRecord { aganea wrote: Thanks! Would that tooling remain proprietary, or is it something that will be open-sourced as well, for

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -453,6 +453,37 @@ CodeGenModule::CodeGenModule(ASTContext &C, if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86) getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters", CodeGenOpts.NumRegisterParameters

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,20 @@ +// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ. +// +// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-hotpatch-functions-file=%S/ms-hotpatch-functions.txt /Fo%t.obj %s ag

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/138972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -453,6 +453,37 @@ CodeGenModule::CodeGenModule(ASTContext &C, if (Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86) getModule().addModuleFlag(llvm::Module::Error, "NumRegisterParameters", CodeGenOpts.NumRegisterParameters

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,18 @@ +// This verifies that hotpatch function attributes are correctly propagated through LLVM IR when compiling with LTO. +// +// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-hotpatch-functions-file=%S/ms-hotpatch-functions.txt -flto /Fo%t.bc %s -

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,242 @@ +//===-- WindowsHotPatch.cpp - Support for Windows hotpatching -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -807,6 +809,32 @@ void CodeViewDebug::emitObjName() { endSymbolRecord(CompilerEnd); } +void CodeViewDebug::emitHotPatchInformation() { aganea wrote: As mentionned before, maybe better to rename to `emitSecureHotPatchInformation()` https://github.com/ll

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -250,6 +250,7 @@ add_llvm_component_library(LLVMCodeGen VirtRegMap.cpp WasmEHPrepare.cpp WindowScheduler.cpp + WindowsHotPatch.cpp aganea wrote: Similarily, `WindowsSecureHotPatch.cpp`? https://github.com/llvm/llvm-project/pull/138972 __

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-13 Thread Alexandre Ganea via cfe-commits
@@ -6946,6 +6946,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fms_hotpatch); + if (Arg *A = Args.getLastArg(options::OPT_fms_hotpatch_functions_file)) { aganea wrote: Idem, extra brace. https:

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Alexandre Ganea via cfe-commits
aganea wrote: Oh so all this dance (`_ref_` and the additional metadata) is for code page integrity purposes? To keep them unmodified in memory? So how does then the kernel use the PE metadata if it doesn't patch the code memory pages of the initial (running) image? Is there an additional mech

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Alexandre Ganea via cfe-commits
aganea wrote: Thanks for the answer. Are these new flags `-fms-hotpatch-functions-file=` and `-fms-hotpatch-functions-list=` populated with data maintained manually by the Windows developpers? If I understand correctly, what you describe as "symbols that were hot-patched" means functions tha

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,20 @@ +// This verifies that hotpatch function attributes are correctly propagated when compiling directly to OBJ. +// +// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-hotpatch-functions-file=%S/ms-hotpatch-functions.txt /Fo%t.obj %s ag

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Alexandre Ganea via cfe-commits
@@ -176,6 +176,21 @@ class CallerSym : public SymbolRecord { uint32_t RecordOffset = 0; }; +class HotPatchFuncSym : public SymbolRecord { aganea wrote: Out of curiosity (related to my other questions), historically Windows updates only deliver binaries (DL

[clang] [llvm] Add support for Windows hot-patching (PR #138972)

2025-05-08 Thread Alexandre Ganea via cfe-commits
aganea wrote: Since the [MSVC flag](https://learn.microsoft.com/en-us/cpp/build/reference/hotpatch-create-hotpatchable-image?view=msvc-170) `/HOTPATCH` has been supported in LLVM and clang-cl for quite a while now (see [this](https://reviews.llvm.org/D116511), and #77245 and #87639) the descr

[clang] 46135ad - [Sema] On Windows, silence erroneous warning when building with MSVC

2025-04-11 Thread Alexandre Ganea via cfe-commits
Author: Alexandre Ganea Date: 2025-04-11T17:50:15-04:00 New Revision: 46135ade9ec0b7fd975b5d3923aea95f4d416296 URL: https://github.com/llvm/llvm-project/commit/46135ade9ec0b7fd975b5d3923aea95f4d416296 DIFF: https://github.com/llvm/llvm-project/commit/46135ade9ec0b7fd975b5d3923aea95f4d416296.dif

[clang] 12c4be1 - [clang][unittests] On Windows, silence warning when building with MSVC

2025-04-11 Thread Alexandre Ganea via cfe-commits
Author: Alexandre Ganea Date: 2025-04-11T17:50:14-04:00 New Revision: 12c4be1ba8513b4c0f43945c0f266d7f871a978a URL: https://github.com/llvm/llvm-project/commit/12c4be1ba8513b4c0f43945c0f266d7f871a978a DIFF: https://github.com/llvm/llvm-project/commit/12c4be1ba8513b4c0f43945c0f266d7f871a978a.dif

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-11-30 Thread Alexandre Ganea via cfe-commits
@@ -1206,6 +1245,19 @@ void Writer::createMiscChunks() { IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT)); } + if (writeLTO) { +debugRecords.emplace_back(COFF::IMAGE_DEBUG_TYPE_POGO, + make(ltcg));

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-11-30 Thread Alexandre Ganea via cfe-commits
aganea wrote: I had a more in-depth look at this. Overall I don't agree with the whole direction of this patch. I don't think it's wise for LLD to emit debug records/`coffgrp` that do not match what MSVC is generating. We can't just blindly emit a record with the string of the debug type (ie.

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-11-05 Thread Alexandre Ganea via cfe-commits
aganea wrote: > I would like to benchmark `lld` after this change, since I have added a loop > that goes through every section of every object file. Could someone point in > the direction of a good benchmark for that? I was thinking I can benchmark on > the linking of `clang` or any other big

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-10-31 Thread Alexandre Ganea via cfe-commits
aganea wrote: I am just curious what is the purpose of this? Is it just for feature parity? Can you also investigate if MSVC emits other special things/sections in the binary in LTCG/PGO builds? https://github.com/llvm/llvm-project/pull/114260 ___ cf

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-10-31 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,13 @@ +// This test checks if Window PE file compiled with -flto option contains a magic +// string "LTCG" to indicate LTO compilation. + +// REQUIRES: system-windows + +// RUN: %clang --target=x86_64-pc-windows-msvc -flto -fuse-ld=lld %s -o %t.exe +// RUN: dumpbin /H

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-10-31 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/114260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [Windows] Add support for emitting PGO/LTO magic strings in the Windows PE debug directory (PR #114260)

2024-10-31 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,13 @@ +// This test checks if Window PE file compiled with -flto option contains a magic +// string "LTCG" to indicate LTO compilation. + +// REQUIRES: system-windows + +// RUN: %clang --target=x86_64-pc-windows-msvc -flto -fuse-ld=lld %s -o %t.exe +// RUN: dumpbin /H

[clang] [llvm] [clang] Add/enhance documentation for some important classes. (PR #109795)

2024-09-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/109795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add/enhance documentation for some important classes. (PR #109795)

2024-09-24 Thread Alexandre Ganea via cfe-commits
@@ -7,7 +7,10 @@ //===--===// // /// \file -/// Defines the virtual file system interface vfs::FileSystem. +/// Provides abstract filesystem APIs to decouple from OS-level file access. +/// +/// This allows re

[clang] [llvm] [clang] Add/enhance documentation for some important classes. (PR #109795)

2024-09-24 Thread Alexandre Ganea via cfe-commits
@@ -648,18 +648,54 @@ class InBeforeInTUCacheEntry { /// instances. using ModuleBuildStack = ArrayRef>; -/// This class handles loading and caching of source files into memory. +/// The SourceManager describes the compiler's view of source code. /// -/// This object owns the

[clang] [llvm] [clang] Add/enhance documentation for some important classes. (PR #109795)

2024-09-24 Thread Alexandre Ganea via cfe-commits
@@ -648,18 +648,54 @@ class InBeforeInTUCacheEntry { /// instances. using ModuleBuildStack = ArrayRef>; -/// This class handles loading and caching of source files into memory. +/// The SourceManager describes the compiler's view of source code. /// -/// This object owns the

[clang] [llvm] Delete the clang-format Visual Studio plugin code (PR #108342)

2024-09-12 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea approved this pull request. https://github.com/llvm/llvm-project/pull/108342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-06 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea approved this pull request. https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-06 Thread Alexandre Ganea via cfe-commits
aganea wrote: > I always set Argv0 and Commandline, even if they are just an empty string. > Some tools had issues if those were not set. We already did use the empty > string for BuildInfoRecord::TypeServerPDB, so now its also more consistent. Ah yes, that's good. Looks good, thanks again!

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-05 Thread Alexandre Ganea via cfe-commits
aganea wrote: The code LG but I’d like please @nebulark if you can explain de unit tests changes? Why those offset changes? The code should emit the same thing as before? https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list c

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-30 Thread Alexandre Ganea via cfe-commits
aganea wrote: > Maded the suggested changes. Continuing looking into the failing tests. This > is my first llvm pr and I need some time to figure out the issues those are > indicating and replicating those locally. I recommend that you build a Debug target, ie. `cmake -DCMAKE_BUILD_TYPE=Debug

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -321,6 +322,41 @@ static bool actionRequiresCodeGen(BackendAction Action) { Action != Backend_EmitLL; } +static std::string flattenClangCommandLine(ArrayRef Args, + StringRef MainFilename) { + std::string FlatCmdLine; + raw_st

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -91,8 +91,11 @@ class MCTargetOptions { std::string SplitDwarfFile; std::string AsSecureLogFile; - const char *Argv0 = nullptr; - ArrayRef CommandLineArgs; + // This will be set as compiler path in LF_BUILDINFO aganea wrote: You would need to refer

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea commented: Sounds good, but please correct the failing BuildKit tests (below) before we can go further. https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -893,6 +893,8 @@ static TypeIndex getStringIdTypeIdx(GlobalTypeTableBuilder &TypeTable, return TypeTable.writeLeafType(SIR); } +// This just exists for backwards compatability for the deprecated MCTargetOptions::CommandLineArgs +// It assumed a clang compiler frontend

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -950,9 +952,16 @@ void CodeViewDebug::emitBuildInfo() { if (Asm->TM.Options.MCOptions.Argv0 != nullptr) { BuildInfoArgs[BuildInfoRecord::BuildTool] = getStringIdTypeIdx(TypeTable, Asm->TM.Options.MCOptions.Argv0); -BuildInfoArgs[BuildInfoRecord::CommandLine

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea requested changes to this pull request. https://github.com/llvm/llvm-project/pull/106369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -92,8 +92,15 @@ class MCTargetOptions { std::string AsSecureLogFile; const char *Argv0 = nullptr; + + // Deprecated: Use FlatCommandlineArgs instead + // Arguments here are interpreted as coming from clang, formated and end up in LF_BUILDINFO as CommandLineArgs A

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-08-28 Thread Alexandre Ganea via cfe-commits
@@ -92,8 +92,15 @@ class MCTargetOptions { std::string AsSecureLogFile; const char *Argv0 = nullptr; aganea wrote: Would you mind please moving (and adapting) the comment that you've added here above? Both Argv0 and CommandLineArgs are only used for stor

[clang] [clang] Stop adjusting the module cache path (PR #102540)

2024-08-13 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea approved this pull request. Thanks for the explanation! https://github.com/llvm/llvm-project/pull/102540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-12 Thread Alexandre Ganea via cfe-commits
aganea wrote: To give the whole picture, the story is that while building the LLVM package on Windows, I was seeing this: ``` [51/52] Running sanitizer_common testsllvm-lit.py: C:\src\git\llvm-project\llvm\utils\lit\lit\llvm\config.py:57: note: using lit tools: C:\Program Files\Git\usr\bin\ ll

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-11 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-11 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-11 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-11 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure `--print-runtime-dir` path exists (PR #102834)

2024-08-11 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea created https://github.com/llvm/llvm-project/pull/102834 Before this PR, `clang --print-runtime-dir` used to report a non-existant directory if `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF`. We now check if any of the known runtime directories exist before printing on std

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-10 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea closed https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-10 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea updated https://github.com/llvm/llvm-project/pull/102681 >From 16efda65bb3d30b67b3215d7e8d69a105e2d771c Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Fri, 9 Aug 2024 16:32:09 -0400 Subject: [PATCH 1/2] [Clang][CodeGen] Fix a bad codegen when building Clang with

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-10 Thread Alexandre Ganea via cfe-commits
aganea wrote: > Might be nice to clean this up in the future when Microsoft releases a fix. I can add a comment to that effect. https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-08-10 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea approved this pull request. This solves the performance issue I was seeing on Windows with a C++ clang database. Thanks again for doing this @jansvoboda11! https://github.com/llvm/llvm-project/pull/88800 ___ cfe-commits maili

[clang] [clang] Stop adjusting the module cache path (PR #102540)

2024-08-10 Thread Alexandre Ganea via cfe-commits
aganea wrote: > This enables more efficient implementation of the caching VFS in #88800. Thanks @jansvoboda11 for working on this, I appreciate. One question, what do you mean by "more efficient"? https://github.com/llvm/llvm-project/pull/102540 ___

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/102681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix bad codegen when building Clang with latest MSVC (PR #102681)

2024-08-09 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea created https://github.com/llvm/llvm-project/pull/102681 Before this PR, when using the latest MSVC `Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33813 for x64` one of the Clang unit test used to fail: `CodeGenObjC/gnustep2-direct-method.m`, see full failure

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-07-29 Thread Alexandre Ganea via cfe-commits
aganea wrote: Ping @jansvoboda11! Just checking if you had time to finish this PR, to then possibly integrate it into 19.x. https://github.com/llvm/llvm-project/pull/88800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-23 Thread Alexandre Ganea via cfe-commits
aganea wrote: > I will say, `-fno-eliminate-unused-debug-types` is a really heavy hammer that > makes debug info much larger - and my understanding was that games tended to > have trouble with large debug builds, so I'd be surprised if this was a great > path forward. Absolutely, this is only

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-19 Thread Alexandre Ganea via cfe-commits
aganea wrote: > Yes, feel free to take over that part, thanks! @amykhuang : I took a look at https://reviews.llvm.org/D89286. It works but doesn't fix the most problematic case where the `constexpr` member needs an evaluation that relies on dependent values: ``` template struct C {

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-15 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea closed https://github.com/llvm/llvm-project/pull/95259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-15 Thread Alexandre Ganea via cfe-commits
aganea wrote: Thanks @amykhuang for taking a look! I won't close https://github.com/llvm/llvm-project/issues/46924 right away, since we also need https://reviews.llvm.org/D89286. Do you mind if I took ownership of that patch and send a PR crediting you? https://github.com/llvm/llvm-project/pu

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-15 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/95259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-12 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/95259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-12 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea created https://github.com/llvm/llvm-project/pull/95259 This is used to set DebugInfoKind to "UnusedTypeInfo". This helps in the context Unreal Engine and NATVIS files that reference unused otherwise `static constexpr` class members. See https://udn.unrealengine.com/

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea closed https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea updated https://github.com/llvm/llvm-project/pull/89950 >From 13c411018e491fc2be4f4118a56f9b8cf2e5b76f Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Wed, 17 Apr 2024 16:28:21 -0400 Subject: [PATCH 1/5] [clang-scan-deps] Expand response files before the argument

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-05-22 Thread Alexandre Ganea via cfe-commits
aganea wrote: @jansvoboda11 Do you see any further changes for this PR? Can I land it? https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-05-06 Thread Alexandre Ganea via cfe-commits
aganea wrote: Ping @jansvoboda11! Are you able to get back to this soon? LG generally, just missing a test case above. Thanks! https://github.com/llvm/llvm-project/pull/88800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-05 Thread Alexandre Ganea via cfe-commits
aganea wrote: Hello, This causes a warning when building LLDB on Windows, `clang::BuiltinType::UnresolvedTemplate` isn't handled in the case in the file indicated below (sorry my locale is French). Would you have a chance to take a look @zyn0217 please? ``` [6325/7521] Building CXX object too

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
@@ -792,10 +792,15 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { llvm::cl::PrintOptionValues(); + // Expand response files in advance, so that we can "see" all the arguments + // when adjusting below. + auto ResponseExpander = expandRes

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json +// RUN: echo /Fo%t/tu.obj >> %t/args_nested.rsp aga

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
@@ -0,0 +1,36 @@ +// Check that the scanner can adjust arguments by reading .rsp files in advance. + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json aganea wrote: As suggested. We're taking a differen

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
@@ -1069,7 +1069,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, // If user provided -o, that is the dependency target, except // when we are only generating a dependency file. - Arg *OutputOpt = Args.getLastArg(options::OPT_o);

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-29 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea updated https://github.com/llvm/llvm-project/pull/89950 >From f2340c98c95e0d72516fc240ff268fead9f15391 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Wed, 17 Apr 2024 16:28:21 -0400 Subject: [PATCH 1/5] [clang-scan-deps] Expand response files before the argument

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-26 Thread Alexandre Ganea via cfe-commits
aganea wrote: Thanks for pointing that out @MaskRay ! https://github.com/llvm/llvm-project/pull/88427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-25 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea closed https://github.com/llvm/llvm-project/pull/88427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
aganea wrote: @jansvoboda11 PTAL. I've added handling of `/Fo` in the driver, and that solves my case without the .rsp expansion in `ClangScanDeps.cpp`. However if we pass `/E` to command-lines in the CDB, that change alone doesn't work anymore. This is because `Driver::GetNamedOutputPath()`

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea updated https://github.com/llvm/llvm-project/pull/89950 >From f2340c98c95e0d72516fc240ff268fead9f15391 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Wed, 17 Apr 2024 16:28:21 -0400 Subject: [PATCH 1/3] [clang-scan-deps] Expand response files before the argument

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea updated https://github.com/llvm/llvm-project/pull/89950 >From f2340c98c95e0d72516fc240ff268fead9f15391 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Wed, 17 Apr 2024 16:28:21 -0400 Subject: [PATCH 1/2] [clang-scan-deps] Expand response files before the argument

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
aganea wrote: The reason of this `/Fo` output path fiddling code is this: https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L1072-L1082 It's because that highlighted code doesn't handle the clang-cl case, it doesn't consider `/Fo`. Probably because most people

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
aganea wrote: This is missing a test, I will add one. https://github.com/llvm/llvm-project/pull/89950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-scan-deps] Expand response files before the argument adjuster (PR #89950)

2024-04-24 Thread Alexandre Ganea via cfe-commits
https://github.com/aganea created https://github.com/llvm/llvm-project/pull/89950 Previously, since response (.rsp) files weren't expanded at the very beginning of clang-scan-deps, we only parsed the command-line as provided in the Clang .cdb file. Unfortunately, when using Unreal Engine, argu

[clang] [clang-scan-deps] Fix contention when updating `TrackingStatistic`s in hot code paths in `FileManager`. (PR #88427)

2024-04-24 Thread Alexandre Ganea via cfe-commits
aganea wrote: > LGTM, thanks! Thanks for the review! > (Out of interest, what machine are you seeing the contention with?) It's a ThreadRipper Pro 3975WX 32c/64t running on with Windows 11. https://github.com/llvm/llvm-project/pull/88427 ___ cfe-com

  1   2   3   >