CGExprScalar.cpp (203955) | CGExprScalar.cpp (204793) |
---|---|
1//===--- CGExprScalar.cpp - Emit LLVM Code for Scalar Exprs ---------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 1874 unchanged lines hidden (view full) --- 1883 // build Class* type 1884 const llvm::Type *ClassPtrTy = ConvertType(E->getType()); 1885 1886 Expr *BaseExpr = E->getBase(); 1887 if (BaseExpr->isLvalue(getContext()) != Expr::LV_Valid) { 1888 V = CreateTempAlloca(ClassPtrTy, "resval"); 1889 llvm::Value *Src = EmitScalarExpr(BaseExpr); 1890 Builder.CreateStore(Src, V); | 1//===--- CGExprScalar.cpp - Emit LLVM Code for Scalar Exprs ---------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 1874 unchanged lines hidden (view full) --- 1883 // build Class* type 1884 const llvm::Type *ClassPtrTy = ConvertType(E->getType()); 1885 1886 Expr *BaseExpr = E->getBase(); 1887 if (BaseExpr->isLvalue(getContext()) != Expr::LV_Valid) { 1888 V = CreateTempAlloca(ClassPtrTy, "resval"); 1889 llvm::Value *Src = EmitScalarExpr(BaseExpr); 1890 Builder.CreateStore(Src, V); |
1891 LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType())); 1892 V = ScalarExprEmitter(*this).EmitLoadOfLValue(LV, E->getType()); |
|
1891 } 1892 else { 1893 if (E->isArrow()) 1894 V = ScalarExprEmitter(*this).EmitLoadOfLValue(BaseExpr); 1895 else 1896 V = EmitLValue(BaseExpr).getAddress(); 1897 } 1898 1899 // build Class* type 1900 ClassPtrTy = ClassPtrTy->getPointerTo(); 1901 V = Builder.CreateBitCast(V, ClassPtrTy); 1902 LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType())); 1903 return LV; 1904} 1905 | 1893 } 1894 else { 1895 if (E->isArrow()) 1896 V = ScalarExprEmitter(*this).EmitLoadOfLValue(BaseExpr); 1897 else 1898 V = EmitLValue(BaseExpr).getAddress(); 1899 } 1900 1901 // build Class* type 1902 ClassPtrTy = ClassPtrTy->getPointerTo(); 1903 V = Builder.CreateBitCast(V, ClassPtrTy); 1904 LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType())); 1905 return LV; 1906} 1907 |