mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e49816076c
commit
976f770e2d
@ -268,6 +268,49 @@ namespace llvm {
|
||||
}
|
||||
};
|
||||
|
||||
/// VAStartInst - This represents the llvm.va_start intrinsic.
|
||||
///
|
||||
class VAStartInst : public IntrinsicInst {
|
||||
public:
|
||||
static inline bool classof(const IntrinsicInst *I) {
|
||||
return I->getIntrinsicID() == Intrinsic::vastart;
|
||||
}
|
||||
static inline bool classof(const Value *V) {
|
||||
return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
|
||||
}
|
||||
|
||||
Value *getArgList() const { return const_cast<Value*>(getArgOperand(0)); }
|
||||
};
|
||||
|
||||
/// VAEndInst - This represents the llvm.va_end intrinsic.
|
||||
///
|
||||
class VAEndInst : public IntrinsicInst {
|
||||
public:
|
||||
static inline bool classof(const IntrinsicInst *I) {
|
||||
return I->getIntrinsicID() == Intrinsic::vaend;
|
||||
}
|
||||
static inline bool classof(const Value *V) {
|
||||
return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
|
||||
}
|
||||
|
||||
Value *getArgList() const { return const_cast<Value*>(getArgOperand(0)); }
|
||||
};
|
||||
|
||||
/// VACopyInst - This represents the llvm.va_copy intrinsic.
|
||||
///
|
||||
class VACopyInst : public IntrinsicInst {
|
||||
public:
|
||||
static inline bool classof(const IntrinsicInst *I) {
|
||||
return I->getIntrinsicID() == Intrinsic::vacopy;
|
||||
}
|
||||
static inline bool classof(const Value *V) {
|
||||
return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
|
||||
}
|
||||
|
||||
Value *getDest() const { return const_cast<Value*>(getArgOperand(0)); }
|
||||
Value *getSrc() const { return const_cast<Value*>(getArgOperand(1)); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -209,6 +209,9 @@ public:
|
||||
RetTy visitMemMoveInst(MemMoveInst &I) { DELEGATE(MemTransferInst); }
|
||||
RetTy visitMemTransferInst(MemTransferInst &I) { DELEGATE(MemIntrinsic); }
|
||||
RetTy visitMemIntrinsic(MemIntrinsic &I) { DELEGATE(IntrinsicInst); }
|
||||
RetTy visitVAStartInst(VAStartInst &I) { DELEGATE(IntrinsicInst); }
|
||||
RetTy visitVAEndInst(VAEndInst &I) { DELEGATE(IntrinsicInst); }
|
||||
RetTy visitVACopyInst(VACopyInst &I) { DELEGATE(IntrinsicInst); }
|
||||
RetTy visitIntrinsicInst(IntrinsicInst &I) { DELEGATE(CallInst); }
|
||||
|
||||
// Call and Invoke are slightly different as they delegate first through
|
||||
@ -262,6 +265,9 @@ private:
|
||||
case Intrinsic::memcpy: DELEGATE(MemCpyInst);
|
||||
case Intrinsic::memmove: DELEGATE(MemMoveInst);
|
||||
case Intrinsic::memset: DELEGATE(MemSetInst);
|
||||
case Intrinsic::vastart: DELEGATE(VAStartInst);
|
||||
case Intrinsic::vaend: DELEGATE(VAEndInst);
|
||||
case Intrinsic::vacopy: DELEGATE(VACopyInst);
|
||||
case Intrinsic::not_intrinsic: break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user