#include "llvm/InstrTypes.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// CastInst Class
//===----------------------------------------------------------------------===//
// CallInst Class
//===----------------------------------------------------------------------===//
+/// CallInst - This class represents a function call, abstracting a target
+/// machine's calling convention.
+///
class CallInst : public Instruction {
CallInst(const CallInst &CI);
public:
const std::string &Name = "", Instruction *InsertBefore = 0);
// Alternate CallInst ctors w/ no actuals & one actual, respectively.
- CallInst(Value *F, const std::string &Name = "",
- Instruction *InsertBefore = 0);
+ CallInst(Value *F, const std::string &Name = "",
+ Instruction *InsertBefore = 0);
CallInst(Value *F, Value *Actual, const std::string& Name = "",
- Instruction* InsertBefore = 0);
+ Instruction *InsertBefore = 0);
virtual Instruction *clone() const { return new CallInst(*this); }
bool mayWriteToMemory() const { return true; }
- const Function *getCalledFunction() const {
- return dyn_cast<Function>(Operands[0].get());
- }
- Function *getCalledFunction() {
- return dyn_cast<Function>(Operands[0].get());
- }
+ // FIXME: These methods should be inline once we eliminate
+ // ConstantPointerRefs!
+ const Function *getCalledFunction() const;
+ Function *getCalledFunction();
// getCalledValue - Get a pointer to a method that is invoked by this inst.
inline const Value *getCalledValue() const { return Operands[0]; }
// ShiftInst Class
//===----------------------------------------------------------------------===//
-// ShiftInst - This class represents left and right shift instructions.
-//
+/// ShiftInst - This class represents left and right shift instructions.
+///
class ShiftInst : public Instruction {
ShiftInst(const ShiftInst &SI) : Instruction(SI.getType(), SI.getOpcode()) {
Operands.reserve(2);
Operands.push_back(Use(SA, this));
}
- OtherOps getOpcode() const { return (OtherOps)Instruction::getOpcode(); }
+ OtherOps getOpcode() const {
+ return static_cast<OtherOps>(Instruction::getOpcode());
+ }
virtual Instruction *clone() const { return new ShiftInst(*this); }
virtual Instruction *clone() const { return new VAArgInst(*this); }
- bool mayWriteToMemory() const { return true; }
-
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const VAArgInst *) { return true; }
static inline bool classof(const Instruction *I) {
}
};
+} // End llvm namespace
+
#endif