aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
committerChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
commitb00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace (patch)
tree44b5f879c16e7ecb2e9334ad120e3454270e1bb3 /lib/Target
parent1d87bcf4909b06dcd86320722653341f08b8b396 (diff)
downloadexternal_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.zip
external_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.tar.gz
external_llvm-b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace.tar.bz2
Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/SparcV9/InstrSched/SchedGraph.cpp5
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrForest.cpp7
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp3
-rw-r--r--lib/Target/TargetData.cpp6
4 files changed, 11 insertions, 10 deletions
diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
index 852c4f2..fd09e9e 100644
--- a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
+++ b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
@@ -21,6 +21,7 @@
#include "llvm/Target/MachineInstrInfo.h"
#include "llvm/Target/MachineRegInfo.h"
#include "llvm/Support/StringExtras.h"
+#include "llvm/iOther.h"
#include <algorithm>
@@ -540,7 +541,7 @@ SchedGraph::addSSAEdge(SchedGraphNode* node,
// Phi instructions are the only ones that produce a value but don't get
// any non-dummy machine instructions. Return here as an optimization.
//
- if (defVMInstr->isPHINode())
+ if (isa<PHINode>(defVMInstr))
return;
// Now add the graph edge for the appropriate machine instruction(s).
@@ -642,7 +643,7 @@ void
SchedGraph::addNonSSAEdgesForValue(const Instruction* instr,
const TargetMachine& target)
{
- if (instr->isPHINode())
+ if (isa<PHINode>(instr))
return;
MachineCodeForVMInstr& mvec = instr->getMachineInstrVec();
diff --git a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
index f5a5247..199ed65 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrForest.cpp
@@ -26,6 +26,7 @@
#include "llvm/Method.h"
#include "llvm/iTerminators.h"
#include "llvm/iMemory.h"
+#include "llvm/iOther.h"
#include "llvm/ConstPoolVals.h"
#include "llvm/BasicBlock.h"
#include "llvm/CodeGen/MachineInstr.h"
@@ -57,11 +58,11 @@ InstructionNode::InstructionNode(Instruction* I)
// Distinguish special cases of some instructions such as Ret and Br
//
- if (opLabel == Instruction::Ret && ((ReturnInst*)I)->getReturnValue())
+ if (opLabel == Instruction::Ret && cast<ReturnInst>(I)->getReturnValue())
{
opLabel = RetValueOp; // ret(value) operation
}
- else if (opLabel == Instruction::Br && ! ((BranchInst*)I)->isUnconditional())
+ else if (opLabel ==Instruction::Br && !cast<BranchInst>(I)->isUnconditional())
{
opLabel = BrCondOp; // br(cond) operation
}
@@ -302,7 +303,7 @@ InstrForest::buildTreeForInstruction(Instruction *instr)
InstrTreeNode* opTreeNode;
if (isa<Instruction>(operand) && operand->use_size() == 1 &&
cast<Instruction>(operand)->getParent() == instr->getParent() &&
- ! instr->isPHINode() &&
+ !isa<PHINode>(instr) &&
instr->getOpcode() != Instruction::Call)
{
// Recursively create a treeNode for it.
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index b1b5e01..e4ae8a8 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -2010,9 +2010,8 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
// Also, mark the operands of the Call as implicit operands
// of the machine instruction.
{
- CallInst* callInstr = (CallInst*) subtreeRoot->getInstruction();
+ CallInst *callInstr = cast<CallInst>(subtreeRoot->getInstruction());
Method* callee = callInstr->getCalledMethod();
- assert(callInstr->getOpcode() == Instruction::Call);
Instruction* jmpAddrReg = new TmpInstruction(Instruction::UserOp1,
callee, NULL);
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 24a5e85..0b4dc98 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -147,14 +147,14 @@ unsigned char TargetData::getTypeAlignment(const Type *Ty) const {
unsigned TargetData::getIndexedOffset(const Type *ptrTy,
const vector<ConstPoolVal*> &Idx) const {
- const PointerType *PtrTy = ptrTy->castPointerType();
+ const PointerType *PtrTy = cast<const PointerType>(ptrTy);
unsigned Result = 0;
// Get the type pointed to...
const Type *Ty = PtrTy->getValueType();
for (unsigned CurIDX = 0; CurIDX < Idx.size(); ++CurIDX) {
- if (const StructType *STy = Ty->dyncastStructType()) {
+ if (const StructType *STy = dyn_cast<const StructType>(Ty)) {
assert(Idx[CurIDX]->getType() == Type::UByteTy && "Illegal struct idx");
unsigned FieldNo = ((ConstPoolUInt*)Idx[CurIDX++])->getValue();
@@ -168,7 +168,7 @@ unsigned TargetData::getIndexedOffset(const Type *ptrTy,
// Update Ty to refer to current element
Ty = STy->getElementTypes()[FieldNo];
- } else if (const ArrayType *ATy = Ty->dyncastArrayType()) {
+ } else if (const ArrayType *ATy = dyn_cast<const ArrayType>(Ty)) {
assert(0 && "Loading from arrays not implemented yet!");
} else {
assert(0 && "Indexing type that is not struct or array?");