aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-08-14[DataLayout] Use member initialization (NFC) (#103712)Sergei Barannikov1-1/+1
This also adds a default constructor and a few uses of it.
2024-08-14[IR] Cache llvm.module.flags metadata in ModuleAlexis Engelke1-7/+6
This metadata is queried quite often, so avoiding frequent lookups in the hash map is beneficial. Therefore, cache the metadata node directly in the module. Pull Request: https://github.com/llvm/llvm-project/pull/103410
2024-08-13[DataLayout] Remove `clear` and `reset` methods (NFC) (#102993)Sergei Barannikov1-3/+1
`clear` was never necessary as it is always called on a fresh instance of the class or just before freeing an instance's memory. `reset` is effectively the same as the constructor. Pull Reuquest: https://github.com/llvm/llvm-project/pull/102993
2024-08-06[IR] Don't verify module flags on every access (#102153)Alexis Engelke1-35/+15
8b4306ce050bd5 introduced validity checks for every module flag access, because the auto-upgrader uses named metadata before verifying the module. This causes overhead for all other accesses, and the check is, in fact, only need at that single place. Change the upgrader to be careful when accessing module flags before the module is verified and remove the checks on all other occasions. There are two tangential optimizations included: first, when querying a specific flag, don't enumerate all other flags into a vector as well. Second, don't use a Twine for getNamedMetadata(), which has materialization overhead -- all call sites use simple strings that can be implicitly converted to a StringRef.
2024-07-08[IR] Use range-based for loops (NFC) (#97950)Kazu Hirata1-2/+1
2024-06-20[LLVM] Extend setModuleFlag interface. (#86031)Daniel Kiss1-0/+9
Add same interfaces variants to the `Module::setModuleFlag` as the `Module::addModuleFlag` has.
2024-06-14Reapply#4 "[RemoveDIs] Load into new debug info format by default in LLVM ↵Stephen Tozer1-1/+3
(#89799)" Reapplies commit c5aeca73 (and its followup commit 21396be8), which were reverted due to missing functionality in MLIR and Flang regarding printing debug records. This has now been added in commit 08aa511, along with support for printing debug records in flang. This reverts commit 2dc2290860355dd2bac3b655eea895fe30fde257.
2024-06-11Revert new debug info format commits:Stephen Tozer1-3/+1
"[Flang] Update test to not check for tail calls on debug intrinsics" & "Reapply#3 "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)" Recent updates to flang have added debug info generation via MLIR, a path which currently does not support debug records. The patch that enables debug records by default (and a small followup patch) are thus being reverted until the MLIR path has been fixed. This reverts commits: 21396be865b4640abf6afa0b05de6708a1a996e0 c5aeca732d1ff6769b0659efebd1cfb5f60487e4
2024-06-10Reapply#3 "[RemoveDIs] Load into new debug info format by default in LLVM ↵Stephen Tozer1-1/+3
(#89799)" Reapplies commit 91446e2, which was reverted due to a downstream error, discussed on the pull request. The error could not be reproduced upstream, and cannot be reproduced downstream as-of current main, so until the error can be confirmed to still exist this patch should return. This reverts commit 23f8fac745bdde70ed4f9c585d19c4913734f1b8.
2024-05-21[Darwin][IR] Don't error on target_variant mismatch when linking IR (#92297)Steven Wu1-1/+1
Change the ModuleFlag type for target_variant to warning to avoid error out when the value is different. This matches the linker behavior when linking object files. rdar://125874272
2024-05-13Revert "Repply#2 "[RemoveDIs] Load into new debug info format by default in ↵Fangrui Song1-3/+1
LLVM (#89799)"" This reverts commit 91446e2aa687ec57ad88dc0df793d0c6e694a7c9 and a unittest followup 1530f319311908b06fe935c89fca692d3e53184f (#90476). In a stage-2 -flto=thin -gsplit-dwarf -g -fdebug-info-for-profiling -fprofile-sample-use= build of clang, a ThinLTO backend compile has assertion failures: Global is external, but doesn't have external or weak linkage! ptr @_ZN5clang12ast_matchers8internal18makeAllOfCompositeINS_8QualTypeEEENS1_15BindableMatcherIT_EEN4llvm8ArrayRefIPKNS1_7MatcherIS5_EEEE function declaration may only have a unique !dbg attachment ptr @_ZN5clang12ast_matchers8internal18makeAllOfCompositeINS_8QualTypeEEENS1_15BindableMatcherIT_EEN4llvm8ArrayRefIPKNS1_7MatcherIS5_EEEE The failures somehow go away if -fprofile-sample-use= is removed.
2024-05-03Repply#2 "[RemoveDIs] Load into new debug info format by default in LLVM ↵Stephen Tozer1-1/+3
(#89799)" Reapplies the original commit: 2f01fd99eb8c8ab3db9aba72c4f00e31e9e60a05 The previous application of this patch failed due to some missing DbgVariableRecord support in clang, which has been added now by commit 8805465e. This will probably break some downstream tools that don't already handle debug records. If your downstream code breaks as a result of this change, the simplest fix is to convert the module in question to the old debug format before you process it, using `Module::convertFromNewDbgValues()`. For more information about how to handle debug records or about what has changed, see the migration document: https://llvm.org/docs/RemoveDIsDebugInfo.html This reverts commit 4fd319ae273ed6c252f2067909c1abd9f6d97efa.
2024-05-02Revert#2 "[RemoveDIs] Load into new debug info format by default in LLVM ↵Stephen Tozer1-3/+1
(#89799)" Reverted following probably-causing failures on some clang buildbots: https://lab.llvm.org/buildbot/#/builders/245/builds/24037 This reverts commit a12622543de15df45fb9ad64e8ab723289d55169.
2024-05-02Reapply "[RemoveDIs] Load into new debug info format by default in LLVM ↵Stephen Tozer1-1/+3
(#89799)" Fixes the broken tests in the original commit: 2f01fd99eb8c8ab3db9aba72c4f00e31e9e60a05 This will probably break some downstream tools that don't already handle debug records. If your downstream code breaks as a result of this change, the simplest fix is to convert the module in question to the old debug format before you process it, using `Module::convertFromNewDbgValues()`. For more information about how to handle debug records or about what has changed, see the migration document: https://llvm.org/docs/RemoveDIsDebugInfo.html This reverts commit 00821fed09969305b0003d3313c44d1e761a7131.
2024-05-01Revert "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)"Stephen Tozer1-3/+1
A unit test was broken by the above commit: https://lab.llvm.org/buildbot/#/builders/139/builds/64627 This reverts commit 2f01fd99eb8c8ab3db9aba72c4f00e31e9e60a05.
2024-05-01[RemoveDIs] Load into new debug info format by default in LLVM (#89799)Stephen Tozer1-1/+3
This patch enables parsing and creating modules directly into the new debug info format. Prior to this patch, all modules were constructed with the old debug info format by default, and would be converted into the new format just before running LLVM passes. This is an important milestone, in that this means that every tool will now be exposed to debug records, rather than those that run LLVM passes. As far as I've tested, all LLVM tools/projects now either handle debug records, or convert them to the old intrinsic format. There are a few unit tests that need updating for this patch; these are either cases of tests that previously needed to set the debug info format to function, or tests that depend on the old debug info format in some way. There should be no visible change in the output of any LLVM tool as a result of this patch, although the likelihood of this patch breaking downstream code means an NFC tag might be a little misleading, if not technically incorrect: This will probably break some downstream tools that don't already handle debug records. If your downstream code breaks as a result of this change, the simplest fix is to convert the module in question to the old debug format before you process it, using `Module::convertFromNewDbgValues()`. For more information about how to handle debug records or about what has changed, see the migration document: https://llvm.org/docs/RemoveDIsDebugInfo.html
2024-02-27Reapply "[RemoveDIs] Print non-intrinsic debug info in textual IR output ↵Stephen Tozer1-0/+22
(#79281)" This reapplication changes debug intrinsic declaration removal to only take place when printing final IR, so that the processing format of the Module does not affect the output. This reverts commit d128448efdd4e2bf3c9bc9a5b43ae642aa78026f.
2024-02-27Revert "Reapply "[RemoveDIs] Print non-intrinsic debug info in textual IR ↵Stephen Tozer1-22/+0
output (#79281)"" Reverted due to some test failures on some buildbots. https://lab.llvm.org/buildbot/#/builders/67/builds/14669 This reverts commit aa436493ab7ad4cf323b0189c15c59ac9dc293c7.
2024-02-27Reapply "[RemoveDIs] Print non-intrinsic debug info in textual IR output ↵Stephen Tozer1-0/+22
(#79281)" Fixes the prior issue in which the symbol for a cl-arg was unavailable to some binaries. This reverts commit dc06d75ab27b4dcae2940fc386fadd06f70faffe.
2024-02-26Revert "[RemoveDIs] Print non-intrinsic debug info in textual IR output ↵Stephen Tozer1-22/+0
(#79281)" Reverted due to failures on buildbots, where a new cl flag was placed in the wrong file, resulting in link errors. https://lab.llvm.org/buildbot/#/builders/198/builds/8548 This reverts commit 0b398256b3f72204ad1f7c625efe4990204e898a.
2024-02-26[RemoveDIs] Print non-intrinsic debug info in textual IR output (#79281)Stephen Tozer1-0/+22
This patch adds support for printing the proposed non-instruction debug info ("RemoveDIs") out to textual IR. This patch does not add any bitcode support, parsing support, or documentation. Printing of the new format is controlled by a flag added in this patch, `--write-experimental-debuginfo`, which defaults to false. The new format will be printed *iff* this flag is true, so whether we use the IR format is completely independent of whether we use non-instruction debug info during LLVM passes (which is controlled by the `--try-experimental-debuginfo-iterators` flag). Even with the flag disabled, some existing tests need to be updated, as this patch causes debug intrinsic declarations to be changed in a round trip, such that they always appear at the end of a module and have no attributes (this has no functional change on the module). The design of this new IR format was proposed previously on Discourse, and any further discussion about the design can still be contributed there: https://discourse.llvm.org/t/rfc-debuginfo-proposed-changes-to-the-textual-ir-representation-for-debug-values/73491
2024-02-21Module::getOrInsertFunction: set debug info format (#82505)Harald van Dijk1-2/+1
Function::Function's constructor sets the debug info format based on the passed in parent Module, so by using this rather than modifying the function list directly, we pick up the debug info format automatically.
2023-11-13[llvm] Remove no-op ptr-to-ptr bitcasts (NFC) (#72133)Youngsuk Kim1-13/+0
Opaque ptr cleanup effort (NFC).
2023-11-08Reapply 7d77bbef4ad92, adding new debug-info classesJeremy Morse1-1/+2
This reverts commit 957efa4ce4f0391147cec62746e997226ee2b836. Original commit message below -- in this follow up, I've shifted un-necessary inclusions of DebugProgramInstruction.h into being forward declarations (fixes clang-compile time I hope), and a memory leak in the DebugInfoTest.cpp IR unittests. I also tracked a compile-time regression in D154080, more explanation there, but the result of which is hiding some of the changes behind the EXPERIMENTAL_DEBUGINFO_ITERATORS compile-time flag. This is tested by the "new-debug-iterators" buildbot. [DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0]. The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur. This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately. [0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
2023-11-02Revert "[DebugInfo][RemoveDIs] Add prototype storage classes for "new" ↵Jeremy Morse1-2/+1
debug-info" And some intervening fixups. There are two remaining problems: * A memory leak via https://lab.llvm.org/buildbot/#/builders/236/builds/7120/steps/10/logs/stdio * A performance slowdown with -g where I'm not completely sure what the cause it These might be fairly straightforwards to fix, but it's the end of the day hear, so I figure I'll clear the buildbots til tomorrow. This reverts commit 7d77bbef4ad9230f6f427649373fe46a668aa909. This reverts commit 9026f35afe6ffdc5e55b6615efcbd36f25b11558. This reverts commit d97b2b389a0e511c65af6845119eb08b8a2cb473.
2023-11-02[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-infoJeremy Morse1-1/+2
This patch adds a variety of classes needed to record variable location debug-info without using the existing intrinsic approach, see the rationale at [0]. The two added files and corresponding unit tests are the majority of the plumbing required for this, but at this point isn't accessible from the rest of LLVM as we need to stage it into the repo gently. An overview is that classes are added for recording variable information attached to Real (TM) instructions, in the form of DPValues and DPMarker objects. The metadata-uses of DPValues is plumbed into the metadata hierachy, and a field added to class Instruction, which are all stimulated in the unit tests. The next few patches in this series add utilities to convert to/from this new debug-info format and add instruction/block utilities to have debug-info automatically updated in the background when various operations occur. This patch was reviewed in Phab in D153990 and D154080, I've squashed them together into this commit as there are dependencies between the two patches, and there's little profit in landing them separately. [0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
2023-09-19[IR] Add "Large Data Threshold" module metadata (#66797)Arthur Eubanks1-0/+17
This allows us to not have to pass -mllvm flags to set the large data threshold for (in-LLD/not-distributed) ThinLTO. Follows https://reviews.llvm.org/D52322, which did the same for the code model. Since the large data threshold is tied to the code model and we disallow mixing different code models, do the same for the large data threshold.
2023-09-07[IR] Move trivial accessor Module::getDataLayout into headerJay Foad1-2/+0
2023-05-23[IR] Make stack protector symbol dso_local according to ↵Fangrui Song1-0/+12
-f[no-]direct-access-external-data There are two motivations. `-fno-pic -fstack-protector -mstack-protector-guard=global` created `__stack_chk_guard` is referenced directly on all ELF OSes except FreeBSD. This patch allows referencing the symbol indirectly with -fno-direct-access-external-data. Some Linux kernel folks want `-fno-pic -fstack-protector -mstack-protector-guard-reg=gs -mstack-protector-guard-symbol=__stack_chk_guard` created `__stack_chk_guard` to be referenced directly, avoiding R_X86_64_REX_GOTPCRELX (even if the relocation may be optimized out by the linker). https://github.com/llvm/llvm-project/issues/60116 Why they need this isn't so clear to me. --- Add module flag "direct-access-external-data" and set the dso_local property of the stack protector symbol. The module flag can benefit other LLVMCodeGen synthesized symbols that are not represented in LLVM IR. Nowadays, with `-fno-pic` being uncommon, ideally we should set "direct-access-external-data" when it is true. However, doing so would require ~90 clang/test tests to be updated, which are too much. As a compromise, we set "direct-access-external-data" only when it's different from the implied default value. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D150841
2023-02-14[NFC][IR] Make Module::getNamedMDList() privateVasileios Porpodas1-2/+2
This patch adds several missing NamedMDList modifier functions, like removeNamedMDNode(), eraseNamedMDNode() and insertNamedMDNode(). There is no longer need to access the list directly so it also makes getNamedMDList() private. Differential Revision: https://reviews.llvm.org/D143969
2023-02-08[TLS]: Clamp the alignment of TLS global variables if required by the targetWolfgang Pieb1-0/+7
Adding a module flag 'MaxTLSAlign' describing the maximum alignment a global TLS variable can have. Optimizers are prevented from increasing the alignment of such variables beyond this threshold. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D140123
2022-12-05[IR] llvm::Optional => std::optionalFangrui Song1-1/+0
Many llvm/IR/* files have been migrated by other contributors. This migrates most remaining files.
2022-12-03Convert Optional<CodeModel> to std::optional<CodeModel>Krzysztof Parzyszek1-1/+1
2022-12-02[IR] Use std::nullopt instead of None (NFC)Kazu Hirata1-2/+2
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-11-25[IR] Use std::optional in Module.cpp (NFC)Kazu Hirata1-1/+2
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-08-18[IR] Use Min behavior for module flag "PIC Level"Fangrui Song1-1/+3
Using Max for both "PIC Level" and "PIE Level" is inconsistent. PIC imposes less restriction while PIE imposes more restriction. The result generally picks the more restrictive behavior: Min for PIC. This choice matches `ld -r`: a non-pic object and a pic object merge into a result which should be treated as non-pic. To allow linking "PIC Level" using Error/Max from old bitcode files, upgrade Error/Max to Min. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D130531
2022-07-12[X86] Support -mstack-protector-guard-symbolXiang1 Zhang1-0/+12
Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D129346
2022-07-12Revert "[X86] Support -mstack-protector-guard-symbol"Xiang1 Zhang1-12/+0
This reverts commit efbaad1c4a526e91b034e56386e98a9268cd87b2. due to miss adding review info.
2022-07-12[X86] Support -mstack-protector-guard-symbolXiang1 Zhang1-0/+12
2022-03-28Apply clang-tidy fixes for readability-redundant-member-init in Module.cpp (NFC)Kazu Hirata1-2/+1
2022-02-14Extend the `uwtable` attribute with unwind table kindMomchil Velikov1-4/+7
We have the `clang -cc1` command-line option `-funwind-tables=1|2` and the codegen option `VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind tables (1) or asynchronous unwind tables (2)`. However, this is encoded in LLVM IR by the presence or the absence of the `uwtable` attribute, i.e. we lose the information whether to generate want just some unwind tables or asynchronous unwind tables. Asynchronous unwind tables take more space in the runtime image, I'd estimate something like 80-90% more, as the difference is adding roughly the same number of CFI directives as for prologues, only a bit simpler (e.g. `.cfi_offset reg, off` vs. `.cfi_restore reg`). Or even more, if you consider tail duplication of epilogue blocks. Asynchronous unwind tables could also restrict code generation to having only a finite number of frame pointer adjustments (an example of *not* having a finite number of `SP` adjustments is on AArch64 when untagging the stack (MTE) in some cases the compiler can modify `SP` in a loop). Having the CFI precise up to an instruction generally also means one cannot bundle together CFI instructions once the prologue is done, they need to be interspersed with ordinary instructions, which means extra `DW_CFA_advance_loc` commands, further increasing the unwind tables size. That is to say, async unwind tables impose a non-negligible overhead, yet for the most common use cases (like C++ exceptions), they are not even needed. This patch extends the `uwtable` attribute with an optional value: - `uwtable` (default to `async`) - `uwtable(sync)`, synchronous unwind tables - `uwtable(async)`, asynchronous (instruction precise) unwind tables Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D114543
2022-02-02[clang][macho] add clang frontend support for emitting macho files with two ↵Alex Lorenz1-3/+16
build version load commands This patch extends clang frontend to add metadata that can be used to emit macho files with two build version load commands. It utilizes "darwin.target_variant.triple" and "darwin.target_variant.SDK Version" metadata names for that. MachO uses two build version load commands to represent an object file / binary that is targeting both the macOS target, and the Mac Catalyst target. At runtime, a dynamic library that supports both targets can be loaded from either a native macOS or a Mac Catalyst app on a macOS system. We want to add support to this to upstream to LLVM to be able to build compiler-rt for both targets, to finish the complete support for the Mac Catalyst platform, which is right now targetable by upstream clang, but the compiler-rt bits aren't supported because of the lack of this multiple build version support. Differential Revision: https://reviews.llvm.org/D115415
2022-02-02Cleanup header dependencies in LLVMCoreserge-sans-paille1-2/+0
Based on the output of include-what-you-use. This is a big chunk of changes. It is very likely to break downstream code unless they took a lot of care in avoiding hidden ehader dependencies, something the LLVM codebase doesn't do that well :-/ I've tried to summarize the biggest change below: - llvm/include/llvm-c/Core.h: no longer includes llvm-c/ErrorHandling.h - llvm/IR/DIBuilder.h no longer includes llvm/IR/DebugInfo.h - llvm/IR/IRBuilder.h no longer includes llvm/IR/IntrinsicInst.h - llvm/IR/LLVMRemarkStreamer.h no longer includes llvm/Support/ToolOutputFile.h - llvm/IR/LegacyPassManager.h no longer include llvm/Pass.h - llvm/IR/Type.h no longer includes llvm/ADT/SmallPtrSet.h - llvm/IR/PassManager.h no longer includes llvm/Pass.h nor llvm/Support/Debug.h And the usual count of preprocessed lines: $ clang++ -E -Iinclude -I../llvm/include ../llvm/lib/IR/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 6400831 after: 6189948 200k lines less to process is no that bad ;-) Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D118652
2022-01-03Revert "[llvm] Remove redundant member initialization (NFC)"Kazu Hirata1-1/+2
This reverts commit fd4808887ee47f3ec8a030e9211169ef4fb094c3. This patch causes gcc to issue a lot of warnings like: warning: base class ‘class llvm::MCParsedAsmOperand’ should be explicitly initialized in the copy constructor [-Wextra]
2022-01-01[llvm] Remove redundant member initialization (NFC)Kazu Hirata1-2/+1
Identified with readability-redundant-member-init.
2021-12-07[macho] add support for emitting macho files with two build version load ↵Alex Lorenz1-2/+16
commands This patch extends LLVM IR to add metadata that can be used to emit macho files with two build version load commands. It utilizes "darwin.target_variant.triple" and "darwin.target_variant.SDK Version" metadata names for that, which will be set by a future patch in clang. MachO uses two build version load commands to represent an object file / binary that is targeting both the macOS target, and the Mac Catalyst target. At runtime, a dynamic library that supports both targets can be loaded from either a native macOS or a Mac Catalyst app on a macOS system. We want to add support to this to upstream to LLVM to be able to build compiler-rt for both targets, to finish the complete support for the Mac Catalyst platform, which is right now targetable by upstream clang, but the compiler-rt bits aren't supported because of the lack of this multiple build version support. Differential Revision: https://reviews.llvm.org/D112189
2021-07-28[PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types.Jeroen Dobbelaere1-0/+4
This is a second attempt to fix the EXPENSIVE_CHECKS issue that was mentioned In D91661#2875179 by @jroelofs. (The first attempt was in D105983) D91661 more or less completely reverted D49126 and by doing so also removed the cleanup logic of the created declarations and calls. This patch is a replacement for D91661 (which must itself be reverted first). It replaces the custom declaration creation with the generic version and shows the test impact. It also tracks the number of NamedValues to detect if a new prototype was added instead of looking at the available users of a prototype. Reviewed By: jroelofs Differential Revision: https://reviews.llvm.org/D106147
2021-07-09[NFC][OpaquePtr] Use GlobalValue::getValueType() moreArthur Eubanks1-1/+1
Instead of getType()->getElementType().
2021-06-21[IR] convert warn-stack-size from module flag to fn attrNick Desaulniers1-11/+0
Otherwise, this causes issues when building with LTO for object files that use different values. Link: https://github.com/ClangBuiltLinux/linux/issues/1395 Reviewed By: dblaikie, MaskRay Differential Revision: https://reviews.llvm.org/D104342
2021-06-10[IR] make -warn-frame-size into a module attrNick Desaulniers1-0/+11
-Wframe-larger-than= is an interesting warning; we can't know the frame size until PrologueEpilogueInsertion (PEI); very late in the compilation pipeline. -Wframe-larger-than= was propagated through CC1 as an -mllvm flag, then was a cl::opt in LLVM's PEI pass; this meant it was dropped during LTO and needed to be re-specified via -plugin-opt. Instead, make it part of the IR proper as a module level attribute, similar to D103048. Introduce -fwarn-stack-size CC1 option. Reviewed By: rsmith, qcolombet Differential Revision: https://reviews.llvm.org/D103928