summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp
AgeCommit message (Collapse)Author
2025-03-06[IR] Store Triple in Module (NFC) (#129868)Nikita Popov
The module currently stores the target triple as a string. This means that any code that wants to actually use the triple first has to instantiate a Triple, which is somewhat expensive. The change in #121652 caused a moderate compile-time regression due to this. While it would be easy enough to work around, I think that architecturally, it makes more sense to store the parsed Triple in the module, so that it can always be directly queried. For this change, I've opted not to add any magic conversions between std::string and Triple for backwards-compatibilty purses, and instead write out needed Triple()s or str()s explicitly. This is because I think a decent number of them should be changed to work on Triple as well, to avoid unnecessary conversions back and forth. The only interesting part in this patch is that the default triple is Triple("") instead of Triple() to preserve existing behavior. The former defaults to using the ELF object format instead of unknown object format. We should fix that as well.
2025-01-22[clang][modules] Partially revert 48d0eb518 to fix -gmodules output (#124003)Ben Langmuir
With the changes in 48d0eb518, the CodeGenOptions used to emit .pcm files with -fmodule-format=obj (-gmodules) were the ones from the original invocation, rather than the ones specifically crafted for outputting the pcm. This was causing the pcm to be written with only the debug info and without the __clangast section in some cases (e.g. -O2). This unforunately was not covered by existing tests, because compiling and loading a module within a single compilation load the ast content from the in-memory module cache rather than reading it from the pcm file that was written. This broke bootstrapping a build of clang with modules enabled on Darwin. rdar://143418834
2025-01-17[clang][PCH] Don't try to create standalone debug-info for types marked ↵Michael Buch
nodebug (#123253) Fixes one of the crashes uncovered by https://github.com/llvm/llvm-project/pull/118710 `getOrCreateStandaloneType` asserts that a `DIType` was created for the requested type. If the `Decl` was marked `nodebug`, however, we can't generate debug-info for it, so we would previously trigger the assert. For now keep the assertion around and check the `nodebug` at the callsite.
2025-01-09[CodeGen] Simplify EmitAssemblyHelper and emitBackendOutputFangrui Song
Prepare for -ftime-report change (#122225).
2024-11-16[CodeGen] Remove unused includes (NFC) (#116459)Kazu Hirata
Identified with misc-include-cleaner.
2024-07-23[clang] Split ObjectFilePCHContainerReader from ObjectFilePCHContainerWriter ↵Chuanqi Xu
(#99599) Close https://github.com/llvm/llvm-project/issues/99479 See https://github.com/llvm/llvm-project/issues/99479 for details