From a2bb899a6ba8fe919013ea72e30fc5b57ed92ce2 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 19 Apr 2012 09:34:54 -0700 Subject: [PATCH] Opt debug printing improvement Now, just match the prefix of the provided function name of interest, which allows us to not worry about managing details. --- opt.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opt.cpp b/opt.cpp index dcb6ad87..5a7d1ee6 100644 --- a/opt.cpp +++ b/opt.cpp @@ -103,7 +103,8 @@ static llvm::Pass *CreateMakeInternalFuncsStaticPass(); #define DEBUG_START_PASS(NAME) \ if (g->debugPrint && \ (getenv("FUNC") == NULL || \ - !strcmp(bb.getParent()->getName().str().c_str(), getenv("FUNC")))) { \ + !strncmp(bb.getParent()->getName().str().c_str(), getenv("FUNC"), \ + strlen(getenv("FUNC"))))) { \ fprintf(stderr, "Start of " NAME "\n"); \ fprintf(stderr, "---------------\n"); \ bb.dump(); \ @@ -113,7 +114,8 @@ static llvm::Pass *CreateMakeInternalFuncsStaticPass(); #define DEBUG_END_PASS(NAME) \ if (g->debugPrint && \ (getenv("FUNC") == NULL || \ - !strcmp(bb.getParent()->getName().str().c_str(), getenv("FUNC")))) { \ + !strncmp(bb.getParent()->getName().str().c_str(), getenv("FUNC"), \ + strlen(getenv("FUNC"))))) { \ fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \ fprintf(stderr, "---------------\n"); \ bb.dump(); \