From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 4/5] llvm: give names easier to debug
Date: Mon, 18 Sep 2017 11:30:13 +0200 [thread overview]
Message-ID: <20170918093014.11878-5-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170918093014.11878-1-luc.vanoostenryck@gmail.com>
LLVM automatically add an numeric suffix for names
automatically created. So, if intermediate names must
be created for a pseudo whose name was, for example, "%R4",
these new names will be "%R41", "%R42".
This is quite annoying because we can't make the distinction
between these names and the original names, (maybe of some other
pseudos whose names were "%R41" & "%R42).
Change this by adding a "." at the end of each name, as this will
then allow to see what the original name was.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
sparse-llvm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sparse-llvm.c b/sparse-llvm.c
index 3a68d09d9..3fcc88686 100644
--- a/sparse-llvm.c
+++ b/sparse-llvm.c
@@ -277,10 +277,10 @@ static const char *pseudo_name(pseudo_t pseudo, char *buf)
{
switch (pseudo->type) {
case PSEUDO_REG:
- snprintf(buf, MAX_PSEUDO_NAME, "R%d", pseudo->nr);
+ snprintf(buf, MAX_PSEUDO_NAME, "R%d.", pseudo->nr);
break;
case PSEUDO_PHI:
- snprintf(buf, MAX_PSEUDO_NAME, "PHI%d", pseudo->nr);
+ snprintf(buf, MAX_PSEUDO_NAME, "PHI%d.", pseudo->nr);
break;
case PSEUDO_SYM:
case PSEUDO_VAL:
@@ -1141,7 +1141,7 @@ static void output_fn(LLVMModuleRef module, struct entrypoint *ep)
LLVMValueRef arg;
arg = LLVMGetParam(function.fn, i);
- snprintf(name, sizeof(name), "ARG%d", i+1);
+ snprintf(name, sizeof(name), "ARG%d.", i+1);
LLVMSetValueName(arg, name);
}
--
2.14.0
next prev parent reply other threads:[~2017-09-18 9:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 9:30 [PATCH 0/5] extra fixes for LLVM Luc Van Oostenryck
2017-09-18 9:30 ` [PATCH 1/5] llvm: warn instead of assert on global inits Luc Van Oostenryck
2017-09-18 9:30 ` [PATCH 2/5] llvm: gracefully catch impossible type/value Luc Van Oostenryck
2017-09-18 9:30 ` [PATCH 3/5] llvm: add support for float initializer Luc Van Oostenryck
2017-09-18 9:30 ` Luc Van Oostenryck [this message]
2017-09-18 9:30 ` [PATCH 5/5] llvm: only compare void pointers Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918093014.11878-5-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).