Allow void to get in ARM64ReturnLocation.
It can now be called with it.
Change-Id: Idd10dbf5c9cb5f418504cb4c9252930e6eb4942d
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 689a35a..2f607f7 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -84,7 +84,6 @@
}
Location ARM64ReturnLocation(Primitive::Type return_type) {
- DCHECK_NE(return_type, Primitive::kPrimVoid);
// Note that in practice, `LocationFrom(x0)` and `LocationFrom(w0)` create the
// same Location object, and so do `LocationFrom(d0)` and `LocationFrom(s0)`,
// but we use the exact registers for clarity.
@@ -94,6 +93,8 @@
return LocationFrom(d0);
} else if (return_type == Primitive::kPrimLong) {
return LocationFrom(x0);
+ } else if (return_type == Primitive::kPrimVoid) {
+ return Location::NoLocation();
} else {
return LocationFrom(w0);
}