summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-06-18 18:46:58 +0000
committerDiego Novillo <dnovillo@google.com>2014-06-18 18:46:58 +0000
commitec2d8233296fd6d8f37880cd750db1f7225f6b3a (patch)
tree3e8bac0e254a106ceaf17c7fba790d636ca98cf9 /lib/IR
parentffbd906558a6bb927ba81570491472393ee7ebac (diff)
downloadllvm-ec2d8233296fd6d8f37880cd750db1f7225f6b3a.tar.gz
llvm-ec2d8233296fd6d8f37880cd750db1f7225f6b3a.tar.bz2
llvm-ec2d8233296fd6d8f37880cd750db1f7225f6b3a.tar.xz
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
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/DiagnosticInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/DiagnosticInfo.cpp b/lib/IR/DiagnosticInfo.cpp
index 6eeb16220e..2727063600 100644
--- a/lib/IR/DiagnosticInfo.cpp
+++ b/lib/IR/DiagnosticInfo.cpp
@@ -128,7 +128,7 @@ void DiagnosticInfoSampleProfile::print(DiagnosticPrinter &DP) const {
}
bool DiagnosticInfoOptimizationRemarkBase::isLocationAvailable() const {
- return getFunction().getParent()->getNamedMetadata("llvm.dbg.cu") != nullptr;
+ return getDebugLoc().isUnknown() == false;
}
void DiagnosticInfoOptimizationRemarkBase::getLocation(StringRef *Filename,