llvm.org GIT mirror llvm / 5932429
Stop casting away const qualifier needlessly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163258 91177308-0d34-0410-b5e6-96231b3b80d8 Roman Divacky 7 years ago
17 changed file(s) with 21 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
129129 StringRef Str = Buffer->getBuffer().slice(Cursor, Cursor+4);
130130 assert (Str.empty() == false && "Unexpected memory buffer end!");
131131 Cursor += 4;
132 Result = *(uint32_t *)(Str.data());
132 Result = *(const uint32_t *)(Str.data());
133133 return Result;
134134 }
135135
549549 //===----------------------------------------------------------------------===//
550550
551551 void AliasSet::print(raw_ostream &OS) const {
552 OS << " AliasSet[" << (void*)this << ", " << RefCount << "] ";
552 OS << " AliasSet[" << (const void*)this << ", " << RefCount << "] ";
553553 OS << (AliasTy == MustAlias ? "must" : "may") << " alias, ";
554554 switch (AccessTy) {
555555 case NoModRef: OS << "No access "; break;
753753 if (Constants[i].isMachineConstantPoolEntry())
754754 Constants[i].Val.MachineCPVal->print(OS);
755755 else
756 OS << *(Value*)Constants[i].Val.ConstVal;
756 OS << *(const Value*)Constants[i].Val.ConstVal;
757757 OS << ", align=" << Constants[i].getAlignment();
758758 OS << "\n";
759759 }
367367 report(msg, MBB->getParent());
368368 *OS << "- basic block: BB#" << MBB->getNumber()
369369 << ' ' << MBB->getName()
370 << " (" << (void*)MBB << ')';
370 << " (" << (const void*)MBB << ')';
371371 if (Indexes)
372372 *OS << " [" << Indexes->getMBBStartIdx(MBB)
373373 << ';' << Indexes->getMBBEndIdx(MBB) << ')';
446446 const PassInfo *TPI = PR->getPassInfo(PrintMachineInstrs.getValue());
447447 const PassInfo *IPI = PR->getPassInfo(StringRef("print-machineinstrs"));
448448 assert (TPI && IPI && "Pass ID not registered!");
449 const char *TID = (char *)(TPI->getTypeInfo());
450 const char *IID = (char *)(IPI->getTypeInfo());
449 const char *TID = (const char *)(TPI->getTypeInfo());
450 const char *IID = (const char *)(IPI->getTypeInfo());
451451 insertPass(TID, IID);
452452 }
453453
330330 }
331331
332332 void SDNode::print_types(raw_ostream &OS, const SelectionDAG *G) const {
333 OS << (void*)this << ": ";
333 OS << (const void*)this << ": ";
334334
335335 for (unsigned i = 0, e = getNumValues(); i != e; ++i) {
336336 if (i) OS << ",";
558558 child->printr(OS, G);
559559 once.insert(child);
560560 } else { // Just the address. FIXME: also print the child's opcode.
561 OS << (void*)child;
561 OS << (const void*)child;
562562 if (unsigned RN = N->getOperand(i).getResNo())
563563 OS << ":" << RN;
564564 }
771771 LegalIntReg = IntReg;
772772 } else {
773773 RegisterTypeForVT[IntReg] = TransformToType[IntReg] =
774 (MVT::SimpleValueType)LegalIntReg;
774 (const MVT::SimpleValueType)LegalIntReg;
775775 ValueTypeActions.setTypeAction(IVT, TypePromoteInteger);
776776 }
777777 }
149149 // Set the string value to also be the data for inlined cstr form
150150 // values only so we can tell the differnence between DW_FORM_string
151151 // and DW_FORM_strp form values
152 Value.data = (uint8_t*)Value.cstr;
152 Value.data = (const uint8_t*)Value.cstr;
153153 break;
154154 case DW_FORM_indirect:
155155 Form = data.getULEB128(offset_ptr);
5151 bool extractValue(DataExtractor data, uint32_t *offset_ptr,
5252 const DWARFCompileUnit *cu);
5353 bool isInlinedCStr() const {
54 return Value.data != NULL && Value.data == (uint8_t*)Value.cstr;
54 return Value.data != NULL && Value.data == (const uint8_t*)Value.cstr;
5555 }
5656 const uint8_t *BlockData() const;
5757 uint64_t getReference(const DWARFCompileUnit* cu) const;
832832 static void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst,
833833 unsigned StoreBytes) {
834834 assert((IntVal.getBitWidth()+7)/8 >= StoreBytes && "Integer too small!");
835 uint8_t *Src = (uint8_t *)IntVal.getRawData();
835 const uint8_t *Src = (const uint8_t *)IntVal.getRawData();
836836
837837 if (sys::isLittleEndianHost()) {
838838 // Little-endian host - the source is ordered from LSB to MSB. Order the
167167 intptr_t LazyPtr = getIndirectSymAddr(Fn);
168168 if (!LazyPtr) {
169169 // In PIC mode, the function stub is loading a lazy-ptr.
170 LazyPtr= (intptr_t)emitGlobalValueIndirectSym((GlobalValue*)F, Fn, JCE);
170 LazyPtr= (intptr_t)emitGlobalValueIndirectSym((const GlobalValue*)F, Fn, JCE);
171171 DEBUG(if (F)
172172 errs() << "JIT: Indirect symbol emitted at [" << LazyPtr
173173 << "] for GV '" << F->getName() << "'\n";
15701570 if (getTargetMachine().getRelocationModel() != Reloc::PIC_ && !IsN64) {
15711571 SDVTList VTs = DAG.getVTList(MVT::i32);
15721572
1573 MipsTargetObjectFile &TLOF = (MipsTargetObjectFile&)getObjFileLowering();
1573 const MipsTargetObjectFile &TLOF = (const MipsTargetObjectFile&)getObjFileLowering();
15741574
15751575 // %gp_rel relocation
15761576 if (TLOF.IsGlobalInSmallSection(GV, getTargetMachine())) {
28352835 MachineFrameInfo *MFI = MF.getFrameInfo();
28362836 const MachineRegisterInfo *MRI = &MF.getRegInfo();
28372837 const X86InstrInfo *TII =
2838 ((X86TargetMachine&)getTargetMachine()).getInstrInfo();
2838 ((const X86TargetMachine&)getTargetMachine()).getInstrInfo();
28392839 for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
28402840 CCValAssign &VA = ArgLocs[i];
28412841 SDValue Arg = OutVals[i];
731731 }
732732
733733 static int ConstantIntSortPredicate(const void *P1, const void *P2) {
734 const ConstantInt *LHS = *(const ConstantInt**)P1;
735 const ConstantInt *RHS = *(const ConstantInt**)P2;
734 const ConstantInt *LHS = *(const ConstantInt*const*)P1;
735 const ConstantInt *RHS = *(const ConstantInt*const*)P2;
736736 if (LHS->getValue().ult(RHS->getValue()))
737737 return 1;
738738 if (LHS->getValue() == RHS->getValue())
11881188 assert(PassDebugging >= Details);
11891189 if (Set.empty())
11901190 return;
1191 dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:";
1191 dbgs() << (const void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:";
11921192 for (unsigned i = 0; i != Set.size(); ++i) {
11931193 if (i) dbgs() << ',';
11941194 const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]);
482482 if (MemBuf->getBufferSize() & 3)
483483 return Error("Bitcode stream should be a multiple of 4 bytes in length");
484484
485 const unsigned char *BufPtr = (unsigned char *)MemBuf->getBufferStart();
485 const unsigned char *BufPtr = (const unsigned char *)MemBuf->getBufferStart();
486486 const unsigned char *EndBufPtr = BufPtr+MemBuf->getBufferSize();
487487
488488 // If we have a wrapper header, parse it and ignore the non-bc file contents.
162162 /// isBitcodeFile - Returns 'true' if the file (or memory contents) is LLVM
163163 /// bitcode.
164164 bool LTOModule::isBitcodeFile(const void *mem, size_t length) {
165 return llvm::sys::IdentifyFileType((char*)mem, length)
165 return llvm::sys::IdentifyFileType((const char*)mem, length)
166166 == llvm::sys::Bitcode_FileType;
167167 }
168168
306306
307307 /// makeBuffer - Create a MemoryBuffer from a memory range.
308308 MemoryBuffer *LTOModule::makeBuffer(const void *mem, size_t length) {
309 const char *startPtr = (char*)mem;
309 const char *startPtr = (const char*)mem;
310310 return MemoryBuffer::getMemBuffer(StringRef(startPtr, length), "", false);
311311 }
312312