llvm::Constant *initWith = 0) {
llvm::BasicBlock &block = function.getEntryBlock();
llvm::IRBuilder<> tmp(&block, block.begin());
- llvm::AllocaInst *ret = tmp.CreateAlloca(type, 0, varName.c_str());
+ llvm::AllocaInst *ret = tmp.CreateAlloca(type, 0, varName);
if (initWith)
tmp.CreateStore(initWith, ret);
const Constant *&C) {
auto Source = StringValue.str(); // The source has to be null terminated.
SMDiagnostic Err;
- C = parseConstantValue(Source.c_str(), Err, *MF.getFunction()->getParent(),
+ C = parseConstantValue(Source, Err, *MF.getFunction()->getParent(),
&PFS.IRSlots);
if (!C)
return error(Loc + Err.getColumnNo(), Err.getMessage());
TAA, TAAParsed, StubSize);
if (!ErrorStr.empty())
- return Error(Loc, ErrorStr.c_str());
+ return Error(Loc, ErrorStr);
// Issue a warning if the target is not powerpc and Section is a *coal* section.
Triple TT = getParser().getContext().getObjectFileInfo()->getTargetTriple();
uint64_t BytesWritten = sizeof(MachO::linker_option_command);
for (const std::string &Option : Options) {
// Write each string, including the null byte.
- writeBytes(Option.c_str(), Option.size() + 1);
+ writeBytes(Option, Option.size() + 1);
BytesWritten += Option.size() + 1;
}
else
IO.setError(
llvm::Twine("YAML Object File unsupported document type tag '") +
- llvm::Twine(Tag.c_str()) + llvm::Twine("'!"));
+ llvm::Twine(Tag) + llvm::Twine("'!"));
}
}
}
ES << "0-" << Max;
else
ES << Max << "-" << (-Max - 1);
- return Parser.printError(IDLoc, ES.str().c_str());
+ return Parser.printError(IDLoc, ES.str());
}
int HexagonAsmParser::processInstruction(MCInst &Inst,
MachineFunction &Fn) {
std::string VDescStr = ".long 0x1dffe0" + getStringReg(Reg);
- const char *cstr = Fn.createExternalSymbolName(VDescStr.c_str());
+ const char *cstr = Fn.createExternalSymbolName(VDescStr);
unsigned ExtraInfo = InlineAsm::Extra_HasSideEffects;
BuildMI(*MBB, I, DL, QII->get(TargetOpcode::INLINEASM))
.addExternalSymbol(cstr)
const char *Sym = MFI->getImageHandleSymbol(Index);
std::string *SymNamePtr =
nvTM.getManagedStrPool()->getManagedString(Sym);
- MCOp = GetSymbolRef(OutContext.getOrCreateSymbol(
- StringRef(SymNamePtr->c_str())));
+ MCOp = GetSymbolRef(OutContext.getOrCreateSymbol(StringRef(*SymNamePtr)));
}
void NVPTXAsmPrinter::lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) {
return nullptr;
// Load the object from the cache filename
ErrorOr<std::unique_ptr<MemoryBuffer>> IRObjectBuffer =
- MemoryBuffer::getFile(CacheName.c_str(), -1, false);
+ MemoryBuffer::getFile(CacheName, -1, false);
// If the file isn't there, that's OK.
if (!IRObjectBuffer)
return nullptr;
for (unsigned i = BaseArg; i < InputFilenames.size(); ++i) {
CurrentActivity = "loading file '" + InputFilenames[i] + "'";
ErrorOr<std::unique_ptr<LTOModule>> ModuleOrErr =
- LTOModule::createFromFile(Context, InputFilenames[i].c_str(), Options);
+ LTOModule::createFromFile(Context, InputFilenames[i], Options);
std::unique_ptr<LTOModule> &Module = *ModuleOrErr;
CurrentActivity = "";
// Add all the exported symbols to the table of symbols to preserve.
for (unsigned i = 0; i < ExportedSymbols.size(); ++i)
- CodeGen.addMustPreserveSymbol(ExportedSymbols[i].c_str());
+ CodeGen.addMustPreserveSymbol(ExportedSymbols[i]);
// Add all the dso symbols to the table of symbols to expose.
for (unsigned i = 0; i < KeptDSOSyms.size(); ++i)
- CodeGen.addMustPreserveSymbol(KeptDSOSyms[i].c_str());
+ CodeGen.addMustPreserveSymbol(KeptDSOSyms[i]);
// Set cpu and attrs strings for the default target/subtarget.
CodeGen.setCpu(MCPU.c_str());
}
if (!attrs.empty())
- CodeGen.setAttr(attrs.c_str());
+ CodeGen.setAttr(attrs);
if (FileType.getNumOccurrences())
CodeGen.setFileType(FileType);
ModuleFilename += ".merged.bc";
std::string ErrMsg;
- if (!CodeGen.writeMergedModules(ModuleFilename.c_str()))
+ if (!CodeGen.writeMergedModules(ModuleFilename))
error("writing merged module failed.");
}
attrs.append(MAttrs[i]);
}
- CG->setAttr(attrs.c_str());
+ CG->setAttr(attrs);
}
if (OptLevel < '0' || OptLevel > '3')
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
return false;
}
- StringRef getPassName() const override { return PassName.c_str(); }
+ StringRef getPassName() const override { return PassName; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(PassToPrint->getTypeInfo());
// If ARCH has sub-arch support, find it
SmallVectorImpl<std::string>::const_iterator I = SupportedSubArchs.begin();
for(; I != SupportedSubArchs.end(); ++I)
- if (Host.getArchName().startswith(I->c_str()))
+ if (Host.getArchName().startswith(*I))
return true;
return false;