================ @@ -0,0 +1,90 @@ +#include "CIRGenTypes.h" + +#include "CIRGenModule.h" + +#include "clang/AST/ASTContext.h" +#include "clang/AST/Type.h" + +using namespace clang; +using namespace clang::CIRGen; + +CIRGenTypes::CIRGenTypes(CIRGenModule &genModule) + : cgm(genModule), context(genModule.getASTContext()) {} + +CIRGenTypes::~CIRGenTypes() {} + +mlir::Type CIRGenTypes::convertType(QualType type) { + type = context.getCanonicalType(type); + const Type *ty = type.getTypePtr(); + + mlir::Type resultType = nullptr; + switch (ty->getTypeClass()) { + case Type::Builtin: { + switch (cast<BuiltinType>(ty)->getKind()) { + // Signed types. + case BuiltinType::Accum: + case BuiltinType::Char_S: + case BuiltinType::Fract: + case BuiltinType::Int: + case BuiltinType::Int128: + case BuiltinType::Long: + case BuiltinType::LongAccum: ---------------- dkolsen-pgi wrote:
I have now removed all of the fixed-point related types (not just the saturation arithmetic types) from `CIRGenTypes::convertType`. Those types will now result in a "Not Yet Implemented" error message. All of the `BuiltinType`s listed in `CIRGenTypes::convertType` are now tested in the test case for this change. (Except that I can't test both `Char_S` and `Char_U` in the same compilation, since the type `char` can be only one of those at a time.) The ClangIR issue to support fixed-point arithmetic is https://github.com/llvm/clangir/issues/1211 https://github.com/llvm/llvm-project/pull/118743 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits