aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-08-14 05:53:54 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-17 10:04:37 +0100
commit0b37c9aa8bc765719f05755f9452138e33a9509d (patch)
treee1f621574160ba7e61f110302efd734a6f944867
parenta410611d7af9d20ebd6c9e422fad5ac8c3b4236e (diff)
downloadsparse-dev-0b37c9aa8bc765719f05755f9452138e33a9509d.tar.gz
llvm: give names easier to debug
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>
-rw-r--r--sparse-llvm.c6
-rw-r--r--validation/backend/call-variadic.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sparse-llvm.c b/sparse-llvm.c
index 0139fbca..770ce590 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:
@@ -1144,7 +1144,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);
}
diff --git a/validation/backend/call-variadic.c b/validation/backend/call-variadic.c
index b6e40644..4924e3f1 100644
--- a/validation/backend/call-variadic.c
+++ b/validation/backend/call-variadic.c
@@ -16,10 +16,10 @@ int foo(const char *fmt, int a, long l, int *p)
; ModuleID = '<stdin>'
source_filename = "sparse"
-define i32 @foo(i8* %ARG1, i32 %ARG2, i64 %ARG3, i32* %ARG4) {
+define i32 @foo(i8* %ARG1., i32 %ARG2., i64 %ARG3., i32* %ARG4.) {
L0:
- %R5 = call i32 (i8*, ...) @print(i8* %ARG1, i32 120, i32 %ARG2, i32 8, i64 %ARG3, i64 0, i32* %ARG4, i8* null)
- ret i32 %R5
+ %R5. = call i32 (i8*, ...) @print(i8* %ARG1., i32 120, i32 %ARG2., i32 8, i64 %ARG3., i64 0, i32* %ARG4., i8* null)
+ ret i32 %R5.
}
declare i32 @print(i8*, ...)