Skip to content

Commit 1609523

Browse files
author
Joe Shajrawi
authored
Merge pull request #17988 from apple/rxwei-patch-2
Handle builtin FP types in SILBuilder::appendOperandTypeName
2 parents 2f69b63 + b282254 commit 1609523

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,17 @@ class SILBuilder {
20992099
unsigned NumBits = BuiltinIntTy->getWidth().getFixedWidth();
21002100
Name += "_Int" + llvm::utostr(NumBits);
21012101
}
2102+
} else if (auto BuiltinFloatTy =
2103+
dyn_cast<BuiltinFloatType>(OpdTy.getASTType())) {
2104+
Name += "_FP";
2105+
switch (BuiltinFloatTy->getFPKind()) {
2106+
case BuiltinFloatType::IEEE16: Name += "IEEE16"; break;
2107+
case BuiltinFloatType::IEEE32: Name += "IEEE32"; break;
2108+
case BuiltinFloatType::IEEE64: Name += "IEEE64"; break;
2109+
case BuiltinFloatType::IEEE80: Name += "IEEE80"; break;
2110+
case BuiltinFloatType::IEEE128: Name += "IEEE128"; break;
2111+
case BuiltinFloatType::PPC128: Name += "PPC128"; break;
2112+
}
21022113
} else {
21032114
assert(OpdTy.getASTType() == getASTContext().TheRawPointerType);
21042115
Name += "_RawPointer";

0 commit comments

Comments
 (0)