From 10ec44d87a47bd28c1603c56f5a5c48fc1c2b462 Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Tue, 24 Jun 2014 17:02:03 +0000 Subject: Add new debug kind LocTrackingOnly. Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-pass-remarks, -pass-remarks-missed and -pass-remarks-analysis). To prevent debug info emission, DIBuilder never inserts the annotation 'llvm.dbg.cu' when LocTrackingOnly is enabled. Reviewers: echristo, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211609 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DIBuilder.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/llvm/IR/DIBuilder.h b/include/llvm/IR/DIBuilder.h index 8b05bbb4fd..2673504096 100644 --- a/include/llvm/IR/DIBuilder.h +++ b/include/llvm/IR/DIBuilder.h @@ -108,12 +108,23 @@ namespace llvm { /// Objective-C. /// @param SplitName The name of the file that we'll split debug info out /// into. + /// @param Kind The kind of debug information to generate. + /// @param EmitDebugInfo A boolean flag which indicates whether debug + /// information should be written to the final + /// output or not. When this is false, debug + /// information annotations will be present in + /// the IL but they are not written to the final + /// assembly or object file. This supports tracking + /// source location information in the back end + /// without actually changing the output (e.g., + /// when using optimization remarks). DICompileUnit createCompileUnit(unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName = StringRef(), - DebugEmissionKind Kind = FullDebug); + DebugEmissionKind Kind = FullDebug, + bool EmitDebugInfo = true); /// createFile - Create a file descriptor to hold debugging information /// for a file. -- cgit v1.2.3