Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit ec2d823

Browse files
author
Diego Novillo
committed
Simply test for available locations in optimization remarks.
When emitting optimization remarks, we test for the presence of instruction locations by testing for a valid llvm.dbg.cu annotation. This is slightly inefficient because we can simply ask whether the debug location we have is known or not. Additionally, if my current plan works, I will need to remove the llvm.dbg.cu annotation from the IL (or prevent it from being generated) when -Rpass is used without -g. In those cases, we'll want to generate line tables but we will want to prevent code generation from emitting DWARF code for them. Tested on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211204 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent ffbd906 commit ec2d823

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IR/DiagnosticInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void DiagnosticInfoSampleProfile::print(DiagnosticPrinter &DP) const {
128128
}
129129

130130
bool DiagnosticInfoOptimizationRemarkBase::isLocationAvailable() const {
131-
return getFunction().getParent()->getNamedMetadata("llvm.dbg.cu") != nullptr;
131+
return getDebugLoc().isUnknown() == false;
132132
}
133133

134134
void DiagnosticInfoOptimizationRemarkBase::getLocation(StringRef *Filename,

0 commit comments

Comments
 (0)