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.
This commit is contained in:
6
opt.cpp
6
opt.cpp
@@ -103,7 +103,8 @@ static llvm::Pass *CreateMakeInternalFuncsStaticPass();
|
|||||||
#define DEBUG_START_PASS(NAME) \
|
#define DEBUG_START_PASS(NAME) \
|
||||||
if (g->debugPrint && \
|
if (g->debugPrint && \
|
||||||
(getenv("FUNC") == NULL || \
|
(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, "Start of " NAME "\n"); \
|
||||||
fprintf(stderr, "---------------\n"); \
|
fprintf(stderr, "---------------\n"); \
|
||||||
bb.dump(); \
|
bb.dump(); \
|
||||||
@@ -113,7 +114,8 @@ static llvm::Pass *CreateMakeInternalFuncsStaticPass();
|
|||||||
#define DEBUG_END_PASS(NAME) \
|
#define DEBUG_END_PASS(NAME) \
|
||||||
if (g->debugPrint && \
|
if (g->debugPrint && \
|
||||||
(getenv("FUNC") == NULL || \
|
(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, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \
|
||||||
fprintf(stderr, "---------------\n"); \
|
fprintf(stderr, "---------------\n"); \
|
||||||
bb.dump(); \
|
bb.dump(); \
|
||||||
|
|||||||
Reference in New Issue
Block a user