<div dir="ltr">Looks like this is only the test, but not the functionality? What was the patch that committed the functionality? (I see a clang commit, but I guess there was probably an LLVM change somewhere to use the DIFlag to produce the actual DWARF attribute?)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 16, 2019 at 9:28 AM Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: adrian<br>
Date: Wed Oct 16 09:30:38 2019<br>
New Revision: 375012<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=375012&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=375012&view=rev</a><br>
Log:<br>
[DWARF5] Added support for DW_AT_noreturn attribute to be emitted for<br>
C++ class member functions.<br>
<br>
Patch by Sourabh Singh Tomar!<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D68697" rel="noreferrer" target="_blank">https://reviews.llvm.org/D68697</a><br>
<br>
Modified:<br>
llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll?rev=375012&r1=375011&r2=375012&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll?rev=375012&r1=375011&r2=375012&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/noreturn_cpp11.ll Wed Oct 16 09:30:38 2019<br>
@@ -2,56 +2,88 @@<br>
; REQUIRES: object-emission<br>
<br>
; Generated by clang++ -S -c -std=c++11 --emit-llvm -g from the following C++11 source:<br>
-; [[ noreturn ]] void f() {<br>
-; throw 1;<br>
-; }<br>
+;class foo {<br>
+;[[noreturn]] void foo_member(){throw 1;}<br>
+;};<br>
+;<br>
+;[[ noreturn ]] void f() {<br>
+; throw 1;<br>
+;}<br>
+;<br>
+;void func(){<br>
+; foo object;<br>
+;}<br>
<br>
; CHECK: DW_TAG_subprogram<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_name{{.*}}"f"<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_noreturn<br>
-<br>
+; CHECK: DW_TAG_class_type<br>
+; CHECK: DW_TAG_subprogram<br>
+; CHECK: DW_AT_name{{.*}}"foo_member"<br>
+; CHECK: DW_AT_noreturn<br>
; ModuleID = 'test.cpp'<br>
-source_filename = "test.cpp"<br>
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>
+<br>
+source_filename = "noreturn1.cpp"<br>
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"<br>
target triple = "x86_64-unknown-linux-gnu"<br>
<br>
-@_ZTIi = external constant i8*<br>
+%class.foo = type { i8 }<br>
<br>
-; Function Attrs: noreturn<br>
-define void @_Z1fv() #0 !dbg !6 {<br>
-entry:<br>
- %exception = call i8* @__cxa_allocate_exception(i64 4) #1, !dbg !9<br>
- %0 = bitcast i8* %exception to i32*, !dbg !9<br>
- store i32 1, i32* %0, align 16, !dbg !9<br>
- call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #2, !dbg !10<br>
- unreachable, !dbg !9<br>
+@_ZTIi = external dso_local constant i8*<br>
<br>
-return: ; No predecessors!<br>
- ret void, !dbg !12<br>
+; Function Attrs: noinline noreturn optnone uwtable<br>
+define dso_local void @_Z1fv() #0 !dbg !7 {<br>
+ %1 = call i8* @__cxa_allocate_exception(i64 4) #3, !dbg !10<br>
+ %2 = bitcast i8* %1 to i32*, !dbg !10<br>
+ store i32 1, i32* %2, align 16, !dbg !10<br>
+ call void @__cxa_throw(i8* %1, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #4, !dbg !10<br>
+ unreachable, !dbg !10<br>
}<br>
<br>
-declare i8* @__cxa_allocate_exception(i64)<br>
+declare dso_local i8* @__cxa_allocate_exception(i64)<br>
+<br>
+declare dso_local void @__cxa_throw(i8*, i8*, i8*)<br>
+<br>
+; Function Attrs: noinline nounwind optnone uwtable<br>
+define dso_local void @_Z4funcv() #1 !dbg !11 {<br>
+ %1 = alloca %class.foo, align 1<br>
+ call void @llvm.dbg.declare(metadata %class.foo* %1, metadata !12, metadata !DIExpression()), !dbg !19<br>
+ ret void, !dbg !20<br>
+}<br>
<br>
-declare void @__cxa_throw(i8*, i8*, i8*)<br>
+; Function Attrs: nounwind readnone speculatable willreturn<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #2<br>
<br>
-attributes #0 = { noreturn }<br>
+attributes #0 = { noinline noreturn optnone uwtable }<br>
+attributes #1 = { noinline nounwind optnone uwtable }<br>
+attributes #2 = { nounwind readnone speculatable willreturn }<br>
+attributes #3 = { nounwind }<br>
+attributes #4 = { noreturn }<br>
<br>
!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
-!llvm.module.flags = !{!3, !4}<br>
-!llvm.ident = !{!5}<br>
+!llvm.module.flags = !{!3, !4, !5}<br>
+!llvm.ident = !{!6}<br>
<br>
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 4.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)<br>
-!1 = !DIFile(filename: "test.cpp", directory: "/home/del/test")<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11, file: !1, producer: "clang version 10.0.0 (<a href="https://github.com/llvm/llvm-project.git" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project.git</a> 3fcdd25ad5566114ac3322dcbf71d3c38bfec1ed)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)<br>
+!1 = !DIFile(filename: "test.cpp", directory: "/home/sourabh/work/dwarf/c_c++/c++11")<br>
!2 = !{}<br>
!3 = !{i32 2, !"Dwarf Version", i32 4}<br>
!4 = !{i32 2, !"Debug Info Version", i32 3}<br>
-!5 = !{!"clang version 4.0.0"}<br>
-!6 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped | DIFlagNoReturn, isOptimized: false, unit: !0, retainedNodes: !2)<br>
-!7 = !DISubroutineType(types: !8)<br>
-!8 = !{null}<br>
-!9 = !DILocation(line: 2, column: 5, scope: !6)<br>
-!10 = !DILocation(line: 2, column: 5, scope: !11)<br>
-!11 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 1)<br>
-!12 = !DILocation(line: 3, column: 1, scope: !6)<br>
+!5 = !{i32 1, !"wchar_size", i32 4}<br>
+!6 = !{!"clang version 10.0.0 (<a href="https://github.com/llvm/llvm-project.git" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project.git</a> 3fcdd25ad5566114ac3322dcbf71d3c38bfec1ed)"}<br>
+!7 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)<br>
+!8 = !DISubroutineType(types: !9)<br>
+!9 = !{null}<br>
+!10 = !DILocation(line: 6, column: 5, scope: !7)<br>
+!11 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", scope: !1, file: !1, line: 9, type: !8, scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)<br>
+!12 = !DILocalVariable(name: "object", scope: !11, file: !1, line: 10, type: !13)<br>
+!13 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !14, identifier: "_ZTS3foo")<br>
+!14 = !{!15}<br>
+!15 = !DISubprogram(name: "foo_member", linkageName: "_ZN3foo10foo_memberEv", scope: !13, file: !1, line: 2, type: !16, scopeLine: 2, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: 0)<br>
+!16 = !DISubroutineType(types: !17)<br>
+!17 = !{null, !18}<br>
+!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)<br>
+!19 = !DILocation(line: 10, column: 9, scope: !11)<br>
+!20 = !DILocation(line: 11, column: 1, scope: !11)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>