[PATCH] D29203: Change debug-info-for-profiling from a TargetOption to a function attribute.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 14:18:31 PST 2017


dblaikie added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1140-1142
+  void setDebugInfoForProfiling(bool DebugInfoForProfiling) {
+    this->DebugInfoForProfiling = DebugInfoForProfiling;
+  }
----------------
I don't think this accessor is needed


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.h:266-268
+  /// Emit debug info for profiling
+  bool HasDebugInfoForProfiling;
+
----------------
Presumably this (& the accessor below) can be removed now?


================
Comment at: lib/IR/Module.cpp:468-475
+bool Module::getDebugInfoForProfiling() const {
+  auto *Val =
+      cast_or_null<ConstantAsMetadata>(getModuleFlag("DebugInfoForProfiling"));
+  if (!Val)
+    return false;
+  return cast<ConstantInt>(Val->getValue())->getZExtValue();
+}
----------------
Presumably this should go away now that it's in the CU metadata.


================
Comment at: test/DebugInfo/Generic/gmlt.test:2
 ; REQUIRES: object-emission
 ; RUN: %llc_dwarf -O0 -filetype=obj < %S/../Inputs/gmlt.ll | llvm-dwarfdump - | FileCheck %S/../Inputs/gmlt.ll
+; RUN: %llc_dwarf -O0 -filetype=obj < %S/../Inputs/gmlt_profiling.ll | llvm-dwarfdump - | FileCheck %S/../Inputs/gmlt_profiling.ll
----------------
This line should probably be in gmlt.ll (both gmlt.ll and gmlt_profiling.ll would move from test/DebugInfo/Inputs to test/DebugInfo/Generic)


================
Comment at: test/DebugInfo/Generic/gmlt.test:3
 ; RUN: %llc_dwarf -O0 -filetype=obj < %S/../Inputs/gmlt.ll | llvm-dwarfdump - | FileCheck %S/../Inputs/gmlt.ll
-; RUN: %llc_dwarf -O0 -filetype=obj -debug-info-for-profiling < %S/../Inputs/gmlt.ll | llvm-dwarfdump - | FileCheck %S/../Inputs/gmlt.ll --check-prefixes=PROFILING
+; RUN: %llc_dwarf -O0 -filetype=obj < %S/../Inputs/gmlt_profiling.ll | llvm-dwarfdump - | FileCheck %S/../Inputs/gmlt_profiling.ll
 
----------------
This line should probably be in gmlt_profiling.ll


https://reviews.llvm.org/D29203





More information about the llvm-commits mailing list