[PATCH] D68117: [DWARF-5] Support for C++11 defaulted, deleted member functions.

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 13:48:41 PDT 2019


aprantl added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1610
+  if (const auto *CXXC = dyn_cast<CXXConstructorDecl>(Method)) {
+    if (CXXC->getCanonicalDecl()->isDeleted())
+      SPFlags |= llvm::DISubprogram::SPFlagDeleted;
----------------
can you factor this block out into a static function or lambda, since it is repeated three times?


================
Comment at: clang/test/CodeGenCXX/debug-info-defaulted-in-class.cpp:6
+// RUN:   -O0 -disable-llvm-passes \
+// RUN:   -debug-info-kind=standalone -dwarf-version=5 \
+// RUN: | FileCheck %s -check-prefix=ATTR
----------------
the -dwarf-version flag should be unnecessary now, right?


================
Comment at: clang/test/CodeGenCXX/debug-info-defaulted-out-of-class.cpp:6
+// RUN:   -O0 -disable-llvm-passes \
+// RUN:   -debug-info-kind=standalone -dwarf-version=5 \
+// RUN: | FileCheck %s -check-prefix=ATTR
----------------
same here


================
Comment at: clang/test/CodeGenCXX/debug-info-not-defaulted.cpp:3
+
+//Supported: DWARF5, -O0, standalone DI
+// RUN: %clang_cc1 -emit-llvm -triple x86_64-linux-gnu %s -o - \
----------------
and here


================
Comment at: llvm/include/llvm/IR/DebugInfoFlags.def:91
 HANDLE_DISP_FLAG((1u << 8), MainSubprogram)
+HANDLE_DISP_FLAG((1u << 9), NotDefaulted)
+HANDLE_DISP_FLAG((1u << 10), DefaultedInClass)
----------------
Since these are all mutually exclusive, it might make sense to do the same thing as we did for virtuality above and thus save a bit or two.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68117/new/

https://reviews.llvm.org/D68117





More information about the cfe-commits mailing list