mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[Debugify] Don't check functions which were skipped
If no debug info was applied to a function, its debug info shouldn't be checked (it doesn't have any :). llvm-svn: 325297
This commit is contained in:
parent
876c4c505d
commit
3cc2ae8384
@ -19,6 +19,8 @@
|
||||
; RUN: opt -enable-debugify -strip -S -o - < %s | \
|
||||
; RUN: FileCheck %s -check-prefix=CHECK-FAIL
|
||||
|
||||
; RUN: opt -enable-debugify -S -o - < %s | FileCheck %s -check-prefix=PASS
|
||||
|
||||
; CHECK-LABEL: define void @foo
|
||||
define void @foo() {
|
||||
; CHECK: ret void, !dbg ![[RET1:.*]]
|
||||
@ -79,3 +81,5 @@ define weak_odr zeroext i1 @baz() {
|
||||
; CHECK-FAIL: WARNING: Missing line 4
|
||||
; CHECK-FAIL: ERROR: Missing variable 1
|
||||
; CHECK-FAIL: CheckDebugify: FAIL
|
||||
|
||||
; PASS: CheckDebugify: PASS
|
||||
|
@ -35,6 +35,10 @@ using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
bool isFunctionSkipped(Function &F) {
|
||||
return F.isDeclaration() || !F.hasExactDefinition();
|
||||
}
|
||||
|
||||
bool applyDebugifyMetadata(Module &M) {
|
||||
// Skip modules with debug info.
|
||||
if (M.getNamedMetadata("llvm.dbg.cu")) {
|
||||
@ -67,7 +71,7 @@ bool applyDebugifyMetadata(Module &M) {
|
||||
|
||||
// Visit each instruction.
|
||||
for (Function &F : M) {
|
||||
if (F.isDeclaration() || !F.hasExactDefinition())
|
||||
if (isFunctionSkipped(F))
|
||||
continue;
|
||||
|
||||
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
||||
@ -134,6 +138,9 @@ void checkDebugifyMetadata(Module &M) {
|
||||
// Find missing lines.
|
||||
BitVector MissingLines{OriginalNumLines, true};
|
||||
for (Function &F : M) {
|
||||
if (isFunctionSkipped(F))
|
||||
continue;
|
||||
|
||||
for (Instruction &I : instructions(F)) {
|
||||
if (isa<DbgValueInst>(&I))
|
||||
continue;
|
||||
@ -156,6 +163,9 @@ void checkDebugifyMetadata(Module &M) {
|
||||
// Find missing variables.
|
||||
BitVector MissingVars{OriginalNumVars, true};
|
||||
for (Function &F : M) {
|
||||
if (isFunctionSkipped(F))
|
||||
continue;
|
||||
|
||||
for (Instruction &I : instructions(F)) {
|
||||
auto *DVI = dyn_cast<DbgValueInst>(&I);
|
||||
if (!DVI)
|
||||
|
Loading…
x
Reference in New Issue
Block a user