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

Unified Diff: src/IceInst.h

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 nits. 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
Index: src/IceInst.h
diff --git a/src/IceInst.h b/src/IceInst.h
index 18c38dd29da78b01b7038ecb9672fcf325b9a789..e28d69cc8297ba45ef745d792efbd8f06decf6b9 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -296,32 +296,36 @@ private:
class InstCall : public Inst {
public:
static InstCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest,
- Operand *CallTarget) {
+ Operand *CallTarget, bool hasTailCall = false) {
Jim Stichnoth 2014/09/18 21:41:54 Can you make this a non-default argument? I think
Karl 2014/09/18 22:01:50 Done.
// Set HasSideEffects to true so that the call instruction can't be
// dead-code eliminated. IntrinsicCalls can override this if the
// particular intrinsic is deletable and has no side-effects.
const bool HasSideEffects = true;
const InstKind Kind = Inst::Call;
- return new (Func->allocateInst<InstCall>())
- InstCall(Func, NumArgs, Dest, CallTarget, HasSideEffects, Kind);
+ return new (Func->allocateInst<InstCall>()) InstCall(
+ Func, NumArgs, Dest, CallTarget, hasTailCall, HasSideEffects, Kind);
}
void addArg(Operand *Arg) { addSource(Arg); }
Operand *getCallTarget() const { return getSrc(0); }
Operand *getArg(SizeT I) const { return getSrc(I + 1); }
SizeT getNumArgs() const { return getSrcSize() - 1; }
+ bool isTailcall() const { return hasTailCall; }
virtual void dump(const Cfg *Func) const;
static bool classof(const Inst *Inst) { return Inst->getKind() == Call; }
+ Type getReturnType() const;
protected:
InstCall(Cfg *Func, SizeT NumArgs, Variable *Dest, Operand *CallTarget,
- bool HasSideEff, InstKind Kind)
+ bool HasTailCl, bool HasSideEff, InstKind Kind)
jvoung (off chromium) 2014/09/18 22:04:46 nit: I think we might as well just make the argume
Karl 2014/09/19 20:29:51 I agree with using HasTailCall. Changing field bac
: Inst(Func, Kind, NumArgs + 1, Dest) {
+ hasTailCall = HasTailCl;
HasSideEffects = HasSideEff;
addSource(CallTarget);
}
virtual ~InstCall() {}
private:
+ bool hasTailCall;
Jim Stichnoth 2014/09/18 21:41:54 Capitalize per LLVM convention. Also, small nit -
Karl 2014/09/18 22:01:50 Done.
InstCall(const InstCall &) LLVM_DELETED_FUNCTION;
InstCall &operator=(const InstCall &) LLVM_DELETED_FUNCTION;
};
@@ -475,7 +479,7 @@ public:
private:
InstIntrinsicCall(Cfg *Func, SizeT NumArgs, Variable *Dest,
Operand *CallTarget, const Intrinsics::IntrinsicInfo &Info)
- : InstCall(Func, NumArgs, Dest, CallTarget, Info.HasSideEffects,
+ : InstCall(Func, NumArgs, Dest, CallTarget, false, Info.HasSideEffects,
Inst::IntrinsicCall),
Info(Info) {}
InstIntrinsicCall(const InstIntrinsicCall &) LLVM_DELETED_FUNCTION;
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | tests_lit/reader_tests/call.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698