Use StringRef in LTOCodegenerator (NFC)

llvm-svn: 282998
This commit is contained in:
Mehdi Amini 2016-10-01 01:18:23 +00:00
parent 05cfdd0800
commit 4cc259a469
2 changed files with 8 additions and 8 deletions

View File

@ -86,8 +86,8 @@ struct LTOCodeGenerator {
/// The default is TargetMachine::CGFT_ObjectFile.
void setFileType(TargetMachine::CodeGenFileType FT) { FileType = FT; }
void setCpu(const char *MCpu) { this->MCpu = MCpu; }
void setAttr(const char *MAttr) { this->MAttr = MAttr; }
void setCpu(StringRef MCpu) { this->MCpu = MCpu; }
void setAttr(StringRef MAttr) { this->MAttr = MAttr; }
void setOptLevel(unsigned OptLevel);
void setShouldInternalize(bool Value) { ShouldInternalize = Value; }
@ -117,7 +117,7 @@ struct LTOCodeGenerator {
/// name is misleading). This function should be called before
/// LTOCodeGenerator::compilexxx(), and
/// LTOCodeGenerator::writeMergedModules().
void setCodeGenDebugOptions(const char *Opts);
void setCodeGenDebugOptions(StringRef Opts);
/// Parse the options set in setCodeGenDebugOptions.
///
@ -130,7 +130,7 @@ struct LTOCodeGenerator {
/// true on success.
///
/// Calls \a verifyMergedModuleOnce().
bool writeMergedModules(const char *Path);
bool writeMergedModules(StringRef Path);
/// Compile the merged module into a *single* output file; the path to output
/// file is returned to the caller via argument "name". Return true on

View File

@ -199,7 +199,7 @@ void LTOCodeGenerator::setOptLevel(unsigned Level) {
llvm_unreachable("Unknown optimization level!");
}
bool LTOCodeGenerator::writeMergedModules(const char *Path) {
bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
if (!determineTarget())
return false;
@ -240,7 +240,7 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
SmallString<128> Filename;
int FD;
const char *Extension =
StringRef Extension
(FileType == TargetMachine::CGFT_AssemblyFile ? "s" : "o");
std::error_code EC =
@ -251,7 +251,7 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
}
// generate object file
tool_output_file objFile(Filename.c_str(), FD);
tool_output_file objFile(Filename, FD);
bool genResult = compileOptimized(&objFile.os());
objFile.os().close();
@ -586,7 +586,7 @@ bool LTOCodeGenerator::compileOptimized(ArrayRef<raw_pwrite_stream *> Out) {
/// setCodeGenDebugOptions - Set codegen debugging options to aid in debugging
/// LTO problems.
void LTOCodeGenerator::setCodeGenDebugOptions(const char *Options) {
void LTOCodeGenerator::setCodeGenDebugOptions(StringRef Options) {
for (std::pair<StringRef, StringRef> o = getToken(Options); !o.first.empty();
o = getToken(o.second))
CodegenOptions.push_back(o.first);