Skip to content
Permalink
Browse files
8254156: Simplify ABI classification logic
Reviewed-by: jvernee
  • Loading branch information
mcimadamore committed Oct 7, 2020
1 parent d0e35de commit ea4bea566c8858c01de57a17d07a6f14b83a180d
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/jdk.incubator.jextract/share/classes/jdk/internal/jextract/impl/SourceConstantHelper.java
@@ -449,7 +449,9 @@ private String getConstantString(Class<?> type, Object value) {
}

private static String typeToLayoutName(ValueLayout vl) {
return switch (((CLinker.CValueLayout) vl).kind()) {
CLinker.TypeKind kind = (CLinker.TypeKind)vl.attribute(CLinker.TypeKind.ATTR_NAME).orElseThrow(
() -> new IllegalStateException("Unexpected value layout: could not determine ABI class"));
return switch (kind) {
case CHAR -> "C_CHAR";
case SHORT -> "C_SHORT";
case INT -> "C_INT";

0 comments on commit ea4bea5

Please sign in to comment.