[clang] 3fe465f - Revert "[DebugInfo] Add an attribute to force type info to be emitted for"

Amy Huang via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 10:18:50 PST 2021


Author: Amy Huang
Date: 2021-02-12T10:18:17-08:00
New Revision: 3fe465fb2cd64cd7bd910c761920e3378fe8d1b0

URL: https://github.com/llvm/llvm-project/commit/3fe465fb2cd64cd7bd910c761920e3378fe8d1b0
DIFF: https://github.com/llvm/llvm-project/commit/3fe465fb2cd64cd7bd910c761920e3378fe8d1b0.diff

LOG: Revert "[DebugInfo] Add an attribute to force type info to be emitted for"

Didn't mean to commit this.

This reverts commit 1b5c2915a2318705727ada586290de15e2cad202.

Added: 
    

Modified: 
    clang/include/clang/Basic/Attr.td
    clang/lib/CodeGen/CGDebugInfo.cpp

Removed: 
    clang/test/CodeGenCXX/debug-info-emit-as-needed-attribute.cpp


################################################################################
diff  --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 5bddef1b4ef2..bc2d8ceeeb6c 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1660,13 +1660,6 @@ def NoDebug : InheritableAttr {
   let Documentation = [NoDebugDocs];
 }
 
-def DebugTypeInfoAsNeeded : InheritableAttr {
-  let Spellings = [Clang<"debug_type_info_as_needed">];
-  let Subjects = SubjectList<[CXXRecord]>;
-  let Documentation = [Undocumented];
-  let SimpleHandler = 1;
-}
-
 def NoDuplicate : InheritableAttr {
   let Spellings = [Clang<"noduplicate">];
   let Subjects = SubjectList<[Function]>;

diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index ef17983b446a..48b9bf049f48 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2344,10 +2344,6 @@ static bool shouldOmitDefinition(codegenoptions::DebugInfoKind DebugKind,
   if (!CXXDecl)
     return false;
 
-  // Don't omit definition if marked with attribute.
-  if (RD->hasAttr<DebugTypeInfoAsNeededAttr>())
-    return false;
-
   // Only emit complete debug info for a dynamic class when its vtable is
   // emitted.  However, Microsoft debuggers don't resolve type information
   // across DLL boundaries, so skip this optimization if the class or any of its

diff  --git a/clang/test/CodeGenCXX/debug-info-emit-as-needed-attribute.cpp b/clang/test/CodeGenCXX/debug-info-emit-as-needed-attribute.cpp
deleted file mode 100644
index a2f0eae314c8..000000000000
--- a/clang/test/CodeGenCXX/debug-info-emit-as-needed-attribute.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// RUN: %clang_cc1 -DSETATTR=0 -emit-llvm -std=c++14 -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=DEBUG
-// RUN: %clang_cc1 -DSETATTR=1 -emit-llvm -std=c++14 -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=WITHATTR
-
-#if SETATTR
-#define DEBUGASNEEDED __attribute__((debug_type_info_as_needed))
-#else
-#define DEBUGASNEEDED
-#endif
-
-// Struct that isn't constructed, so its full type info should be omitted with
-// -debug-info-kind=constructor.
-struct DEBUGASNEEDED some_struct {
-  some_struct() {}
-};
-
-void func1(some_struct s) {}
-// void func2() { func1(); }
-// DEBUG:  !DICompositeType({{.*}}name: "some_struct"
-// DEBUG-SAME:              flags: {{.*}}DIFlagFwdDecl
-// WITHATTR: !DICompositeType({{.*}}name: "some_struct"
-// WITHATTR-NOT: DIFlagFwdDecl
-


        


More information about the cfe-commits mailing list