[PATCH] D70524: Support DebugInfo generation for auto return type for C++ functions.

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 11:29:25 PST 2019


aprantl added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:2925
+        return C.getQualifiedType(T.getTypePtr(), Quals);
+      }
     case Type::DeducedTemplateSpecialization: {
----------------
aprantl wrote:
> You need to mark this `LLVM_FALLTHROUGH` now or you'll get a warning.
The FALLTHROUGH must come right before the next `case`


================
Comment at: clang/test/CodeGenCXX/debug-info-auto-return.cpp:7
+
+// CHECK: !DISubprogram(name: "findMax",{{.*}}, type: !18
+// CHECK: !18 =  !DISubroutineType(types: !19)
----------------
aprantl wrote:
> Please don't hardcode the MDNode numbers, they will inevitably change over time. Instead use variables:
> ```
> type: ![[SUBROUTINE_TYPE:[0-9]+]]`
> // CHECK: ![[SUBROUTINE_TYPE]] =  !DISubroutineType(types: ![[ARGS:[0-9]+)
> ```
> etc
you still need to make sure that the two nodes CHECKed are being connected. Please use variables like in the example I posted.


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

https://reviews.llvm.org/D70524





More information about the cfe-commits mailing list