Skip to content

Conversation

@adrian-prantl
Copy link
Collaborator

…ontainerGenerator

Currently it remains uninitialized and thus always uses the LLVM default of 4.

…ontainerGenerator Currently it remains uninitialized and thus always uses the LLVM default of 4.
@adrian-prantl adrian-prantl requested a review from a team as a code owner September 11, 2023 23:55
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:modules C++20 modules and Clang Header Modules clang:codegen IR generation bugs: mangling, exceptions, etc. labels Sep 11, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2023

@llvm/pr-subscribers-clang-codegen

Changes

…ontainerGenerator

Currently it remains uninitialized and thus always uses the LLVM default of 4.

Full diff: https://github.com/llvm/llvm-project/pull/66032.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (+1)
  • (modified) clang/test/Modules/ModuleDebugInfo.cpp (+4-1)
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 114a9c1e2eac121..9ffeef026bd1b76 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -160,6 +160,7 @@ class PCHContainerGenerator : public ASTConsumer { LangOpts.CurrentModule.empty() ? MainFileName : LangOpts.CurrentModule; CodeGenOpts.setDebugInfo(llvm::codegenoptions::FullDebugInfo); CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning()); + CodeGenOpts.DwarfVersion = CI.getCodeGenOpts().DwarfVersion; CodeGenOpts.DebugPrefixMap = CI.getInvocation().getCodeGenOpts().DebugPrefixMap; CodeGenOpts.DebugStrictDwarf = CI.getCodeGenOpts().DebugStrictDwarf; diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp index 8f7fa22bcb0b001..4d78324867bcb81 100644 --- a/clang/test/Modules/ModuleDebugInfo.cpp +++ b/clang/test/Modules/ModuleDebugInfo.cpp @@ -6,10 +6,11 @@ // Modules: // RUN: rm -rf %t -// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll +// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -dwarf-version=5 -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll // RUN: cat %t-mod.ll | FileCheck %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s +// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD-DWARF %s // PCH: // RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll @@ -20,6 +21,8 @@ @import DebugCXX; #endif +// CHECK-MOD-DWARF: !"Dwarf Version", i32 5 + // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, 
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2023

@llvm/pr-subscribers-clang-modules

Changes

…ontainerGenerator

Currently it remains uninitialized and thus always uses the LLVM default of 4.

Full diff: https://github.com/llvm/llvm-project/pull/66032.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (+1)
  • (modified) clang/test/Modules/ModuleDebugInfo.cpp (+4-1)
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 114a9c1e2eac12..9ffeef026bd1b7 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -160,6 +160,7 @@ class PCHContainerGenerator : public ASTConsumer { LangOpts.CurrentModule.empty() ? MainFileName : LangOpts.CurrentModule; CodeGenOpts.setDebugInfo(llvm::codegenoptions::FullDebugInfo); CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning()); + CodeGenOpts.DwarfVersion = CI.getCodeGenOpts().DwarfVersion; CodeGenOpts.DebugPrefixMap = CI.getInvocation().getCodeGenOpts().DebugPrefixMap; CodeGenOpts.DebugStrictDwarf = CI.getCodeGenOpts().DebugStrictDwarf; diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp index 8f7fa22bcb0b00..4d78324867bcb8 100644 --- a/clang/test/Modules/ModuleDebugInfo.cpp +++ b/clang/test/Modules/ModuleDebugInfo.cpp @@ -6,10 +6,11 @@ // Modules: // RUN: rm -rf %t -// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll +// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -dwarf-version=5 -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll // RUN: cat %t-mod.ll | FileCheck %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s +// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD-DWARF %s // PCH: // RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll @@ -20,6 +21,8 @@ @import DebugCXX; #endif +// CHECK-MOD-DWARF: !"Dwarf Version", i32 5 + // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, 
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2023

@llvm/pr-subscribers-clang

Changes

…ontainerGenerator

Currently it remains uninitialized and thus always uses the LLVM default of 4.

Full diff: https://github.com/llvm/llvm-project/pull/66032.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (+1)
  • (modified) clang/test/Modules/ModuleDebugInfo.cpp (+4-1)
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 114a9c1e2eac121..9ffeef026bd1b76 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -160,6 +160,7 @@ class PCHContainerGenerator : public ASTConsumer { LangOpts.CurrentModule.empty() ? MainFileName : LangOpts.CurrentModule; CodeGenOpts.setDebugInfo(llvm::codegenoptions::FullDebugInfo); CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning()); + CodeGenOpts.DwarfVersion = CI.getCodeGenOpts().DwarfVersion; CodeGenOpts.DebugPrefixMap = CI.getInvocation().getCodeGenOpts().DebugPrefixMap; CodeGenOpts.DebugStrictDwarf = CI.getCodeGenOpts().DebugStrictDwarf; diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp index 8f7fa22bcb0b001..4d78324867bcb81 100644 --- a/clang/test/Modules/ModuleDebugInfo.cpp +++ b/clang/test/Modules/ModuleDebugInfo.cpp @@ -6,10 +6,11 @@ // Modules: // RUN: rm -rf %t -// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll +// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -dwarf-version=5 -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll // RUN: cat %t-mod.ll | FileCheck %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s +// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD-DWARF %s // PCH: // RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll @@ -20,6 +21,8 @@ @import DebugCXX; #endif +// CHECK-MOD-DWARF: !"Dwarf Version", i32 5 + // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, 
Copy link
Contributor

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed that this fixes the lang/objc/modules-objc-property/TestModulesObjCProperty.py failure we see in the matrix bot for DWARF 5!

@adrian-prantl adrian-prantl merged commit 167acac into llvm:main Sep 12, 2023
adrian-prantl added a commit to swiftlang/llvm-project that referenced this pull request Sep 12, 2023
llvm#66032) …ontainerGenerator Currently it remains uninitialized and thus always uses the LLVM default of 4. (cherry picked from commit 167acac)
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
llvm#66032) …ontainerGenerator Currently it remains uninitialized and thus always uses the LLVM default of 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:codegen IR generation bugs: mangling, exceptions, etc. clang:modules C++20 modules and Clang Header Modules clang Clang issues not falling into any other category

3 participants