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:
Matt Pharr
2012-04-19 09:34:54 -07:00
parent 9fedb1674e
commit a2bb899a6b

View File

@@ -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(); \