mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add option -sil-print-debuginfo-verbose
The option -sil-print-debuginfo-verbose will print the values of the fields, implicit, and autoGenerated for a SILLocation, as well as whether the SILLocation is considered hidden from debug information by calling SILLocation::isHiddenFromDebugInfo()
This commit is contained in:
@@ -73,6 +73,11 @@ llvm::cl::opt<bool>
|
||||
SILPrintDebugInfo("sil-print-debuginfo", llvm::cl::init(false),
|
||||
llvm::cl::desc("Include debug info in SIL output"));
|
||||
|
||||
llvm::cl::opt<bool>
|
||||
SILPrintDebugInfoVerbose("sil-print-debuginfo-verbose",
|
||||
llvm::cl::init(false),
|
||||
llvm::cl::desc("Print verbose debug info output"));
|
||||
|
||||
llvm::cl::opt<bool>
|
||||
SILPrintSourceInfo("sil-print-sourceinfo", llvm::cl::init(false),
|
||||
llvm::cl::desc("Include source annotation in SIL output"));
|
||||
@@ -1132,6 +1137,22 @@ public:
|
||||
*this << "* ";
|
||||
*this << QuotedString(DL.filename) << ':' << DL.line << ':'
|
||||
<< (unsigned)DL.column;
|
||||
if (SILPrintDebugInfoVerbose) {
|
||||
if (Loc.isImplicit())
|
||||
*this << " isImplicit: " << "true";
|
||||
else
|
||||
*this << " isImplicit: " << "false";
|
||||
|
||||
if (Loc.isAutoGenerated())
|
||||
*this << ", isAutoGenerated: " << "true";
|
||||
else
|
||||
*this << ", isAutoGenerated: " << "false";
|
||||
|
||||
if (Loc.isHiddenFromDebugInfo())
|
||||
*this << ", isHiddenFromDebugInfo: " << "true";
|
||||
else
|
||||
*this << ", isHiddenFromDebugInfo: " << "false";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
12
test/DebugInfo/sil-print-debuginfo-verbose.swift
Normal file
12
test/DebugInfo/sil-print-debuginfo-verbose.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
// RUN: %target-swift-frontend %s -Xllvm -sil-print-debuginfo -Xllvm -sil-print-debuginfo-verbose -emit-sil -Onone -g -o - | %FileCheck %s
|
||||
// CHECK: %0 = alloc_stack [var_decl] $Int64, var, name "x", type $Int64, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: %1 = integer_literal $Builtin.Int64, 1, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: %2 = struct $Int64 (%1), loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: store %2 to %0, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: dealloc_stack %0, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: %5 = tuple (), loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
// CHECK-NEXT: return %5, loc {{.*}} isImplicit: false, isAutoGenerated: false, isHiddenFromDebugInfo: false
|
||||
|
||||
func main() {
|
||||
var x : Int64 = 1
|
||||
}
|
||||
Reference in New Issue
Block a user