mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4054ae0b25
commit
b1dbcd886a
@ -1738,10 +1738,17 @@ endif
|
||||
endif
|
||||
|
||||
check-line-length:
|
||||
@egrep -n '.{81}' $(Sources)
|
||||
@echo searching for overlength lines in files: $(Sources)
|
||||
@echo
|
||||
@echo
|
||||
@egrep -n '.{81}' $(Sources) /dev/null
|
||||
|
||||
check-for-tabs:
|
||||
@egrep -n ' ' $(Sources)
|
||||
@echo searching for tabs in files: $(Sources)
|
||||
@echo
|
||||
@echo
|
||||
@egrep -n ' ' $(Sources) /dev/null
|
||||
|
||||
check-footprint:
|
||||
@ls -l $(LibDir) | awk '\
|
||||
BEGIN { sum = 0; } \
|
||||
|
@ -278,9 +278,10 @@ void BrainF::readloop(PHINode *phi, BasicBlock *oldbb, BasicBlock *testbb) {
|
||||
BasicBlock *bb_1 = BasicBlock::Create(label, brainf_func);
|
||||
builder->SetInsertPoint(bb_1);
|
||||
|
||||
//Make part of PHI instruction now, wait until end of loop to finish
|
||||
PHINode *phi_0 = PHINode::Create(PointerType::getUnqual(IntegerType::Int8Ty),
|
||||
headreg, testbb);
|
||||
// Make part of PHI instruction now, wait until end of loop to finish
|
||||
PHINode *phi_0 =
|
||||
PHINode::Create(PointerType::getUnqual(IntegerType::Int8Ty),
|
||||
headreg, testbb);
|
||||
phi_0->reserveOperandSpace(2);
|
||||
phi_0->addIncoming(curhead, bb_0);
|
||||
curhead = phi_0;
|
||||
|
@ -2712,7 +2712,8 @@ BBTerminatorInst :
|
||||
PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
|
||||
|
||||
// Create the InvokeInst
|
||||
InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end());
|
||||
InvokeInst *II = InvokeInst::Create(V, Normal, Except,
|
||||
Args.begin(), Args.end());
|
||||
II->setCallingConv($2);
|
||||
II->setParamAttrs(PAL);
|
||||
$$ = II;
|
||||
|
@ -1485,7 +1485,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
}
|
||||
}
|
||||
|
||||
I = InvokeInst::Create(Callee, NormalBB, UnwindBB, Ops.begin(), Ops.end());
|
||||
I = InvokeInst::Create(Callee, NormalBB, UnwindBB,
|
||||
Ops.begin(), Ops.end());
|
||||
cast<InvokeInst>(I)->setCallingConv(CCInfo);
|
||||
cast<InvokeInst>(I)->setParamAttrs(PAL);
|
||||
break;
|
||||
|
@ -265,12 +265,13 @@ GenericValue JIT::runFunction(Function *F,
|
||||
Args.push_back(C);
|
||||
}
|
||||
|
||||
CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(), "", StubBB);
|
||||
CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(),
|
||||
"", StubBB);
|
||||
TheCall->setTailCall();
|
||||
if (TheCall->getType() != Type::VoidTy)
|
||||
ReturnInst::Create(TheCall, StubBB); // Return result of the call.
|
||||
ReturnInst::Create(TheCall, StubBB); // Return result of the call.
|
||||
else
|
||||
ReturnInst::Create(StubBB); // Just return void.
|
||||
ReturnInst::Create(StubBB); // Just return void.
|
||||
|
||||
// Finally, return the value returned by our nullary stub function.
|
||||
return runFunction(Stub, std::vector<GenericValue>());
|
||||
|
@ -855,7 +855,8 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src,
|
||||
// We have a definition of the same name but different type in the
|
||||
// source module. Copy the prototype to the destination and replace
|
||||
// uses of the destination's prototype with the new prototype.
|
||||
Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(),
|
||||
Function *NewDF = Function::Create(SF->getFunctionType(),
|
||||
SF->getLinkage(),
|
||||
SF->getName(), Dest);
|
||||
CopyGVAttributes(NewDF, SF);
|
||||
|
||||
@ -891,7 +892,8 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src,
|
||||
} else if (!DF || SF->hasInternalLinkage() || DF->hasInternalLinkage()) {
|
||||
// Function does not already exist, simply insert an function signature
|
||||
// identical to SF into the dest module.
|
||||
Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(),
|
||||
Function *NewDF = Function::Create(SF->getFunctionType(),
|
||||
SF->getLinkage(),
|
||||
SF->getName(), Dest);
|
||||
CopyGVAttributes(NewDF, SF);
|
||||
|
||||
|
@ -1082,7 +1082,8 @@ static void RewriteHeapSROALoadUser(LoadInst *Load, Instruction *LoadUser,
|
||||
GEPIdx.push_back(GEPI->getOperand(1));
|
||||
GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end());
|
||||
|
||||
Value *NGEPI = GetElementPtrInst::Create(NewPtr, GEPIdx.begin(), GEPIdx.end(),
|
||||
Value *NGEPI = GetElementPtrInst::Create(NewPtr,
|
||||
GEPIdx.begin(), GEPIdx.end(),
|
||||
GEPI->getName(), GEPI);
|
||||
GEPI->replaceAllUsesWith(NGEPI);
|
||||
GEPI->eraseFromParent();
|
||||
|
@ -381,8 +381,8 @@ Value* ProfilerRS::Translate(Value* v) {
|
||||
if (bb == &bb->getParent()->getEntryBlock())
|
||||
TransCache[bb] = bb; //don't translate entry block
|
||||
else
|
||||
TransCache[bb] = BasicBlock::Create("dup_" + bb->getName(), bb->getParent(),
|
||||
NULL);
|
||||
TransCache[bb] = BasicBlock::Create("dup_" + bb->getName(),
|
||||
bb->getParent(), NULL);
|
||||
return TransCache[bb];
|
||||
} else if (Instruction* i = dyn_cast<Instruction>(v)) {
|
||||
//we have already translated this
|
||||
|
@ -909,12 +909,13 @@ Value* GVNPRE::phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) {
|
||||
Instruction* newVal = 0;
|
||||
if (ShuffleVectorInst* S = dyn_cast<ShuffleVectorInst>(U))
|
||||
newVal = new ShuffleVectorInst(newOp1, newOp2, newOp3,
|
||||
S->getName()+".expr");
|
||||
S->getName() + ".expr");
|
||||
else if (InsertElementInst* I = dyn_cast<InsertElementInst>(U))
|
||||
newVal = InsertElementInst::Create(newOp1, newOp2, newOp3,
|
||||
I->getName()+".expr");
|
||||
I->getName() + ".expr");
|
||||
else if (SelectInst* I = dyn_cast<SelectInst>(U))
|
||||
newVal = SelectInst::Create(newOp1, newOp2, newOp3, I->getName()+".expr");
|
||||
newVal = SelectInst::Create(newOp1, newOp2, newOp3,
|
||||
I->getName() + ".expr");
|
||||
|
||||
uint32_t v = VN.lookup_or_add(newVal);
|
||||
|
||||
|
@ -8348,7 +8348,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
if (AddOp != TI)
|
||||
std::swap(NewTrueOp, NewFalseOp);
|
||||
Instruction *NewSel =
|
||||
SelectInst::Create(CondVal, NewTrueOp,NewFalseOp,SI.getName()+".p");
|
||||
SelectInst::Create(CondVal, NewTrueOp,
|
||||
NewFalseOp, SI.getName() + ".p");
|
||||
|
||||
NewSel = InsertNewInstBefore(NewSel, SI);
|
||||
return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel);
|
||||
@ -8374,7 +8375,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
if (OpToFold) {
|
||||
Constant *C = GetSelectFoldableConstant(TVI);
|
||||
Instruction *NewSel =
|
||||
SelectInst::Create(SI.getCondition(), TVI->getOperand(2-OpToFold), C);
|
||||
SelectInst::Create(SI.getCondition(),
|
||||
TVI->getOperand(2-OpToFold), C);
|
||||
InsertNewInstBefore(NewSel, SI);
|
||||
NewSel->takeName(TVI);
|
||||
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TVI))
|
||||
@ -8399,7 +8401,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
|
||||
if (OpToFold) {
|
||||
Constant *C = GetSelectFoldableConstant(FVI);
|
||||
Instruction *NewSel =
|
||||
SelectInst::Create(SI.getCondition(), C, FVI->getOperand(2-OpToFold));
|
||||
SelectInst::Create(SI.getCondition(), C,
|
||||
FVI->getOperand(2-OpToFold));
|
||||
InsertNewInstBefore(NewSel, SI);
|
||||
NewSel->takeName(FVI);
|
||||
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FVI))
|
||||
@ -8757,7 +8760,8 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
}
|
||||
|
||||
// Insert this value into the result vector.
|
||||
Result = InsertElementInst::Create(Result, ExtractedElts[Idx], i, "tmp");
|
||||
Result = InsertElementInst::Create(Result, ExtractedElts[Idx],
|
||||
i, "tmp");
|
||||
InsertNewInstBefore(cast<Instruction>(Result), CI);
|
||||
}
|
||||
return CastInst::create(Instruction::BitCast, Result, CI.getType());
|
||||
@ -9090,7 +9094,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
Instruction *NC;
|
||||
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
|
||||
NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
|
||||
Args.begin(), Args.end(), Caller->getName(), Caller);
|
||||
Args.begin(), Args.end(),
|
||||
Caller->getName(), Caller);
|
||||
cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
|
||||
cast<InvokeInst>(NC)->setParamAttrs(NewCallerPAL);
|
||||
} else {
|
||||
@ -9331,7 +9336,8 @@ Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) {
|
||||
Value *InRHS = FirstInst->getOperand(1);
|
||||
PHINode *NewLHS = 0, *NewRHS = 0;
|
||||
if (LHSVal == 0) {
|
||||
NewLHS = PHINode::Create(LHSType, FirstInst->getOperand(0)->getName()+".pn");
|
||||
NewLHS = PHINode::Create(LHSType,
|
||||
FirstInst->getOperand(0)->getName() + ".pn");
|
||||
NewLHS->reserveOperandSpace(PN.getNumOperands()/2);
|
||||
NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0));
|
||||
InsertNewInstBefore(NewLHS, PN);
|
||||
@ -9339,7 +9345,8 @@ Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) {
|
||||
}
|
||||
|
||||
if (RHSVal == 0) {
|
||||
NewRHS = PHINode::Create(RHSType, FirstInst->getOperand(1)->getName()+".pn");
|
||||
NewRHS = PHINode::Create(RHSType,
|
||||
FirstInst->getOperand(1)->getName() + ".pn");
|
||||
NewRHS->reserveOperandSpace(PN.getNumOperands()/2);
|
||||
NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0));
|
||||
InsertNewInstBefore(NewRHS, PN);
|
||||
@ -10864,8 +10871,8 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
|
||||
cast<PointerType>(I->getOperand(0)->getType())->getAddressSpace();
|
||||
Value *Ptr = InsertBitCastBefore(I->getOperand(0),
|
||||
PointerType::get(EI.getType(), AS),EI);
|
||||
GetElementPtrInst *GEP =
|
||||
GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName() + ".gep");
|
||||
GetElementPtrInst *GEP =
|
||||
GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName()+".gep");
|
||||
InsertNewInstBefore(GEP, EI);
|
||||
return new LoadInst(GEP);
|
||||
}
|
||||
|
@ -471,7 +471,8 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) {
|
||||
// Right now original pre-header has two successors, new header and
|
||||
// exit block. Insert new block between original pre-header and
|
||||
// new header such that loop's new pre-header has only one successor.
|
||||
BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph", OrigHeader->getParent(),
|
||||
BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph",
|
||||
OrigHeader->getParent(),
|
||||
NewHeader);
|
||||
LoopInfo &LI = LPM.getAnalysis<LoopInfo>();
|
||||
if (Loop *PL = LI.getLoopFor(OrigPreHeader))
|
||||
|
@ -401,7 +401,8 @@ bool TailCallElim::ProcessReturningBlock(ReturnInst *Ret, BasicBlock *&OldEntry,
|
||||
Instruction *InsertPos = OldEntry->begin();
|
||||
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
|
||||
I != E; ++I) {
|
||||
PHINode *PN = PHINode::Create(I->getType(), I->getName()+".tr", InsertPos);
|
||||
PHINode *PN = PHINode::Create(I->getType(),
|
||||
I->getName() + ".tr", InsertPos);
|
||||
I->replaceAllUsesWith(PN); // Everyone use the PHI node now!
|
||||
PN->addIncoming(I, NewEntry);
|
||||
ArgumentPHIs.push_back(PN);
|
||||
|
@ -641,7 +641,8 @@ ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
|
||||
Function *oldFunction = header->getParent();
|
||||
|
||||
// This takes place of the original loop
|
||||
BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction, header);
|
||||
BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction,
|
||||
header);
|
||||
|
||||
// The new function needs a root node because other nodes can branch to the
|
||||
// head of the region, but the entry node of a function cannot have preds.
|
||||
|
@ -532,7 +532,8 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
|
||||
GR->eraseFromParent();
|
||||
}
|
||||
} else {
|
||||
PHINode *PHI = PHINode::Create(RTy, TheCall->getName(), AfterCallBB->begin());
|
||||
PHINode *PHI = PHINode::Create(RTy, TheCall->getName(),
|
||||
AfterCallBB->begin());
|
||||
PHIs.push_back(PHI);
|
||||
// Anything that used the result of the function call should now use the
|
||||
// PHI node as their operand.
|
||||
|
@ -281,8 +281,8 @@ Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
|
||||
|
||||
// Otherwise, the idom is the loop, so we need to insert a PHI node. Do so
|
||||
// now, then get values to fill in the incoming values for the PHI.
|
||||
PHINode *PN = PHINode::Create(OrigInst->getType(), OrigInst->getName()+".lcssa",
|
||||
BBN->begin());
|
||||
PHINode *PN = PHINode::Create(OrigInst->getType(),
|
||||
OrigInst->getName() + ".lcssa", BBN->begin());
|
||||
PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN)));
|
||||
V = PN;
|
||||
|
||||
|
@ -802,7 +802,8 @@ static bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI) {
|
||||
AddPredecessorToBlock(NewSuccessors[i], Pred, BB);
|
||||
|
||||
// Now that the successors are updated, create the new Switch instruction.
|
||||
SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault, PredCases.size(), PTI);
|
||||
SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault,
|
||||
PredCases.size(), PTI);
|
||||
for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
|
||||
NewSI->addCase(PredCases[i].first, PredCases[i].second);
|
||||
|
||||
@ -1919,7 +1920,8 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
||||
if (!TrueWhenEqual) std::swap(DefaultBB, EdgeBB);
|
||||
|
||||
// Create the new switch instruction now.
|
||||
SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,Values.size(),BI);
|
||||
SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,
|
||||
Values.size(), BI);
|
||||
|
||||
// Add all of the 'cases' to the switch instruction.
|
||||
for (unsigned i = 0, e = Values.size(); i != e; ++i)
|
||||
|
@ -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...
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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); }
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -734,18 +734,22 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test,
|
||||
// Resolve the call to function F via the JIT API:
|
||||
//
|
||||
// call resolver(GetElementPtr...)
|
||||
CallInst *Resolver = CallInst::Create(resolverFunc, ResolverArgs.begin(),
|
||||
ResolverArgs.end(),
|
||||
"resolver", LookupBB);
|
||||
// cast the result from the resolver to correctly-typed function
|
||||
CastInst *CastedResolver = new BitCastInst(Resolver,
|
||||
PointerType::getUnqual(F->getFunctionType()), "resolverCast", LookupBB);
|
||||
CallInst *Resolver =
|
||||
CallInst::Create(resolverFunc, ResolverArgs.begin(),
|
||||
ResolverArgs.end(), "resolver", LookupBB);
|
||||
|
||||
// Cast the result from the resolver to correctly-typed function.
|
||||
CastInst *CastedResolver =
|
||||
new BitCastInst(Resolver,
|
||||
PointerType::getUnqual(F->getFunctionType()),
|
||||
"resolverCast", LookupBB);
|
||||
|
||||
// Save the value in our cache.
|
||||
new StoreInst(CastedResolver, Cache, LookupBB);
|
||||
BranchInst::Create(DoCallBB, LookupBB);
|
||||
|
||||
PHINode *FuncPtr = PHINode::Create(NullPtr->getType(), "fp", DoCallBB);
|
||||
PHINode *FuncPtr = PHINode::Create(NullPtr->getType(),
|
||||
"fp", DoCallBB);
|
||||
FuncPtr->addIncoming(CastedResolver, LookupBB);
|
||||
FuncPtr->addIncoming(CachedVal, EntryBB);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user