Skip to content

Commit

Permalink
Support constant vectors of field elements
Browse files Browse the repository at this point in the history
  • Loading branch information
makxenov authored and nkaskov committed Jul 14, 2023
1 parent bd4df64 commit 3f8f307
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clang/lib/CodeGen/CGExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,11 @@ llvm::Constant *ConstantEmitter::tryEmitPrivate(const APValue &Value,
Inits[I] = llvm::ConstantInt::get(CGM.getLLVMContext(), Elt.getInt());
else if (Elt.isFloat())
Inits[I] = llvm::ConstantFP::get(CGM.getLLVMContext(), Elt.getFloat());
else
else if (Elt.isField()) {
const llvm::FieldElem &Field = Elt.getField();
auto FieldType = llvm::GaloisFieldType::get(CGM.getLLVMContext(), Field.getKind());
Inits[I] = llvm::ConstantField::get(FieldType, Field);
} else
llvm_unreachable("unsupported vector element type");
}
return llvm::ConstantVector::get(Inits);
Expand Down

0 comments on commit 3f8f307

Please sign in to comment.