by Seo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44455
91177308-0d34-0410-b5e6-
96231b3b80d8
BaseValue = BaseLV.getAddress();
if (E->isArrow()) {
- QualType PTy = cast<PointerType>(BaseExpr->getType())->getPointeeType();
+ QualType Ty = BaseExpr->getType();
+ Ty = cast<PointerType>(Ty.getCanonicalType())->getPointeeType();
BaseValue =
Builder.CreateBitCast(BaseValue,
- llvm::PointerType::get(ConvertType(PTy)), "tmp");
+ llvm::PointerType::get(ConvertType(Ty)), "tmp");
}
} else
BaseValue = EmitScalarExpr(BaseExpr);
--- /dev/null
+// RUN: clang -emit-llvm %s
+
+typedef struct { int i; } Value;
+typedef Value *PValue;
+
+int get_value(PValue v) {
+ return v->i;
+}