summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp38
-rw-r--r--llvm/lib/VMCore/SlotCalculator.cpp2
-rw-r--r--llvm/lib/VMCore/SymbolTable.cpp8
-rw-r--r--llvm/lib/VMCore/Type.cpp12
4 files changed, 30 insertions, 30 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 545349a6f5f..2ebce7243bc 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -36,29 +36,29 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
SlotCalculator *Table);
static const Module *getModuleFromVal(const Value *V) {
- if (const Argument *MA = dyn_cast<const Argument>(V))
+ if (const Argument *MA = dyn_cast<Argument>(V))
return MA->getParent() ? MA->getParent()->getParent() : 0;
- else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(V))
+ else if (const BasicBlock *BB = dyn_cast<BasicBlock>(V))
return BB->getParent() ? BB->getParent()->getParent() : 0;
- else if (const Instruction *I = dyn_cast<const Instruction>(V)) {
+ else if (const Instruction *I = dyn_cast<Instruction>(V)) {
const Function *M = I->getParent() ? I->getParent()->getParent() : 0;
return M ? M->getParent() : 0;
- } else if (const GlobalValue *GV = dyn_cast<const GlobalValue>(V))
+ } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
return GV->getParent();
return 0;
}
static SlotCalculator *createSlotCalculator(const Value *V) {
assert(!isa<Type>(V) && "Can't create an SC for a type!");
- if (const Argument *FA = dyn_cast<const Argument>(V)) {
+ if (const Argument *FA = dyn_cast<Argument>(V)) {
return new SlotCalculator(FA->getParent(), true);
- } else if (const Instruction *I = dyn_cast<const Instruction>(V)) {
+ } else if (const Instruction *I = dyn_cast<Instruction>(V)) {
return new SlotCalculator(I->getParent()->getParent(), true);
- } else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(V)) {
+ } else if (const BasicBlock *BB = dyn_cast<BasicBlock>(V)) {
return new SlotCalculator(BB->getParent(), true);
- } else if (const GlobalVariable *GV = dyn_cast<const GlobalVariable>(V)){
+ } else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)){
return new SlotCalculator(GV->getParent(), true);
- } else if (const Function *Func = dyn_cast<const Function>(V)) {
+ } else if (const Function *Func = dyn_cast<Function>(V)) {
return new SlotCalculator(Func, true);
}
return 0;
@@ -79,7 +79,7 @@ static void fillTypeNameTable(const Module *M,
// As a heuristic, don't insert pointer to primitive types, because
// they are used too often to have a single useful name.
//
- const Type *Ty = cast<const Type>(I->second);
+ const Type *Ty = cast<Type>(I->second);
if (!isa<PointerType>(Ty) ||
!cast<PointerType>(Ty)->getElementType()->isPrimitiveType())
TypeNames.insert(std::make_pair(Ty, "%"+I->first));
@@ -114,7 +114,7 @@ static std::string calcTypeName(const Type *Ty,
std::string Result;
switch (Ty->getPrimitiveID()) {
case Type::FunctionTyID: {
- const FunctionType *FTy = cast<const FunctionType>(Ty);
+ const FunctionType *FTy = cast<FunctionType>(Ty);
Result = calcTypeName(FTy->getReturnType(), TypeStack, TypeNames) + " (";
for (FunctionType::ParamTypes::const_iterator
I = FTy->getParamTypes().begin(),
@@ -131,7 +131,7 @@ static std::string calcTypeName(const Type *Ty,
break;
}
case Type::StructTyID: {
- const StructType *STy = cast<const StructType>(Ty);
+ const StructType *STy = cast<StructType>(Ty);
Result = "{ ";
for (StructType::ElementTypes::const_iterator
I = STy->getElementTypes().begin(),
@@ -144,11 +144,11 @@ static std::string calcTypeName(const Type *Ty,
break;
}
case Type::PointerTyID:
- Result = calcTypeName(cast<const PointerType>(Ty)->getElementType(),
+ Result = calcTypeName(cast<PointerType>(Ty)->getElementType(),
TypeStack, TypeNames) + "*";
break;
case Type::ArrayTyID: {
- const ArrayType *ATy = cast<const ArrayType>(Ty);
+ const ArrayType *ATy = cast<ArrayType>(Ty);
Result = "[" + utostr(ATy->getNumElements()) + " x ";
Result += calcTypeName(ATy->getElementType(), TypeStack, TypeNames) + "]";
break;
@@ -377,14 +377,14 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
if (PrintName && V->hasName()) {
Out << "%" << V->getName();
} else {
- if (const Constant *CV = dyn_cast<const Constant>(V)) {
+ if (const Constant *CV = dyn_cast<Constant>(V)) {
WriteConstantInt(Out, CV, PrintName, TypeTable, Table);
} else {
int Slot;
if (Table) {
Slot = Table->getValSlot(V);
} else {
- if (const Type *Ty = dyn_cast<const Type>(V)) {
+ if (const Type *Ty = dyn_cast<Type>(V)) {
Out << Ty->getDescription();
return;
}
@@ -580,9 +580,9 @@ void AssemblyWriter::printSymbolTable(const SymbolTable &ST) {
for (; I != End; ++I) {
const Value *V = I->second;
- if (const Constant *CPV = dyn_cast<const Constant>(V)) {
+ if (const Constant *CPV = dyn_cast<Constant>(V)) {
printConstant(CPV);
- } else if (const Type *Ty = dyn_cast<const Type>(V)) {
+ } else if (const Type *Ty = dyn_cast<Type>(V)) {
Out << "\t%" << I->first << " = type ";
// Make sure we print out at least one level of the type structure, so
@@ -959,7 +959,7 @@ CachedWriter &CachedWriter::operator<<(const Value *V) {
switch (V->getValueType()) {
case Value::ConstantVal:
case Value::ArgumentVal: AW->writeOperand(V, true, true); break;
- case Value::TypeVal: AW->write(cast<const Type>(V)); break;
+ case Value::TypeVal: AW->write(cast<Type>(V)); break;
case Value::InstructionVal: AW->write(cast<Instruction>(V)); break;
case Value::BasicBlockVal: AW->write(cast<BasicBlock>(V)); break;
case Value::FunctionVal: AW->write(cast<Function>(V)); break;
diff --git a/llvm/lib/VMCore/SlotCalculator.cpp b/llvm/lib/VMCore/SlotCalculator.cpp
index c9560c1d8c2..005c5c1658d 100644
--- a/llvm/lib/VMCore/SlotCalculator.cpp
+++ b/llvm/lib/VMCore/SlotCalculator.cpp
@@ -262,7 +262,7 @@ int SlotCalculator::insertVal(const Value *D, bool dontIgnore) {
}
// If it's a type, make sure that all subtypes of the type are included...
- if (const Type *TheTy = dyn_cast<const Type>(D)) {
+ if (const Type *TheTy = dyn_cast<Type>(D)) {
// Insert the current type before any subtypes. This is important because
// recursive types elements are inserted in a bottom up order. Changing
diff --git a/llvm/lib/VMCore/SymbolTable.cpp b/llvm/lib/VMCore/SymbolTable.cpp
index 12c87981b8e..ddd769d075f 100644
--- a/llvm/lib/VMCore/SymbolTable.cpp
+++ b/llvm/lib/VMCore/SymbolTable.cpp
@@ -19,7 +19,7 @@ SymbolTable::~SymbolTable() {
if (TyPlane != end()) {
VarMap &TyP = TyPlane->second;
for (VarMap::iterator I = TyP.begin(), E = TyP.end(); I != E; ++I) {
- const Type *Ty = cast<const Type>(I->second);
+ const Type *Ty = cast<Type>(I->second);
if (Ty->isAbstract()) // If abstract, drop the reference...
cast<DerivedType>(Ty)->removeAbstractTypeUser(this);
}
@@ -122,7 +122,7 @@ Value *SymbolTable::removeEntry(iterator Plane, type_iterator Entry) {
// If we are removing an abstract type, remove the symbol table from it's use
// list...
if (Ty == Type::TypeTy) {
- const Type *T = cast<const Type>(Result);
+ const Type *T = cast<Type>(Result);
if (T->isAbstract()) {
#if DEBUG_ABSTYPE
std::cerr << "Removing abs type from symtab" << T->getDescription()<<"\n";
@@ -179,7 +179,7 @@ void SymbolTable::insertEntry(const std::string &Name, const Type *VTy,
// If we are adding an abstract type, add the symbol table to it's use list.
if (VTy == Type::TypeTy) {
- const Type *T = cast<const Type>(V);
+ const Type *T = cast<Type>(V);
if (T->isAbstract()) {
cast<DerivedType>(T)->addAbstractTypeUser(this);
#if DEBUG_ABSTYPE
@@ -311,7 +311,7 @@ void SymbolTable::refineAbstractType(const DerivedType *OldType,
#if DEBUG_ABSTYPE
std::cerr << "Added type " << NewType->getDescription() << "\n";
#endif
- cast<const DerivedType>(NewType)->addAbstractTypeUser(this);
+ cast<DerivedType>(NewType)->addAbstractTypeUser(this);
}
}
}
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 28ed4f366e5..d74433a9748 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -293,7 +293,7 @@ static std::string getTypeProps(const Type *Ty,
switch (Ty->getPrimitiveID()) {
case Type::FunctionTyID: {
- const FunctionType *MTy = cast<const FunctionType>(Ty);
+ const FunctionType *MTy = cast<FunctionType>(Ty);
Result = getTypeProps(MTy->getReturnType(), TypeStack,
isAbstract, isRecursive)+" (";
for (FunctionType::ParamTypes::const_iterator
@@ -311,7 +311,7 @@ static std::string getTypeProps(const Type *Ty,
break;
}
case Type::StructTyID: {
- const StructType *STy = cast<const StructType>(Ty);
+ const StructType *STy = cast<StructType>(Ty);
Result = "{ ";
for (StructType::ElementTypes::const_iterator
I = STy->getElementTypes().begin(),
@@ -324,13 +324,13 @@ static std::string getTypeProps(const Type *Ty,
break;
}
case Type::PointerTyID: {
- const PointerType *PTy = cast<const PointerType>(Ty);
+ const PointerType *PTy = cast<PointerType>(Ty);
Result = getTypeProps(PTy->getElementType(), TypeStack,
isAbstract, isRecursive) + " *";
break;
}
case Type::ArrayTyID: {
- const ArrayType *ATy = cast<const ArrayType>(Ty);
+ const ArrayType *ATy = cast<ArrayType>(Ty);
unsigned NumElements = ATy->getNumElements();
Result = "[";
Result += utostr(NumElements) + " x ";
@@ -400,10 +400,10 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2,
// algorithm is the fact that arraytypes have sizes that differentiates types,
// and that method types can be varargs or not. Consider this now.
if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
- if (ATy->getNumElements() != cast<const ArrayType>(Ty2)->getNumElements())
+ if (ATy->getNumElements() != cast<ArrayType>(Ty2)->getNumElements())
return false;
} else if (const FunctionType *MTy = dyn_cast<FunctionType>(Ty)) {
- if (MTy->isVarArg() != cast<const FunctionType>(Ty2)->isVarArg())
+ if (MTy->isVarArg() != cast<FunctionType>(Ty2)->isVarArg())
return false;
}
OpenPOWER on IntegriCloud