mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-14 02:43:23 +01:00
Don't set TypePointer::isunsigned to true in the frontend.
The previous solution was problematic because the change was language- visble via the isUnsigned trait. Now, pointers are simply explicitly checked for in the relevant places. (Note that there might be cases in the diff where a direct isunsigned() call would have been appropriate – I only checked for instances where the type clearly cannot be a pointer, but chose to go the safe route in replicating existing behavior otherwise). Fixes DMD testcase 'traits'.
This commit is contained in:
@@ -74,7 +74,7 @@ DValue* DtoBinDiv(Type* targettype, DValue* lhs, DValue* rhs)
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFDiv(l, r, "tmp");
|
||||
else if (!t->isunsigned())
|
||||
else if (!isLLVMUnsigned(t))
|
||||
res = gIR->ir->CreateSDiv(l, r, "tmp");
|
||||
else
|
||||
res = gIR->ir->CreateUDiv(l, r, "tmp");
|
||||
@@ -92,7 +92,7 @@ DValue* DtoBinRem(Type* targettype, DValue* lhs, DValue* rhs)
|
||||
LLValue* res;
|
||||
if (t->isfloating())
|
||||
res = gIR->ir->CreateFRem(l, r, "tmp");
|
||||
else if (!t->isunsigned())
|
||||
else if (!isLLVMUnsigned(t))
|
||||
res = gIR->ir->CreateSRem(l, r, "tmp");
|
||||
else
|
||||
res = gIR->ir->CreateURem(l, r, "tmp");
|
||||
|
||||
Reference in New Issue
Block a user