Skip to content

Commit ce62d7a

Browse files
Joe Shajrawirxwei
authored andcommitted
Merge pull request swiftlang#17988 from apple/rxwei-patch-2
Handle builtin FP types in SILBuilder::appendOperandTypeName (cherry picked from commit 1609523)
1 parent d9ae2ec commit ce62d7a

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
@@ -2114,6 +2114,17 @@ class SILBuilder {
21142114
unsigned NumBits = BuiltinIntTy->getWidth().getFixedWidth();
21152115
Name += "_Int" + llvm::utostr(NumBits);
21162116
}
2117+
} else if (auto BuiltinFloatTy =
2118+
dyn_cast<BuiltinFloatType>(OpdTy.getASTType())) {
2119+
Name += "_FP";
2120+
switch (BuiltinFloatTy->getFPKind()) {
2121+
case BuiltinFloatType::IEEE16: Name += "IEEE16"; break;
2122+
case BuiltinFloatType::IEEE32: Name += "IEEE32"; break;
2123+
case BuiltinFloatType::IEEE64: Name += "IEEE64"; break;
2124+
case BuiltinFloatType::IEEE80: Name += "IEEE80"; break;
2125+
case BuiltinFloatType::IEEE128: Name += "IEEE128"; break;
2126+
case BuiltinFloatType::PPC128: Name += "PPC128"; break;
2127+
}
21172128
} else {
21182129
assert(OpdTy.getASTType() == getASTContext().TheRawPointerType);
21192130
Name += "_RawPointer";

0 commit comments

Comments
 (0)