This reverts commit c3a935e3f9.
The only change to the reverted commit is that this also updates
the OCaml bindings according to the C debug-info API changes.
The build failure originally introduced was:
```
FAILED: bindings/ocaml/debuginfo/debuginfo_ocaml.o /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo/debuginfo_ocaml.o
cd /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo && /usr/bin/ocamlfind ocamlc -c /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo/debuginfo_ocaml.c -ccopt "-I/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/bindings/ocaml/debuginfo/../llvm -D_GNU_SOURCE -D_DEBUG -D_GLIBCXX_ASSERTIONS -DEXPENSIVE_CHECKS -D_GLIBCXX_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-clang-x86_64-expensive-checks-debian/build/include -I/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include -DNDEBUG "
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo/debuginfo_ocaml.c: In function ‘llvm_dibuild_create_object_pointer_type’:
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo/debuginfo_ocaml.c:620:30: error: too few arguments to function ‘LLVMDIBuilderCreateObjectPointerType’
620 | LLVMMetadataRef Metadata = LLVMDIBuilderCreateObjectPointerType(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bindings/ocaml/debuginfo/debuginfo_ocaml.c:23:
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm-c/DebugInfo.h:880:17: note: declared here
880 | LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
29 lines
866 B
C++
29 lines
866 B
C++
// RUN: %clang_cc1 -x c++ -std=c++23 -debug-info-kind=limited -emit-llvm < %s | FileCheck %s
|
|
|
|
// CHECK: !DISubprogram(name: "bar",
|
|
// CHECK-SAME: flags: DIFlagPrototyped
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_pointer_type
|
|
// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer
|
|
//
|
|
// CHECK: !DISubprogram(name: "explicit_this",
|
|
// flags: DIFlagPrototyped
|
|
//
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_rvalue_reference_type
|
|
// CHECK-SAME: flags: DIFlagObjectPointer)
|
|
//
|
|
// CHECK: !DILocalVariable(name: "this", arg: 1
|
|
// CHECK-SAME: flags: DIFlagArtificial | DIFlagObjectPointer
|
|
//
|
|
// CHECK-NOT: DIFlagArtificial
|
|
// CHECK: !DILocalVariable(arg: 1, {{.*}}, flags: DIFlagObjectPointer)
|
|
|
|
struct Foo {
|
|
void bar() {}
|
|
void explicit_this(this Foo &&) {}
|
|
};
|
|
|
|
void f() {
|
|
Foo{}.bar();
|
|
Foo{}.explicit_this();
|
|
}
|