refactor handling of ocuvector lvalue->rvalue codegen into its own method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-08-03 16:18:34 +00:00
Родитель 5cc2e45e2d
Коммит 34cdc86af5
2 изменённых файлов: 57 добавлений и 48 удалений

Просмотреть файл

@ -285,7 +285,16 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, QualType ExprType) {
// If this is a reference to a subset of the elements of a vector, either
// shuffle the input or extract/insert them as appropriate.
if (LV.isOCUVectorComp()) {
if (LV.isOCUVectorComp())
return EmitLoadOfOCUComponentLValue(LV, ExprType);
assert(0 && "Bitfield ref not impl!");
}
// If this is a reference to a subset of the elements of a vector, either
// shuffle the input or extract/insert them as appropriate.
RValue CodeGenFunction::EmitLoadOfOCUComponentLValue(LValue LV,
QualType ExprType) {
llvm::Value *Vec = Builder.CreateLoad(LV.getOCUVectorAddr(), "tmp");
unsigned EncFields = LV.getOCUVectorComp();
@ -334,8 +343,6 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, QualType ExprType) {
return RValue::get(Result);
}
assert(0 && "Bitfield ref not impl!");
}
RValue CodeGenFunction::EmitLoadOfLValue(const Expr *E) {
return EmitLoadOfLValue(EmitLValue(E), E->getType());

Просмотреть файл

@ -316,6 +316,8 @@ public:
/// rvalue, returning the rvalue.
RValue EmitLoadOfLValue(const Expr *E);
RValue EmitLoadOfLValue(LValue V, QualType LVType);
RValue EmitLoadOfOCUComponentLValue(LValue V, QualType LVType);
/// EmitStoreThroughLValue - Store the specified rvalue into the specified
/// lvalue, where both are guaranteed to the have the same type, and that type