[cfe-commits] r90822 - in /cfe/trunk: include/clang/Driver/Driver.h lib/CodeGen/CGDebugInfo.cpp lib/Driver/Driver.cpp lib/Frontend/ASTUnit.cpp tools/driver/driver.cpp
Jeffrey Yasskin
jyasskin at google.com
Mon Dec 7 17:46:24 PST 2009
Author: jyasskin
Date: Mon Dec 7 19:46:24 2009
New Revision: 90822
URL: http://llvm.org/viewvc/llvm-project?rev=90822&view=rev
Log:
Remove several .c_str() to be forward-compatible with StringRef.
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=90822&r1=90821&r2=90822&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Mon Dec 7 19:46:24 2009
@@ -15,6 +15,7 @@
#include "clang/Driver/Phases.h"
#include "clang/Driver/Util.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/System/Path.h" // FIXME: Kill when CompilationInfo
// lands.
@@ -112,9 +113,9 @@
std::list<std::string> ResultFiles;
public:
- Driver(const char *_Name, const char *_Dir,
- const char *_DefaultHostTriple,
- const char *_DefaultImageName,
+ Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
+ llvm::StringRef _DefaultHostTriple,
+ llvm::StringRef _DefaultImageName,
bool IsProduction, Diagnostic &_Diags);
~Driver();
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=90822&r1=90821&r2=90822&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Dec 7 19:46:24 2009
@@ -137,8 +137,8 @@
// Create new compile unit.
return Unit = DebugFactory.CreateCompileUnit(LangTag,
- AbsFileName.getLast().c_str(),
- AbsFileName.getDirname().c_str(),
+ AbsFileName.getLast(),
+ AbsFileName.getDirname(),
Producer.c_str(), isMain,
isOptimized, Flags, RuntimeVers);
}
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=90822&r1=90821&r2=90822&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Dec 7 19:46:24 2009
@@ -41,9 +41,9 @@
// Used to set values for "production" clang, for releases.
// #define USE_PRODUCTION_CLANG
-Driver::Driver(const char *_Name, const char *_Dir,
- const char *_DefaultHostTriple,
- const char *_DefaultImageName,
+Driver::Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
+ llvm::StringRef _DefaultHostTriple,
+ llvm::StringRef _DefaultImageName,
bool IsProduction, Diagnostic &_Diags)
: Opts(createDriverOptTable()), Diags(_Diags),
Name(_Name), Dir(_Dir), DefaultHostTriple(_DefaultHostTriple),
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=90822&r1=90821&r2=90822&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Mon Dec 7 19:46:24 2009
@@ -300,8 +300,8 @@
Args.push_back("-fsyntax-only");
llvm::sys::Path Path = llvm::sys::Path::GetMainExecutable(Argv0, MainAddr);
- driver::Driver TheDriver(Path.getBasename().c_str(),Path.getDirname().c_str(),
- llvm::sys::getHostTriple().c_str(),
+ driver::Driver TheDriver(Path.getBasename(), Path.getDirname(),
+ llvm::sys::getHostTriple(),
"a.out", false, Diags);
llvm::OwningPtr<driver::Compilation> C(
TheDriver.BuildCompilation(Args.size(), Args.data()));
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=90822&r1=90821&r2=90822&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Mon Dec 7 19:46:24 2009
@@ -212,8 +212,8 @@
#else
bool IsProduction = false;
#endif
- Driver TheDriver(Path.getBasename().c_str(), Path.getDirname().c_str(),
- llvm::sys::getHostTriple().c_str(),
+ Driver TheDriver(Path.getBasename(), Path.getDirname(),
+ llvm::sys::getHostTriple(),
"a.out", IsProduction, Diags);
// Check for ".*++" or ".*++-[^-]*" to determine if we are a C++
More information about the cfe-commits
mailing list