[clang] [llvm] [DebugInfo] Place local ODR-uniqued types in decl DISubprograms (PR #119001)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 6 09:25:23 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff fdb1bf9b5949b2a97041922405a812a060fce5f4 a7a3f59f3caae556c6613056f634b504d5052964 --extensions h,cpp,c -- clang/test/CodeGenCXX/debug-info-local-types.cpp clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGDebugInfo.h clang/test/CodeGen/debug-info-codeview-unnamed.c clang/test/CodeGen/debug-info-unused-types.c clang/test/CodeGen/debug-info-unused-types.cpp clang/test/CodeGenCXX/debug-info-access.cpp clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp clang/test/CodeGenCXX/debug-info-codeview-unnamed.cpp clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp clang/test/CodeGenCXX/debug-lambda-this.cpp llvm/include/llvm/IR/DIBuilder.h llvm/include/llvm/IR/DebugInfo.h llvm/lib/Bitcode/Reader/MetadataLoader.cpp llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/IR/DIBuilder.cpp llvm/lib/IR/DebugInfo.cpp llvm/lib/IR/Verifier.cpp llvm/lib/Transforms/Utils/CloneFunction.cpp llvm/unittests/Transforms/Utils/CloningTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index e56aef662a..bf67c1d197 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -3903,8 +3903,8 @@ CGDebugInfo::getOrCreateLimitedType(const RecordType *Ty) {
return Res;
}
-llvm::DIScope *
-CGDebugInfo::PickCompositeTypeScope(llvm::DIScope *S, StringRef Identifier) {
+llvm::DIScope *CGDebugInfo::PickCompositeTypeScope(llvm::DIScope *S,
+ StringRef Identifier) {
using llvm::DISubprogram;
// Only adjust the scope for composite types placed into functions.
@@ -3947,9 +3947,8 @@ CGDebugInfo::PickCompositeTypeScope(llvm::DIScope *S, StringRef Identifier) {
DISubprogram *DeclSP = DBuilder.createFunction(
SP->getScope(), SP->getName(), SP->getLinkageName(), SP->getFile(),
- SP->getLine(), SP->getType(), SP->getScopeLine(),
- Flags, SPFlags, SP->getTemplateParams(), nullptr, nullptr,
- SP->getAnnotations());
+ SP->getLine(), SP->getType(), SP->getScopeLine(), Flags, SPFlags,
+ SP->getTemplateParams(), nullptr, nullptr, SP->getAnnotations());
SP->replaceDeclaration(DeclSP);
return DeclSP;
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index c6215951e7..705a1312e1 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -361,10 +361,10 @@ DIBuilder::createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File,
unsigned LineNo, DIScope *Context,
DINodeArray TParams, uint32_t AlignInBits,
DINode::DIFlags Flags, DINodeArray Annotations) {
- auto *T = DIDerivedType::get(VMContext, dwarf::DW_TAG_template_alias, Name, File,
- LineNo, getNonCompileUnitScope(Context), Ty, 0,
- AlignInBits, 0, std::nullopt, std::nullopt, Flags,
- TParams.get(), Annotations);
+ auto *T = DIDerivedType::get(VMContext, dwarf::DW_TAG_template_alias, Name,
+ File, LineNo, getNonCompileUnitScope(Context),
+ Ty, 0, AlignInBits, 0, std::nullopt,
+ std::nullopt, Flags, TParams.get(), Annotations);
if (isa_and_nonnull<DILocalScope>(Context))
getSubprogramNodesTrackingVector(Context).emplace_back(T);
return T;
``````````
</details>
https://github.com/llvm/llvm-project/pull/119001
More information about the cfe-commits
mailing list