diff options
Diffstat (limited to 'lib')
63 files changed, 1205 insertions, 1205 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index 21ca2dc037..2aaf19e595 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -418,7 +418,7 @@ DSGraph &BUDataStructures::CreateGraphForExternalFunction(const Function &Fn) { DSG->getReturnNodes().insert(std::make_pair(F, DSNodeHandle())); if (F->getName() == "free") { // Taking the address of free. - + // Free should take a single pointer argument, mark it as heap memory. DSNode *N = new DSNode(0, DSG); N->setHeapNodeMarker(); diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index d730ca256a..f56c59ad18 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -682,9 +682,9 @@ void BytecodeReader::ParseInstruction(std::vector<unsigned> &Oprnds, const Type* ArgTy = getValue(iType, Oprnds[0])->getType(); Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0); - //b = vaarg a, t -> + //b = vaarg a, t -> //foo = alloca 1 of t - //bar = vacopy a + //bar = vacopy a //store bar -> foo //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp index a198447d72..4db954a307 100644 --- a/lib/Bytecode/Reader/ReaderWrappers.cpp +++ b/lib/Bytecode/Reader/ReaderWrappers.cpp @@ -170,17 +170,17 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) { if(Function* F = M->getNamedFunction("llvm.va_start")) { assert(F->arg_size() == 0 && "Obsolete va_start takes 0 argument!"); - + //foo = va_start() // -> //bar = alloca typeof(foo) //va_start(bar) //foo = load bar - + const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID); const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); - Function* NF = M->getOrInsertFunction("llvm.va_start", + Function* NF = M->getOrInsertFunction("llvm.va_start", RetTy, ArgTyPtr, 0); for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) @@ -193,7 +193,7 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) { } F->setName(""); } - + if(Function* F = M->getNamedFunction("llvm.va_end")) { assert(F->arg_size() == 1 && "Obsolete va_end takes 1 argument!"); //vaend foo @@ -203,9 +203,9 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) { const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID); const Type* ArgTy = F->getFunctionType()->getParamType(0); const Type* ArgTyPtr = PointerType::get(ArgTy); - Function* NF = M->getOrInsertFunction("llvm.va_end", + Function* NF = M->getOrInsertFunction("llvm.va_end", RetTy, ArgTyPtr, 0); - + for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) if (CallInst* CI = dyn_cast<CallInst>(*I++)) { AllocaInst* bar = new AllocaInst(ArgTy, 0, "vaend.fix.1", CI); @@ -215,7 +215,7 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) { } F->setName(""); } - + if(Function* F = M->getNamedFunction("llvm.va_copy")) { assert(F->arg_size() == 1 && "Obsolete va_copy takes 1 argument!"); //foo = vacopy(bar) @@ -225,13 +225,13 @@ static ModuleProvider* CheckVarargs(ModuleProvider* MP) { //store bar -> b //vacopy(a, b) //foo = load a - + const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID); const Type* ArgTy = F->getFunctionType()->getReturnType(); const Type* ArgTyPtr = PointerType::get(ArgTy); - Function* NF = M->getOrInsertFunction("llvm.va_copy", + Function* NF = M->getOrInsertFunction("llvm.va_copy", RetTy, ArgTyPtr, ArgTyPtr, 0); - + for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;) if (CallInst* CI = dyn_cast<CallInst>(*I++)) { AllocaInst* a = new AllocaInst(ArgTy, 0, "vacopy.fix.1", CI); diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index 90cfa96462..95bbd2e575 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -628,7 +628,7 @@ void BytecodeWriter::outputInstruction(const Instruction &I) { Opcode = 57; // FastCC invoke. else if (II->getCallingConv() != CallingConv::C) Opcode = 56; // Invoke escape sequence. - + } else if (isa<LoadInst>(I) && cast<LoadInst>(I).isVolatile()) { Opcode = 62; } else if (isa<StoreInst>(I) && cast<StoreInst>(I).isVolatile()) { diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp index d53afde6a4..7963b658d6 100644 --- a/lib/CodeGen/ELFWriter.cpp +++ b/lib/CodeGen/ELFWriter.cpp @@ -108,15 +108,15 @@ void ELFCodeEmitter::startFunction(MachineFunction &F) { ELFWriter::ELFSection::SHF_EXECINSTR | ELFWriter::ELFSection::SHF_ALLOC); OutBuffer = &ES->SectionData; - + // Upgrade the section alignment if required. if (ES->Align < Align) ES->Align = Align; - + // Add padding zeros to the end of the buffer to make sure that the // function will start on the correct byte alignment within the section. size_t SectionOff = OutBuffer->size(); ELFWriter::align(*OutBuffer, Align); - + FnStart = OutBuffer->size(); } @@ -125,7 +125,7 @@ void ELFCodeEmitter::startFunction(MachineFunction &F) { void ELFCodeEmitter::finishFunction(MachineFunction &F) { // We now know the size of the function, add a symbol to represent it. ELFWriter::ELFSym FnSym(F.getFunction()); - + // Figure out the binding (linkage) of the symbol. switch (F.getFunction()->getLinkage()) { default: @@ -149,7 +149,7 @@ void ELFCodeEmitter::finishFunction(MachineFunction &F) { FnSym.SectionIdx = ES->SectionIdx; FnSym.Value = FnStart; // Value = Offset from start of Section. FnSym.Size = OutBuffer->size()-FnStart; - + // Finally, add it to the symtab. EW.SymbolTable.push_back(FnSym); } @@ -162,7 +162,7 @@ ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { e_machine = 0; // e_machine defaults to 'No Machine' e_flags = 0; // e_flags defaults to 0, no flags. - is64Bit = TM.getTargetData().getPointerSizeInBits() == 64; + is64Bit = TM.getTargetData().getPointerSizeInBits() == 64; isLittleEndian = TM.getTargetData().isLittleEndian(); // Create the machine code emitter object for this target. @@ -181,7 +181,7 @@ bool ELFWriter::doInitialization(Module &M) { // Local alias to shortenify coming code. std::vector<unsigned char> &FH = FileHeader; - + outbyte(FH, 0x7F); // EI_MAG0 outbyte(FH, 'E'); // EI_MAG1 outbyte(FH, 'L'); // EI_MAG2 @@ -190,7 +190,7 @@ bool ELFWriter::doInitialization(Module &M) { outbyte(FH, isLittleEndian ? 1 : 2); // EI_DATA outbyte(FH, 1); // EI_VERSION FH.resize(16); // EI_PAD up to 16 bytes. - + // This should change for shared objects. outhalf(FH, 1); // e_type = ET_REL outhalf(FH, e_machine); // e_machine = whatever the target wants @@ -207,7 +207,7 @@ bool ELFWriter::doInitialization(Module &M) { outhalf(FH, 0); // e_phnum = # prog header entries = 0 outhalf(FH, is64Bit ? 64 : 40); // e_shentsize = sect hdr entry size - + ELFHeader_e_shnum_Offset = FH.size(); outhalf(FH, 0); // e_shnum = # of section header ents ELFHeader_e_shstrndx_Offset = FH.size(); @@ -235,7 +235,7 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) { SymbolTable.push_back(ExternalSym); return; } - + const Type *GVType = (const Type*)GV->getType(); unsigned Align = TM.getTargetData().getTypeAlignment(GVType); unsigned Size = TM.getTargetData().getTypeSize(GVType); @@ -473,11 +473,11 @@ void ELFWriter::OutputSectionsAndSectionTable() { // Now that we know where all of the sections will be emitted, set the e_shnum // entry in the ELF header. fixhalf(FileHeader, NumSections, ELFHeader_e_shnum_Offset); - + // Now that we know the offset in the file of the section table, update the // e_shoff address in the ELF header. fixaddr(FileHeader, FileOff, ELFHeader_e_shoff_Offset); - + // Now that we know all of the data in the file header, emit it and all of the // sections! O.write((char*)&FileHeader[0], FileHeader.size()); @@ -516,7 +516,7 @@ void ELFWriter::OutputSectionsAndSectionTable() { for (size_t NewFileOff = (FileOff+TableAlign-1) & ~(TableAlign-1); FileOff != NewFileOff; ++FileOff) O.put(0xAB); - + // Emit the section table itself. O.write((char*)&Table[0], Table.size()); } diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 98d00f67f1..b2dd57b50c 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -150,7 +150,7 @@ static Value *LowerCTPOP(Value *V, Instruction *IP) { ConstantExpr::getCast(ConstantUInt::get(Type::ULongTy, MaskValues[ct]), V->getType()); Value *LHS = BinaryOperator::createAnd(V, MaskCst, "cppop.and1", IP); - Value *VShift = new ShiftInst(Instruction::Shr, V, + Value *VShift = new ShiftInst(Instruction::Shr, V, ConstantInt::get(Type::UByteTy, i), "ctpop.sh", IP); Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP); V = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP); diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index a7070f1b26..a2a231b182 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -128,7 +128,7 @@ private: SDOperand ExpandLegalUINT_TO_FP(SDOperand LegalOp, MVT::ValueType DestVT); SDOperand PromoteLegalINT_TO_FP(SDOperand LegalOp, MVT::ValueType DestVT, bool isSigned); - + bool ExpandShift(unsigned Opc, SDOperand Op, SDOperand Amt, SDOperand &Lo, SDOperand &Hi); void ExpandShiftParts(unsigned NodeOp, SDOperand Op, SDOperand Amt, @@ -152,22 +152,22 @@ SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag) "Too many value types for ValueTypeActions to hold!"); } -/// ExpandLegalUINT_TO_FP - This function is responsible for legalizing a +/// ExpandLegalUINT_TO_FP - This function is responsible for legalizing a /// UINT_TO_FP operation of the specified operand when the target requests that /// we expand it. At this point, we know that the result and operand types are /// legal for the target. SDOperand SelectionDAGLegalize::ExpandLegalUINT_TO_FP(SDOperand Op0, MVT::ValueType DestVT) { SDOperand Tmp1 = DAG.getNode(ISD::SINT_TO_FP, DestVT, Op0); - - SDOperand SignSet = DAG.getSetCC(ISD::SETLT, TLI.getSetCCResultTy(), + + SDOperand SignSet = DAG.getSetCC(ISD::SETLT, TLI.getSetCCResultTy(), Op0, - DAG.getConstant(0, + DAG.getConstant(0, Op0.getValueType())); SDOperand Zero = getIntPtrConstant(0), Four = getIntPtrConstant(4); SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(), SignSet, Four, Zero); - + // If the sign bit of the integer is set, the large number will be treated as // a negative number. To counteract this, the dynamic code adds an offset // depending on the data type. @@ -181,7 +181,7 @@ SDOperand SelectionDAGLegalize::ExpandLegalUINT_TO_FP(SDOperand Op0, } if (TLI.isLittleEndian()) FF <<= 32; static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF); - + MachineConstantPool *CP = DAG.getMachineFunction().getConstantPool(); SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(FudgeFactor), TLI.getPointerTy()); @@ -196,12 +196,12 @@ SDOperand SelectionDAGLegalize::ExpandLegalUINT_TO_FP(SDOperand Op0, DAG.getEntryNode(), CPIdx, DAG.getSrcValue(NULL), MVT::f32)); } - + NeedsAnotherIteration = true; return DAG.getNode(ISD::ADD, DestVT, Tmp1, FudgeInReg); } -/// PromoteLegalUINT_TO_FP - This function is responsible for legalizing a +/// PromoteLegalUINT_TO_FP - This function is responsible for legalizing a /// UINT_TO_FP operation of the specified operand when the target requests that /// we promote it. At this point, we know that the result and operand types are /// legal for the target, and that there is a legal UINT_TO_FP or SINT_TO_FP @@ -211,14 +211,14 @@ SDOperand SelectionDAGLegalize::PromoteLegalINT_TO_FP(SDOperand LegalOp, bool isSigned) { // First step, figure out the appropriate *INT_TO_FP operation to use. MVT::ValueType NewInTy = LegalOp.getValueType(); - + unsigned OpToUse = 0; - + // Scan for the appropriate larger type to use. while (1) { NewInTy = (MVT::ValueType)(NewInTy+1); assert(MVT::isInteger(NewInTy) && "Ran out of possibilities!"); - + // If the target supports SINT_TO_FP of this type, use it. switch (TLI.getOperationAction(ISD::SINT_TO_FP, NewInTy)) { default: break; @@ -232,7 +232,7 @@ SDOperand SelectionDAGLegalize::PromoteLegalINT_TO_FP(SDOperand LegalOp, } if (OpToUse) break; if (isSigned) continue; - + // If the target supports UINT_TO_FP of this type, use it. switch (TLI.getOperationAction(ISD::UINT_TO_FP, NewInTy)) { default: break; @@ -245,13 +245,13 @@ SDOperand SelectionDAGLegalize::PromoteLegalINT_TO_FP(SDOperand LegalOp, break; } if (OpToUse) break; - + // Otherwise, try a larger type. } // Make sure to legalize any nodes we create here in the next pass. NeedsAnotherIteration = true; - + // Okay, we found the operation and type to use. Zero extend our input to the // desired type then run the operation on it. return DAG.getNode(OpToUse, DestVT, @@ -760,7 +760,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { float F; } V; V.F = CFP->getValue(); - Result = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, + Result = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, DAG.getConstant(V.I, MVT::i32), Tmp2, Node->getOperand(3)); } else { @@ -770,7 +770,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { double F; } V; V.F = CFP->getValue(); - Result = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, + Result = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, DAG.getConstant(V.I, MVT::i64), Tmp2, Node->getOperand(3)); } @@ -1282,15 +1282,15 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { break; case ISD::CTTZ: //if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT) - Tmp2 = DAG.getSetCC(ISD::SETEQ, TLI.getSetCCResultTy(), Tmp1, + Tmp2 = DAG.getSetCC(ISD::SETEQ, TLI.getSetCCResultTy(), Tmp1, DAG.getConstant(getSizeInBits(NVT), NVT)); - Result = DAG.getNode(ISD::SELECT, NVT, Tmp2, + Result = DAG.getNode(ISD::SELECT, NVT, Tmp2, DAG.getConstant(getSizeInBits(OVT),NVT), Tmp1); break; case ISD::CTLZ: //Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT)) - Result = DAG.getNode(ISD::SUB, NVT, Tmp1, - DAG.getConstant(getSizeInBits(NVT) - + Result = DAG.getNode(ISD::SUB, NVT, Tmp1, + DAG.getConstant(getSizeInBits(NVT) - getSizeInBits(OVT), NVT)); break; } @@ -1314,7 +1314,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { //x = (x & mask[i][len/8]) + (x >> (1 << i) & mask[i][len/8]) Tmp2 = DAG.getConstant(mask[i], VT); Tmp3 = DAG.getConstant(1ULL << i, ShVT); - Tmp1 = DAG.getNode(ISD::ADD, VT, + Tmp1 = DAG.getNode(ISD::ADD, VT, DAG.getNode(ISD::AND, VT, Tmp1, Tmp2), DAG.getNode(ISD::AND, VT, DAG.getNode(ISD::SRL, VT, Tmp1, Tmp3), @@ -1329,16 +1329,16 @@ SDOperand SelectionDAGLegalize::Legal |