summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)Author
2023-01-11[ModuleUtils][KCFI] Set patchable-function-prefix for synthesized functionsSami Tolvanen
When -fpatchable-function-entry is used to emit prefix nops before functions, KCFI assumes all indirectly called functions have the same number of prefix nops, because the nops are emitted between the KCFI type hash and the function entry. However, as patchable-function-prefix is a function attribute set by Clang, functions later synthesized by LLVM don't inherit this attribute and end up not having prefix nops. One of these functions is asan.module_ctor, which the Linux kernel ends up calling indirectly when KASAN is enabled. In order to avoid tripping KCFI, save the expected prefix offset to a module flag, and use it when we're setting KCFI type for the relevant synthesized functions. Link: https://github.com/ClangBuiltLinux/linux/issues/1742 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D141172
2023-01-09Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ partserge-sans-paille
This is a follow-up to https://reviews.llvm.org/D140896, split into several parts as it touches a lot of files. Differential Revision: https://reviews.llvm.org/D141139
2023-01-09[C++20] [Modules] Don't generate global ctors/dtors for variables which are ↵Chuanqi Xu
available externally Closes https://github.com/llvm/llvm-project/issues/59765. Currently we will generate the global ctor/dtor for variables in importing modules. It will cause multiple initialization/destructions. It makes no sense. This patch tries to not generate global ctor/dtor for variables which are available externally. Note that the variables in header units and clang modules won't be available externally by default. Reviewed By: iains Differential Revision: https://reviews.llvm.org/D140867
2022-12-27Reland "[AArch64] FMV support and necessary target features dependencies."Pavel Iliin
This relands commits e43924a75145d2f9e722f74b673145c3e62bfd07, a43f36142c501e2d3f4797ef938db4e0c5e0eeec, bf94eac6a3f7c5cd8941956d44c15524fa3751bd with MSan buildbot https://lab.llvm.org/buildbot/#/builders/5/builds/30139 use-of-uninitialized-value errors fixed. Differential Revision: https://reviews.llvm.org/D127812
2022-12-22Remove incorrectly implemented -mibt-sealFangrui Song
The option from D116070 does not work as intended and will not be needed when hidden visibility is used. A function needs ENDBR if it may be reached indirectly. If we make ThinLTO combine the address-taken property (close to `!GV.use_empty() && !GV.hasAtLeastLocalUnnamedAddr()`), then the condition can be expressed with: `AddressTaken || (!F.hasLocalLinkage() && (VisibleToRegularObj || !F.hasHiddenVisibility()))` The current `F.hasAddressTaken()` condition does not take into acount of address-significance in another bitcode file or ELF relocatable file. For the Linux kernel, it uses relocatable linking. lld/ELF uses a conservative approach by setting all `VisibleToRegularObj` to true. Using the non-relocatable semantics may under-estimate `VisibleToRegularObj`. As @pcc mentioned on https://github.com/ClangBuiltLinux/linux/issues/1737#issuecomment-1343414686 , we probably need a symbol list to supply additional `VisibleToRegularObj` symbols (not part of the relocatable LTO link). Reviewed By: samitolvanen Differential Revision: https://reviews.llvm.org/D140363
2022-12-21clang: Respect function address space for __builtin_function_startMatt Arsenault
Fixes assertion.
2022-12-21clang: Fix another assert from not respecting function address spacesMatt Arsenault
2022-12-21clang: Use correct address space for redeclared functionsMatt Arsenault
Fixes assert/verifier error with AVR.
2022-12-20Revert "[AArch64] FMV support and necessary target features dependencies."Mitch Phillips
This reverts commit e43924a75145d2f9e722f74b673145c3e62bfd07. Reason: Patch broke the MSan buildbots. More information is available on the original phabricator review: https://reviews.llvm.org/D127812
2022-12-20[AArch64] FMV support and necessary target features dependencies.Pavel Iliin
This is Function Multi Versioning (FMV) implementation for AArch64 target in accordance with Beta Arm C Language Extensions specification https://github.com/ARM-software/acle/blob/main/main/acle.md#function-multi-versioning It supports new "target_version" function attribute and extends existing "target_clones" one. Also missing dependencies for target features were added. Differential Revision: https://reviews.llvm.org/D127812
2022-12-07Overload all llvm.annotation intrinsics for globals argumentAlex Richardson
The global constant arguments could be in a different address space than the first argument, so we have to add another overloaded argument. This patch was originally made for CHERI LLVM (where globals can be in address space 200), but it also appears to be useful for in-tree targets as can be seen from the test diffs. Differential Revision: https://reviews.llvm.org/D138722
2022-12-03[CodeGen] Use std::nullopt instead of None (NFC)Kazu Hirata
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-03[clang-repl] Fix ambiguous initializer list.Vassil Vassilev
Some platforms report that GlobalTopLevelStmtBlockInFlight cannot be initalized with '{}' due to operator '=' being ambiguous. This patch is a follow up to https://reviews.llvm.org/D127284 trying to appease the bots.
2022-12-03[clang-repl] Support statements on global scope in incremental mode.Vassil Vassilev
This patch teaches clang to parse statements on the global scope to allow: ``` ./bin/clang-repl clang-repl> int i = 12; clang-repl> ++i; clang-repl> extern "C" int printf(const char*,...); clang-repl> printf("%d\n", i); 13 clang-repl> %quit ``` Generally, disambiguating between statements and declarations is a non-trivial task for a C++ parser. The challenge is to allow both standard C++ to be translated as if this patch does not exist and in the cases where the user typed a statement to be executed as if it were in a function body. Clang's Parser does pretty well in disambiguating between declarations and expressions. We have added DisambiguatingWithExpression flag which allows us to preserve the existing and optimized behavior where needed and implement the extra rules for disambiguating. Only few cases require additional attention: * Constructors/destructors -- Parser::isConstructorDeclarator was used in to disambiguate between ctor-looking declarations and statements on the global scope(eg. `Ns::f()`). * The template keyword -- the template keyword can appear in both declarations and statements. This patch considers the template keyword to be a declaration starter which breaks a few cases in incremental mode which will be tackled later. * The inline (and similar) keyword -- looking at the first token in many cases allows us to classify what is a declaration. * Other language keywords and specifiers -- ObjC/ObjC++/OpenCL/OpenMP rely on pragmas or special tokens which will be handled in subsequent patches. The patch conceptually models a "top-level" statement into a TopLevelStmtDecl. The TopLevelStmtDecl is lowered into a void function with no arguments. We attach this function to the global initializer list to execute the statement blocks in the correct order. Differential revision: https://reviews.llvm.org/D127284
2022-12-01[clang] Avoid duplicating ProgramAddressSpace in TargetInfo. NFCIAlex Richardson
This value was added to clang/Basic in D111566, but is only used during codegen, where we can use the LLVM IR DataLayout instead. I noticed this because the downstream CHERI targets would have to also set this value for AArch64/RISC-V/MIPS. Instead of duplicating more information between LLVM IR and Clang, this patch moves getTargetAddressSpace(QualType T) to CodeGenTypes, where we can consult the DataLayout. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D138296
2022-11-30[clang][TargetInfo] Use LangAS for getPointer{Width,Align}()Alex Richardson
Mixing LLVM and Clang address spaces can result in subtle bugs, and there is no need for this hook to use the LLVM IR level address spaces. Most of this change is just replacing zero with LangAS::Default, but it also allows us to remove a few calls to getTargetAddressSpace(). This also removes a stale comment+workaround in CGDebugInfo::CreatePointerLikeType(): ASTContext::getTypeSize() does return the expected size for ReferenceType (and handles address spaces). Differential Revision: https://reviews.llvm.org/D138295
2022-11-27[AVR] Fix broken bitcast for aliases in non-zero address spaceAyke van Laethem
This was triggered by some code in picolibc. The minimal version looks like this: double infinity(void) { return 5; } extern long double infinityl() __attribute__((__alias__("infinity"))); These two declarations have a different type (not because of the 'long double', which is also 'double' in IR, but because infinityl has variadic parameters). This led to a crash in the bitcast which assumed address space 0. Differential Revision: https://reviews.llvm.org/D138681
2022-11-17Fix declare target implementation to support enter.Doru Bercea
2022-10-12[HLSL] CodeGen hlsl cbuffer/tbuffer.Xiang Li
cbuffer A { float a; float b; } will be translated to a global variable. Something like struct CB_Ty { float a; float b; }; CB_Ty A; And all use of a and b will be replaced with A.a and A.b. Only support none-legacy cbuffer layout now. CodeGen for Resource binding will be in separate patch. In the separate patch, resource binding will map the resource information to the global variable. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D130131
2022-10-01[Clang][AArch64] Support AArch64 target(..) attribute formats.David Green
This adds support under AArch64 for the target("..") attributes. The current parsing is very X86-shaped, this patch attempts to bring it line with the GCC implementation from https://gcc.gnu.org/onlinedocs/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes. The supported formats are: - "arch=<arch>" strings, that specify the architecture features for a function as per the -march=arch+feature option. - "cpu=<cpu>" strings, that specify the target-cpu and any implied atributes as per the -mcpu=cpu+feature option. - "tune=<cpu>" strings, that specify the tune-cpu cpu for a function as per -mtune. - "+<feature>", "+no<feature>" enables/disables the specific feature, for compatibility with GCC target attributes. - "<feature>", "no-<feature>" enabled/disables the specific feature, for backward compatibility with previous releases. To do this, the parsing of target attributes has been moved into TargetInfo to give the target the opportunity to override the existing parsing. The only non-aarch64 change should be a minor alteration to the error message, specifying using "CPU" to describe the cpu, not "architecture", and the DuplicateArch/Tune from ParsedTargetAttr have been combined into a single option. Differential Revision: https://reviews.llvm.org/D133848
2022-09-30[IR] Don't allow DLL storage-class and local linkageBen Dunbobbin
Disallow this meaningless combination. Doing so simplifies analysis of LLVM code w.r.t t DLL storage-class, and prevents mistakes with DLL storage class. - Change the assembler to reject DLL storage class on symbols with local linkage. - Change the bitcode reader to clear the DLL Storage class when the linkage is local for auto-upgrading - Update LangRef. There is an existing restriction on non-default visibility and local linkage which this is modelled on. Differential Review: https://reviews.llvm.org/D134784
2022-09-22[AMDGPU] Emit module flag for all code object versionsYaxun (Sam) Liu
Reviewed by: Changpeng Fang, Matt Arsenault, Brian Sumner Differential Revision: https://reviews.llvm.org/D134355
2022-09-16[Clang] Give error message for invalid profile path when compiling IRAiden Grossman
Before this patch, when compiling an IR file (eg the .llvmbc section from an object file compiled with -Xclang -fembed-bitcode=all) and profile data was passed in using the -fprofile-instrument-use-path flag, there would be no error printed (as the previous implementation relied on the error getting caught again in the constructor of CodeGenModule which isn't called when -x ir is set). This patch moves the error checking directly to where the error is caught originally rather than failing silently in setPGOUseInstrumentor and waiting to catch it in CodeGenModule to print diagnostic information to the user. Regression test added. Reviewed By: xur, mtrofin Differential Revision: https://reviews.llvm.org/D132991
2022-09-16Revert "Revert "[clang, llvm] Add __declspec(safebuffers), support it in ↵David Majnemer
CodeView"" This reverts commit cd20a1828605887699579789b5433111d5bc0319 and adds a "let Heading" to NoStackProtectorDocs.
2022-09-13Revert "[clang, llvm] Add __declspec(safebuffers), support it in CodeView"Sylvestre Ledru
Causing: https://github.com/llvm/llvm-project/issues/57709 This reverts commit ab56719acd98778fb2e48fa425ac7c8d27bdea86.
2022-09-12[MinGW] Reject explicit hidden visibility applied to dllexport and ↵Fangrui Song
hidden/protected applied to dllimport Hidden visibility is incompatible with dllexport. Hidden and protected visibilities are incompatible with dllimport. (PlayStation uses dllexport protected.) When an explicit visibility attribute applies on a dllexport/dllimport declaration, report a Frontend error (Sema does not compute visibility). Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D133266
2022-09-12[clang, llvm] Add __declspec(safebuffers), support it in CodeViewDavid Majnemer
__declspec(safebuffers) is equivalent to __attribute__((no_stack_protector)). This information is recorded in CodeView. While we are here, add support for strict_gs_check.
2022-09-07Revert D133266 "[MinGW] Reject explicit non-default visibility applied to ↵Fangrui Song
dllexport/dllimport declaration" This reverts commit 91d8324366f405e871aa8174ab61fc66912964dd. The combo dllexport protected makes sense and is used by PlayStation. Will change the patch to allow dllexport protected.
2022-09-05[MinGW] Reject explicit non-default visibility applied to ↵Fangrui Song
dllexport/dllimport declaration dllimport/dllexport is incompatible with protected/hidden visibilities. (Arguably dllexport semantics is compatible with protected but let's reject the combo for simplicity.) When an explicit visibility attribute applies on a dllexport/dllimport declaration, report a Frontend error (Sema does not compute visibility). Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D133266
2022-09-02[MinGW] Ignore -fvisibility/-fvisibility-inlines-hidden for dllexportFangrui Song
Similar to 123ce97fac78bc4519afd5d2aba17c59c5717aad for dllimport: dllexport expresses a non-hidden visibility intention. We can consider it explicit and therefore it should override the global visibility setting (see AST/Decl.cpp "NamedDecl Implementation"). Adding the special case to CodeGenModule::setGlobalVisibility is somewhat weird, but allows we to add the code in one place instead of many in AST/Decl.cpp. Differential Revision: https://reviews.llvm.org/D133180
2022-08-29[llvm-profdata] Handle internal linkage functions in profile supplementationRong Xu
This patch has the following changes: (1) Handling of internal linkage functions (static functions) Static functions in FDO have a prefix of source file name, while they do not have one in SampleFDO. Current implementation does not handle this and we are not updating the profile for static functions. This patch fixes this. (2) Handling of -funique-internal-linakge-symbols Again this is for the internal linkage functions. Option -funique-internal-linakge-symbols can now be applied to both FDO and SampleFDO compilation. When it is used, it demangles internal linkage function names and adds a hash value as the postfix. When both SampleFDO and FDO profiles use this option, or both not use this option, changes in (1) should handle this. Here we also handle when the SampleFDO profile using this option while FDO profile not using this option, or vice versa. There is one case where this patch won't work: If one of the profiles used mangled name and the other does not. For example, if the SampleFDO profile uses clang c-compiler and without -funique-internal-linakge-symbols, while the FDO profile uses -funique-internal-linakge-symbols. The SampleFDO profile contains unmangled names while the FDO profile contains mangled names. If both profiles use c++ compiler, this won't happen. We think this use case is rare and does not justify the effort to fix. Differential Revision: https://reviews.llvm.org/D132600
2022-08-29[Clang] Implement function attribute nouwtableYuanfang Chen
To have finer control of IR uwtable attribute generation. For target code generation, IR nounwind and uwtable may have some interaction. However, for frontend, there are no semantic interactions so the this new `nouwtable` is marked "SimpleHandler = 1". Differential Revision: https://reviews.llvm.org/D132592
2022-08-27[CodeGen] Track DeferredDecls that have been emittedJun Zhang
If we run into a first usage or definition of a mangled name, and there's a DeferredDecl that associated with it, we should remember it we need to emit it later on. Without this patch, clang-repl hits a JIT symbol not found error: clang-repl> extern "C" int printf(const char *, ...); clang-repl> auto l1 = []() { printf("ONE\n"); return 42; }; clang-repl> auto l2 = []() { printf("TWO\n"); return 17; }; clang-repl> auto r1 = l1(); ONE clang-repl> auto r2 = l2(); TWO clang-repl> auto r3 = l2(); JIT session error: Symbols not found: [ l2 ] error: Failed to materialize symbols: { (main, { r3, orc_init_func.incr_module_5, $.incr_module_5.inits.0 }) } Signed-off-by: Jun Zhang <jun@junz.org> Differential Revision: https://reviews.llvm.org/D130831
2022-08-25[HLSL] Initial codegen for SV_GroupIndexChris Bieneman
Semantic parameters aren't passed as actual parameters, instead they are populated from intrinsics which are generally lowered to reads from dedicated hardware registers. This change modifies clang CodeGen to emit the intrinsic calls and populate the parameter's LValue with the result of the intrinsic call for SV_GroupIndex. The result of this is to make the actual passed argument ignored, which will make it easy to clean up later in an IR pass. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D131203
2022-08-25[clang-cl] /kernel should toggle bit 30 in @feat.00David Majnemer
The linker is supposed to detect when an object with /kernel is linked with another object which is not compiled with /kernel. The linker detects this by checking bit 30 in @feat.00.
2022-08-24KCFI sanitizerSami Tolvanen
The KCFI sanitizer, enabled with `-fsanitize=kcfi`, implements a forward-edge control flow integrity scheme for indirect calls. It uses a !kcfi_type metadata node to attach a type identifier for each function and injects verification code before indirect calls. Unlike the current CFI schemes implemented in LLVM, KCFI does not require LTO, does not alter function references to point to a jump table, and never breaks function address equality. KCFI is intended to be used in low-level code, such as operating system kernels, where the existing schemes can cause undue complications because of the aforementioned properties. However, unlike the existing schemes, KCFI is limited to validating only function pointers and is not compatible with executable-only memory. KCFI does not provide runtime support, but always traps when a type mismatch is encountered. Users of the scheme are expected to handle the trap. With `-fsanitize=kcfi`, Clang emits a `kcfi` operand bundle to indirect calls, and LLVM lowers this to a known architecture-specific sequence of instructions for each callsite to make runtime patching easier for users who require this functionality. A KCFI type identifier is a 32-bit constant produced by taking the lower half of xxHash64 from a C++ mangled typename. If a program contains indirect calls to assembly functions, they must be manually annotated with the expected type identifiers to prevent errors. To make this easier, Clang generates a weak SHN_ABS `__kcfi_typeid_<function>` symbol for each address-taken function declaration, which can be used to annotate functions in assembly as long as at least one C translation unit linked into the program takes the function address. For example on AArch64, we might have the following code: ``` .c: int f(void); int (*p)(void) = f; p(); .s: .4byte __kcfi_typeid_f .global f f: ... ``` Note that X86 uses a different preamble format for compatibility with Linux kernel tooling. See the comments in `X86AsmPrinter::emitKCFITypeId` for details. As users of KCFI may need to locate trap locations for binary validation and error handling, LLVM can additionally emit the locations of traps to a `.kcfi_traps` section. Similarly to other sanitizers, KCFI checking can be disabled for a function with a `no_sanitize("kcfi")` function attribute. Relands 67504c95494ff05be2a613129110c9bcf17f6c13 with a fix for 32-bit builds. Reviewed By: nickdesaulniers, kees, joaomoreira, MaskRay Differential Revision: https://reviews.llvm.org/D119296
2022-08-24Revert "KCFI sanitizer"Sami Tolvanen
This reverts commit 67504c95494ff05be2a613129110c9bcf17f6c13 as using PointerEmbeddedInt to store 32 bits breaks 32-bit arm builds.
2022-08-24KCFI sanitizerSami Tolvanen
The KCFI sanitizer, enabled with `-fsanitize=kcfi`, implements a forward-edge control flow integrity scheme for indirect calls. It uses a !kcfi_type metadata node to attach a type identifier for each function and injects verification code before indirect calls. Unlike the current CFI schemes implemented in LLVM, KCFI does not require LTO, does not alter function references to point to a jump table, and never breaks function address equality. KCFI is intended to be used in low-level code, such as operating system kernels, where the existing schemes can cause undue complications because of the aforementioned properties. However, unlike the existing schemes, KCFI is limited to validating only function pointers and is not compatible with executable-only memory. KCFI does not provide runtime support, but always traps when a type mismatch is encountered. Users of the scheme are expected to handle the trap. With `-fsanitize=kcfi`, Clang emits a `kcfi` operand bundle to indirect calls, and LLVM lowers this to a known architecture-specific sequence of instructions for each callsite to make runtime patching easier for users who require this functionality. A KCFI type identifier is a 32-bit constant produced by taking the lower half of xxHash64 from a C++ mangled typename. If a program contains indirect calls to assembly functions, they must be manually annotated with the expected type identifiers to prevent errors. To make this easier, Clang generates a weak SHN_ABS `__kcfi_typeid_<function>` symbol for each address-taken function declaration, which can be used to annotate functions in assembly as long as at least one C translation unit linked into the program takes the function address. For example on AArch64, we might have the following code: ``` .c: int f(void); int (*p)(void) = f; p(); .s: .4byte __kcfi_typeid_f .global f f: ... ``` Note that X86 uses a different preamble format for compatibility with Linux kernel tooling. See the comments in `X86AsmPrinter::emitKCFITypeId` for details. As users of KCFI may need to locate trap locations for binary validation and error handling, LLVM can additionally emit the locations of traps to a `.kcfi_traps` section. Similarly to other sanitizers, KCFI checking can be disabled for a function with a `no_sanitize("kcfi")` function attribute. Reviewed By: nickdesaulniers, kees, joaomoreira, MaskRay Differential Revision: https://reviews.llvm.org/D119296
2022-08-22[CodeGen] Sort llvm.global_ctors by lexing order before emissionYuanfang Chen
Fixes https://github.com/llvm/llvm-project/issues/55804 The lexing order is already bookkept in DelayedCXXInitPosition but we were not using it based on the wrong assumption that inline variable is unordered. This patch fixes it by ordering entries in llvm.global_ctors by orders in DelayedCXXInitPosition. for llvm.global_ctors entries without a lexing order, ordering them by the insertion order. (This *mostly* orders the template instantiation in https://reviews.llvm.org/D126341 intuitively, minus one tweak for which I'll submit a separate patch.) Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D127233
2022-08-19[RISCV] Use Triple::isRISCV/isRISCV32/isRISCV64 helps in some places. NFCCraig Topper
Reviewed By: reames Differential Revision: https://reviews.llvm.org/D132197
2022-08-18[Inlining] Add a clang option to limit inlining of functionsWolfgang Pieb
Add the clang option -finline-max-stacksize=<N> to suppress inlining of functions whose stack size exceeds the given value. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D131986
2022-08-16CodeGen: correct handling of debug info generation for aliasesSaleem Abdulrasool
When aliasing a static array, the aliasee is going to be a GEP which points to the value. We should strip pointer casts before forming the reference. This was occluded by the use of opaque pointers. This problem has existed since the introduction of the debug info generation for aliases in b1ea0191a42074341847d767609f66a26b6d5a41. The test case would assert due to the invalid cast with or without `-no-opaque-pointers` at that revision. Fixes: #57179
2022-08-08[clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song
With C++17 there is no Clang pedantic warning or MSVC C5051. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D131346
2022-08-04[NFC][HLSL] Fix build error caused missing typo update.Xiang Li
setHLSLFnuctionAttributes to setHLSLFunctionAttributes. Differential Revision: https://reviews.llvm.org/D131240
2022-08-04[HLSL] clang codeGen for HLSLShaderAttr.Xiang Li
Translate HLSLShaderAttr to IR level. 1. Skip mangle for hlsl entry functions. 2. Add function attribute for hlsl entry functions. Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D124752
2022-08-04[InstrProf][attempt 2] Add new format for -fprofile-list=Ellis Hoag
In D130807 we added the `skipprofile` attribute. This commit changes the format so we can either `forbid` or `skip` profiling functions by adding the `noprofile` or `skipprofile` attributes, respectively. The behavior of the original format remains unchanged. Also, add the `skipprofile` attribute when using `-fprofile-function-groups`. This was originally landed as https://reviews.llvm.org/D130808 but was reverted due to a Windows test failure. Differential Revision: https://reviews.llvm.org/D131195
2022-08-04Revert "[InstrProf] Add new format for -fprofile-list="Nico Weber
This reverts commit b692312ca432d9a379f67a8d83177a6f1722baaa. Breaks tests on Windows, see https://reviews.llvm.org/D130808#3699952
2022-08-04[InstrProf] Add new format for -fprofile-list=Ellis Hoag
In D130807 we added the `skipprofile` attribute. This commit changes the format so we can either `forbid` or `skip` profiling functions by adding the `noprofile` or `skipprofile` attributes, respectively. The behavior of the original format remains unchanged. Also, add the `skipprofile` attribute when using `-fprofile-function-groups`. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D130808
2022-08-04[X86] Support ``-mindirect-branch-cs-prefix`` for call and jmp to indirect thunkPhoebe Wang
This is to address feature request from https://github.com/ClangBuiltLinux/linux/issues/1665 Reviewed By: nickdesaulniers, MaskRay Differential Revision: https://reviews.llvm.org/D130754
2022-08-02[C++20] [Modules] Handle initializer for Header UnitsChuanqi Xu
Previously when we add module initializer, we forget to handle header units. This results that we couldn't compile a Hello World Example with Header Units. This patch tries to fix this. Reviewed By: iains Differential Revision: https://reviews.llvm.org/D130871