mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
[flang] Support fir.boxchar in getTypeAsString (#70997)
This commit is contained in:
parent
373c343a77
commit
2667dbff12
@ -545,7 +545,9 @@ std::string getTypeAsString(mlir::Type ty, const fir::KindMapping &kindMap,
|
||||
break;
|
||||
} else if (auto charTy = mlir::dyn_cast_or_null<fir::CharacterType>(ty)) {
|
||||
name << 'c' << kindMap.getCharacterBitsize(charTy.getFKind());
|
||||
if (charTy.getLen() != fir::CharacterType::singleton())
|
||||
if (charTy.getLen() == fir::CharacterType::unknownLen())
|
||||
name << "xU";
|
||||
else if (charTy.getLen() != fir::CharacterType::singleton())
|
||||
name << "x" << charTy.getLen();
|
||||
break;
|
||||
} else if (auto seqTy = mlir::dyn_cast_or_null<fir::SequenceType>(ty)) {
|
||||
@ -574,6 +576,9 @@ std::string getTypeAsString(mlir::Type ty, const fir::KindMapping &kindMap,
|
||||
} else if (auto boxTy = mlir::dyn_cast_or_null<fir::BoxType>(ty)) {
|
||||
name << "box_";
|
||||
ty = boxTy.getEleTy();
|
||||
} else if (auto boxcharTy = mlir::dyn_cast_or_null<fir::BoxCharType>(ty)) {
|
||||
name << "boxchar_";
|
||||
ty = boxcharTy.getEleTy();
|
||||
} else if (auto recTy = mlir::dyn_cast_or_null<fir::RecordType>(ty)) {
|
||||
name << "rec_" << recTy.getName();
|
||||
break;
|
||||
|
@ -313,4 +313,6 @@ TEST_F(FIRTypesTest, getTypeAsString) {
|
||||
fir::getTypeAsString(
|
||||
fir::LLVMPointerType::get(mlir::IntegerType::get(&context, 32)),
|
||||
*kindMap));
|
||||
EXPECT_EQ("boxchar_c8xU",
|
||||
fir::getTypeAsString(fir::BoxCharType::get(&context, 1), *kindMap));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user