summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-01 01:18:23 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-01 01:18:23 +0000
commit4cc259a469d9f9ce991eb63c4c3e7412c6a5940a (patch)
tree8b87c80f2b782d4e630ac3c78fcc420e188218b1
parent05cfdd08003d533609786500346d4a0d49aa5830 (diff)
downloadbcm5719-llvm-4cc259a469d9f9ce991eb63c4c3e7412c6a5940a.tar.gz
bcm5719-llvm-4cc259a469d9f9ce991eb63c4c3e7412c6a5940a.zip
Use StringRef in LTOCodegenerator (NFC)
llvm-svn: 282998
-rw-r--r--llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h8
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
index a1bce8a3293..bbd671eb818 100644
--- a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
@@ -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
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 6dabdf110ac..81fb58a4e0a 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -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);
OpenPOWER on IntegriCloud