зеркало из https://github.com/microsoft/clang-1.git
Fix a typo that prevented pointer-to-int conversions from working.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
0bd41f2cea
Коммит
50b5a30db4
|
@ -334,7 +334,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
|
|||
if (isa<PointerType>(SrcType)) {
|
||||
// Must be an ptr to int cast.
|
||||
assert(isa<llvm::IntegerType>(DstTy) && "not ptr->int?");
|
||||
return Builder.CreateIntToPtr(Src, DstTy, "conv");
|
||||
return Builder.CreatePtrToInt(Src, DstTy, "conv");
|
||||
}
|
||||
|
||||
// Finally, we have the arithmetic types: real int/float.
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// RUN: clang -emit-llvm %s
|
||||
|
||||
int test(void* i)
|
||||
{
|
||||
return (int)i;
|
||||
}
|
Загрузка…
Ссылка в новой задаче