[PATCH] D39503: Let replaceVTableHolder accept any type

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 14:02:31 PDT 2017


aprantl added inline comments.


================
Comment at: test/DebugInfo/Generic/containing-type-extension.ll:7
+; Make sure we correctly handle context of a subprogram being a type identifier.
+; CHECK: [[SP:.*]]: DW_TAG_structure_type
+; CHECK: DW_AT_containing_type [DW_FORM_ref4]       (cu + {{.*}}
----------------
you probably want a `CHECK-NOT: TAG` here to avoid matching beyond the current tag
alternatively you can use llvm-dwarfdump --name vtable


================
Comment at: test/DebugInfo/Generic/containing-type-extension.ll:19
+
+attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
----------------
we usually strip out all non-essential attributes (everything in quotes) from testcases.


================
Comment at: test/DebugInfo/Generic/containing-type-extension.ll:24
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !15, imports: !2)
+!1 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test")
----------------
Why not use DW_LANG_Rust and an actual example?


================
Comment at: unittests/IR/MetadataTest.cpp:1317
   EXPECT_EQ(VTableHolder, N->getVTableHolder());
+  // As an extension, the containing type can be anything.
+  DIType *BasicType = getBasicType("basic");
----------------
Maybe you can specifically call out Rust as a user here.


Repository:
  rL LLVM

https://reviews.llvm.org/D39503





More information about the llvm-commits mailing list