Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/IceIntrinsics.cpp

Issue 577353003: Add call instructions to Subzero's bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix remaining issues raised. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceIntrinsics.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceIntrinsics.cpp
diff --git a/src/IceIntrinsics.cpp b/src/IceIntrinsics.cpp
index e941ff9b672e32c97f591049ebf012dc4af98d09..757455ff0753e4383bf8ccf6c37670fd387b2650 100644
--- a/src/IceIntrinsics.cpp
+++ b/src/IceIntrinsics.cpp
@@ -14,6 +14,7 @@
#include "IceCfg.h"
#include "IceCfgNode.h"
+#include "IceInst.h"
#include "IceIntrinsics.h"
#include "IceLiveness.h"
#include "IceOperand.h"
@@ -226,4 +227,33 @@ bool Intrinsics::VerifyMemoryOrder(uint64_t Order) {
return Order == Intrinsics::MemoryOrderSequentiallyConsistent;
}
+Intrinsics::ValidateCallValue
+Intrinsics::FullIntrinsicInfo::validateCall(const Ice::InstCall *Call,
+ SizeT &ArgIndex) const {
+ assert(NumTypes >= 1);
+ Variable *Result = Call->getDest();
+ if (Result == NULL) {
+ if (Signature[0] != Ice::IceType_void)
+ return Intrinsics::BadReturnType;
+ } else if (Signature[0] != Result->getType()) {
+ return Intrinsics::BadReturnType;
+ }
+ if (Call->getNumArgs() + 1 != NumTypes) {
+ return Intrinsics::WrongNumOfArgs;
+ }
+ for (size_t i = 1; i < NumTypes; ++i) {
+ if (Call->getArg(i - 1)->getType() != Signature[i]) {
+ ArgIndex = i;
+ return Intrinsics::WrongCallArgType;
+ }
+ }
+ return Intrinsics::IsValidCall;
+}
+
+Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const {
+ assert(NumTypes > 1);
+ assert(Index + 1 < NumTypes);
+ return Signature[Index + 1];
+}
+
} // end of namespace Ice
« no previous file with comments | « src/IceIntrinsics.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698