File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ add_llvm_component_library(LLVMCore
78
78
79
79
LINK_COMPONENTS
80
80
BinaryFormat
81
+ Demangle
81
82
Remarks
82
83
Support
83
84
TargetParser
Original file line number Diff line number Diff line change 15
15
#include " llvm/ADT/StringExtras.h"
16
16
#include " llvm/ADT/Twine.h"
17
17
#include " llvm/ADT/iterator_range.h"
18
+ #include " llvm/Demangle/Demangle.h"
18
19
#include " llvm/IR/BasicBlock.h"
19
20
#include " llvm/IR/Constants.h"
20
21
#include " llvm/IR/DebugInfoMetadata.h"
@@ -440,7 +441,8 @@ void llvm::diagnoseDontCall(const CallInst &CI) {
440
441
}
441
442
442
443
void DiagnosticInfoDontCall::print (DiagnosticPrinter &DP) const {
443
- DP << " call to " << getFunctionName () << " marked \" dontcall-" ;
444
+ DP << " call to " << demangle (getFunctionName ().str ())
445
+ << " marked \" dontcall-" ;
444
446
if (getSeverity () == DiagnosticSeverity::DS_Error)
445
447
DP << " error\" " ;
446
448
else
Original file line number Diff line number Diff line change @@ -27,7 +27,34 @@ define void @bar4() {
27
27
ret void
28
28
}
29
29
30
+ declare i32 @_Z3fooi (i32 ) "dontcall-error"
31
+ define void @demangle1 () {
32
+ call i32 @_Z3fooi (i32 0 )
33
+ ret void
34
+ }
35
+ declare float @_Z3barf (float ) "dontcall-error"
36
+ define void @demangle2 () {
37
+ call float @_Z3barf (float 0 .0 )
38
+ ret void
39
+ }
40
+
41
+ declare i32 @_RNvC1a3baz () "dontcall-error"
42
+ define void @demangle3 () {
43
+ call i32 @_RNvC1a3baz ()
44
+ ret void
45
+ }
46
+
47
+
48
+ declare i32 @_Z3fooILi79EEbU7_ExtIntIXT_EEi (i32 ) "dontcall-error"
49
+ define void @demangle4 () {
50
+ call i32 @_Z3fooILi79EEbU7_ExtIntIXT_EEi (i32 0 )
51
+ ret void
52
+ }
30
53
; CHECK: error: call to foo marked "dontcall-error": e
31
54
; CHECK: warning: call to foo2 marked "dontcall-warn": w
32
55
; CHECK: warning: call to foo3 marked "dontcall-warn"{{$}}
33
56
; CHECK: warning: call to foo4 marked "dontcall-warn": cast
57
+ ; CHECK: error: call to foo(int) marked "dontcall-error"
58
+ ; CHECK: error: call to bar(float) marked "dontcall-error"
59
+ ; CHECK: error: call to a::baz marked "dontcall-error"
60
+ ; CHECK: error: call to bool foo<79>(int _ExtInt<79>) marked "dontcall-error"
You can’t perform that action at this time.
0 commit comments