aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp11
-rw-r--r--lib/VMCore/Function.cpp3
-rw-r--r--lib/VMCore/Instructions.cpp65
-rw-r--r--lib/VMCore/Mangler.cpp7
-rw-r--r--lib/VMCore/TypeSymbolTable.cpp4
-rw-r--r--lib/VMCore/Use.cpp6
6 files changed, 60 insertions, 36 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index b327a6a855..0f7ca0aaa0 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -539,9 +539,11 @@ class VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr {
GetElementPtrConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
const Type *DestTy);
public:
- static GetElementPtrConstantExpr *Create(Constant *C, const std::vector<Constant*> &IdxList,
+ static GetElementPtrConstantExpr *Create(Constant *C,
+ const std::vector<Constant*>&IdxList,
const Type *DestTy) {
- return new(IdxList.size() + 1) GetElementPtrConstantExpr(C, IdxList, DestTy);
+ return new(IdxList.size() + 1)
+ GetElementPtrConstantExpr(C, IdxList, DestTy);
}
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -1973,8 +1975,9 @@ Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C,
Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C,
Value* const *Idxs,
unsigned NumIdx) {
- assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true) &&
- "GEP indices invalid!");
+ assert(GetElementPtrInst::getIndexedType(C->getType(),
+ Idxs, Idxs+NumIdx, true)
+ && "GEP indices invalid!");
if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx))
return FC; // Fold a few common cases...
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 546cadb0f3..9f7eefe1a6 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -106,7 +106,8 @@ bool Argument::hasNoAliasAttr() const {
/// it in its containing function.
bool Argument::hasStructRetAttr() const {
if (!isa<PointerType>(getType())) return false;
- if (this != getParent()->arg_begin()) return false; // StructRet param must be first param
+ if (this != getParent()->arg_begin())
+ return false; // StructRet param must be first param
return getParent()->paramHasAttr(1, ParamAttr::StructRet);
}
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index ff56560613..473e9fac19 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -421,7 +421,8 @@ void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
InvokeInst::InvokeInst(const InvokeInst &II)
: TerminatorInst(II.getType(), Instruction::Invoke,
- OperandTraits<InvokeInst>::op_end(this) - II.getNumOperands(),
+ OperandTraits<InvokeInst>::op_end(this)
+ - II.getNumOperands(),
II.getNumOperands()) {
setParamAttrs(II.getParamAttrs());
SubclassData = II.SubclassData;
@@ -464,7 +465,8 @@ void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
ReturnInst::ReturnInst(const ReturnInst &RI)
: TerminatorInst(Type::VoidTy, Instruction::Ret,
- OperandTraits<ReturnInst>::op_end(this) - RI.getNumOperands(),
+ OperandTraits<ReturnInst>::op_end(this)
+ - RI.getNumOperands(),
RI.getNumOperands()) {
unsigned N = RI.getNumOperands();
if (N == 1)
@@ -997,7 +999,8 @@ void GetElementPtrInst::init(Value *Ptr, Value *Idx) {
GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
: Instruction(reinterpret_cast<const Type*>(GEPI.getType()), GetElementPtr,
- OperandTraits<GetElementPtrInst>::op_end(this) - GEPI.getNumOperands(),
+ OperandTraits<GetElementPtrInst>::op_end(this)
+ - GEPI.getNumOperands(),
GEPI.getNumOperands()) {
Use *OL = OperandList;
Use *GEPIOL = GEPI.OperandList;
@@ -1976,45 +1979,45 @@ bool CastInst::isCastable(const Type *SrcTy, const Type *DestTy) {
unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
// Run through the possibilities ...
- if (DestTy->isInteger()) { // Casting to integral
- if (SrcTy->isInteger()) { // Casting from integral
+ if (DestTy->isInteger()) { // Casting to integral
+ if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
return true;
} else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return isa<PointerType>(SrcTy);
}
- } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
- if (SrcTy->isInteger()) { // Casting from integral
+ } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
+ if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
return true;
} else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return false;
}
} else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- // Casting to vector
+ // Casting to vector
if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestPTy->getBitWidth() == SrcPTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return DestPTy->getBitWidth() == SrcBits;
}
- } else if (isa<PointerType>(DestTy)) { // Casting to pointer
- if (isa<PointerType>(SrcTy)) { // Casting from pointer
+ } else if (isa<PointerType>(DestTy)) { // Casting to pointer
+ if (isa<PointerType>(SrcTy)) { // Casting from pointer
return true;
- } else if (SrcTy->isInteger()) { // Casting from integral
+ } else if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else { // Casting from something else
+ } else { // Casting from something else
return false;
}
- } else { // Casting to something else
+ } else { // Casting to something else
return false;
}
}
@@ -2806,8 +2809,12 @@ CastInst *FPToSIInst::clone() const { return new FPToSIInst(*this); }
CastInst *PtrToIntInst::clone() const { return new PtrToIntInst(*this); }
CastInst *IntToPtrInst::clone() const { return new IntToPtrInst(*this); }
CastInst *BitCastInst::clone() const { return new BitCastInst(*this); }
-CallInst *CallInst::clone() const { return new(getNumOperands()) CallInst(*this); }
-SelectInst *SelectInst::clone() const { return new(getNumOperands()) SelectInst(*this); }
+CallInst *CallInst::clone() const {
+ return new(getNumOperands()) CallInst(*this);
+}
+SelectInst *SelectInst::clone() const {
+ return new(getNumOperands()) SelectInst(*this);
+}
VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); }
ExtractElementInst *ExtractElementInst::clone() const {
@@ -2820,10 +2827,16 @@ ShuffleVectorInst *ShuffleVectorInst::clone() const {
return new ShuffleVectorInst(*this);
}
PHINode *PHINode::clone() const { return new PHINode(*this); }
-ReturnInst *ReturnInst::clone() const { return new(getNumOperands()) ReturnInst(*this); }
-BranchInst *BranchInst::clone() const { return new(getNumOperands()) BranchInst(*this); }
+ReturnInst *ReturnInst::clone() const {
+ return new(getNumOperands()) ReturnInst(*this);
+}
+BranchInst *BranchInst::clone() const {
+ return new(getNumOperands()) BranchInst(*this);
+}
SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); }
-InvokeInst *InvokeInst::clone() const { return new(getNumOperands()) InvokeInst(*this); }
+InvokeInst *InvokeInst::clone() const {
+ return new(getNumOperands()) InvokeInst(*this);
+}
UnwindInst *UnwindInst::clone() const { return new UnwindInst(); }
UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();}
GetResultInst *GetResultInst::clone() const { return new GetResultInst(*this); }
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp
index 0437508f39..50fa3c1885 100644
--- a/lib/VMCore/Mangler.cpp
+++ b/lib/VMCore/Mangler.cpp
@@ -166,7 +166,8 @@ void Mangler::InsertName(GlobalValue *GV,
} else {
// If GV is external but the existing one is static, mangle the existing one
if ((GV->hasExternalLinkage() || GV->hasDLLImportLinkage()) &&
- !(ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage())) {
+ !(ExistingValue->hasExternalLinkage()
+ || ExistingValue->hasDLLImportLinkage())) {
MangledGlobals.insert(ExistingValue);
ExistingValue = GV;
} else if ((GV->hasExternalLinkage() ||
@@ -208,6 +209,8 @@ Mangler::Mangler(Module &M, const char *prefix)
std::map<std::string, GlobalValue*> Names;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
InsertName(I, Names);
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E;
+ ++I)
InsertName(I, Names);
}
diff --git a/lib/VMCore/TypeSymbolTable.cpp b/lib/VMCore/TypeSymbolTable.cpp
index 91e4721c1b..475d71949f 100644
--- a/lib/VMCore/TypeSymbolTable.cpp
+++ b/lib/VMCore/TypeSymbolTable.cpp
@@ -64,7 +64,9 @@ Type* TypeSymbolTable::remove(iterator Entry) {
// list...
if (Result->isAbstract()) {
#if DEBUG_ABSTYPE
- cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
+ cerr << "Removing abstract type from symtab"
+ << Result->getDescription()
+ << "\n";
#endif
cast<DerivedType>(Result)->removeAbstractTypeUser(this);
}
diff --git a/lib/VMCore/Use.cpp b/lib/VMCore/Use.cpp
index 0672209bff..d96a0e57fd 100644
--- a/lib/VMCore/Use.cpp
+++ b/lib/VMCore/Use.cpp
@@ -1,4 +1,4 @@
-//===-- Use.cpp - Implement the Use class -------------------------------===//
+//===-- Use.cpp - Implement the Use class ---------------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -151,7 +151,9 @@ User *Use::getUser() const {
//===----------------------------------------------------------------------===//
Use *User::allocHungoffUses(unsigned N) const {
- Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use)));
+ Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N
+ + sizeof(AugmentedUse)
+ - sizeof(Use)));
Use *End = Begin + N;
static_cast<AugmentedUse&>(End[-1]).ref = addTag(this, tagOne);
return Use::initTags(Begin, End);