mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
SampleProfile: Check for missing debug locations
Don't use `DebugLoc` accessors if we're pointing at null, which will be a problem after a WIP patch to make the `DIDescriptor` accessors more strict. Caught by Frontend/profile-sample-use-loc-tracking.c (in clang). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232792 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -217,6 +217,9 @@ void SampleProfileLoader::printBlockWeight(raw_ostream &OS, BasicBlock *BB) {
|
|||||||
/// \returns The profiled weight of I.
|
/// \returns The profiled weight of I.
|
||||||
unsigned SampleProfileLoader::getInstWeight(Instruction &Inst) {
|
unsigned SampleProfileLoader::getInstWeight(Instruction &Inst) {
|
||||||
DebugLoc DLoc = Inst.getDebugLoc();
|
DebugLoc DLoc = Inst.getDebugLoc();
|
||||||
|
if (DLoc.isUnknown())
|
||||||
|
return 0;
|
||||||
|
|
||||||
unsigned Lineno = DLoc.getLine();
|
unsigned Lineno = DLoc.getLine();
|
||||||
if (Lineno < HeaderLineno)
|
if (Lineno < HeaderLineno)
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user