aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2014-02-13 18:33:01 -0800
committerDan Gohman <sunfish@google.com>2014-02-14 11:00:47 -0800
commit4875328877ab82284e108c6c858ffba929cf8488 (patch)
tree307f57395d200fd524cbdd58252231ca8058b37e
parent076d37969873de21057991b03d901d31c58039e3 (diff)
Respect the requested signedness for pointer values.
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index ac1fdfed10..5c2d94012e 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -517,7 +517,8 @@ std::string JSWriter::getCast(const StringRef &s, const Type *t, AsmCast sign) {
default: llvm_unreachable("Unsupported integer cast bitwidth");
}
}
- case Type::PointerTyID: return (s + "|0").str();
+ case Type::PointerTyID:
+ return (sign == ASM_SIGNED || (sign & ASM_NONSPECIFIC) ? s + "|0" : s + ">>>0").str();
}
}