зеркало из https://github.com/microsoft/clang-1.git
API changes to match llvm ToT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
8bde505fad
Коммит
d57a7ef925
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "clang/Basic/FileManager.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include "llvm/Config/config.h"
|
||||
using namespace clang;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "clang/Basic/FileManager.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include <algorithm>
|
||||
using namespace clang;
|
||||
|
|
|
@ -478,19 +478,19 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
|
|||
// FIXME: The following handlers should use a callback mechanism, we
|
||||
// don't know what the client would like to do.
|
||||
if (Arg *A = C.getArgs().getLastArg(options::OPT_print_file_name_EQ)) {
|
||||
llvm::outs() << GetFilePath(A->getValue(C.getArgs()), TC).toString()
|
||||
llvm::outs() << GetFilePath(A->getValue(C.getArgs()), TC).str()
|
||||
<< "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arg *A = C.getArgs().getLastArg(options::OPT_print_prog_name_EQ)) {
|
||||
llvm::outs() << GetProgramPath(A->getValue(C.getArgs()), TC).toString()
|
||||
llvm::outs() << GetProgramPath(A->getValue(C.getArgs()), TC).str()
|
||||
<< "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (C.getArgs().hasArg(options::OPT_print_libgcc_file_name)) {
|
||||
llvm::outs() << GetFilePath("libgcc.a", TC).toString() << "\n";
|
||||
llvm::outs() << GetFilePath("libgcc.a", TC).str() << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1239,7 +1239,7 @@ std::string Driver::GetTemporaryPath(const char *Suffix) const {
|
|||
P.eraseFromDisk(false, 0);
|
||||
|
||||
P.appendSuffix(Suffix);
|
||||
return P.toString();
|
||||
return P.str();
|
||||
}
|
||||
|
||||
const HostInfo *Driver::GetHostInfo(const char *TripleStr) const {
|
||||
|
|
|
@ -475,11 +475,10 @@ static ExplodedNode::Auditor* CreateUbiViz() {
|
|||
if (!ErrMsg.empty())
|
||||
return 0;
|
||||
|
||||
llvm::errs() << "Writing '" << Filename << "'.\n";
|
||||
llvm::errs() << "Writing '" << Filename.str() << "'.\n";
|
||||
|
||||
llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
|
||||
std::string filename = Filename.toString();
|
||||
Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), ErrMsg,
|
||||
Stream.reset(new llvm::raw_fd_ostream(Filename.c_str(), ErrMsg,
|
||||
llvm::raw_fd_ostream::F_Force));
|
||||
|
||||
if (!ErrMsg.empty())
|
||||
|
|
|
@ -543,10 +543,10 @@ void clang::CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS) {
|
|||
|
||||
if (!MainFilePath.isAbsolute()) {
|
||||
llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
|
||||
P.appendComponent(MainFilePath.toString());
|
||||
MainFileName = P.toString();
|
||||
P.appendComponent(MainFilePath.str());
|
||||
MainFileName = P.str();
|
||||
} else {
|
||||
MainFileName = MainFilePath.toString();
|
||||
MainFileName = MainFilePath.str();
|
||||
}
|
||||
|
||||
// Create the PTHWriter.
|
||||
|
|
|
@ -55,7 +55,7 @@ bool FixItRewriter::WriteFixedFile(const std::string &InFileName,
|
|||
Path.eraseSuffix();
|
||||
Path.appendSuffix("fixit." + Suffix);
|
||||
std::string Err;
|
||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), Err,
|
||||
OutFile = new llvm::raw_fd_ostream(Path.c_str(), Err,
|
||||
llvm::raw_fd_ostream::F_Binary |
|
||||
llvm::raw_fd_ostream::F_Force);
|
||||
OwnedStream.reset(OutFile);
|
||||
|
|
|
@ -151,7 +151,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
|
|||
|
||||
if (!Directory.isDirectory()) {
|
||||
llvm::errs() << "warning: could not create directory '"
|
||||
<< Directory.toString() << "'\n"
|
||||
<< Directory.str() << "'\n"
|
||||
<< "reason: " << ErrorMsg << '\n';
|
||||
|
||||
noDir = true;
|
||||
|
@ -236,7 +236,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
|
|||
|
||||
if (!llvm::sys::Path(Entry->getName()).isAbsolute()) {
|
||||
llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
|
||||
DirName = P.toString() + "/";
|
||||
DirName = P.str() + "/";
|
||||
}
|
||||
|
||||
// Add the name of the file as an <h1> tag.
|
||||
|
@ -329,10 +329,10 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
|
|||
H.appendSuffix("html");
|
||||
F.renamePathOnDisk(H, NULL);
|
||||
|
||||
os.open(H.toString().c_str());
|
||||
os.open(H.c_str());
|
||||
|
||||
if (!os) {
|
||||
llvm::errs() << "warning: could not create file '" << F.toString() << "'\n";
|
||||
llvm::errs() << "warning: could not create file '" << F.str() << "'\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#include "clang/Basic/LangOptions.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include "llvm/Config/config.h"
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
using namespace clang;
|
||||
|
||||
void InitHeaderSearch::AddPath(const std::string &Path, IncludeDirGroup Group,
|
||||
|
|
|
@ -78,7 +78,7 @@ static void AddQuotedIncludePath(std::vector<char> &Buf,
|
|||
|
||||
// Escape double quotes etc.
|
||||
Buf.push_back('"');
|
||||
std::string EscapedFile = Lexer::Stringify(Path.toString());
|
||||
std::string EscapedFile = Lexer::Stringify(Path.str());
|
||||
Buf.insert(Buf.end(), EscapedFile.begin(), EscapedFile.end());
|
||||
Buf.push_back('"');
|
||||
}
|
||||
|
|
|
@ -542,10 +542,10 @@ void PCHWriter::WriteMetadata(ASTContext &Context, const char *isysroot) {
|
|||
|
||||
if (!MainFilePath.isAbsolute()) {
|
||||
llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
|
||||
P.appendComponent(MainFilePath.toString());
|
||||
MainFileName = P.toString();
|
||||
P.appendComponent(MainFilePath.str());
|
||||
MainFileName = P.str();
|
||||
} else {
|
||||
MainFileName = MainFilePath.toString();
|
||||
MainFileName = MainFilePath.str();
|
||||
}
|
||||
|
||||
const char *MainFileNameStr = MainFileName.c_str();
|
||||
|
@ -895,8 +895,8 @@ void PCHWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
|
|||
std::string FilenameStr;
|
||||
if (!FilePath.isAbsolute()) {
|
||||
llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
|
||||
P.appendComponent(FilePath.toString());
|
||||
FilenameStr = P.toString();
|
||||
P.appendComponent(FilePath.str());
|
||||
FilenameStr = P.str();
|
||||
Filename = FilenameStr.c_str();
|
||||
}
|
||||
|
||||
|
|
|
@ -1743,7 +1743,7 @@ static llvm::raw_ostream *ComputeOutFile(const std::string &InFile,
|
|||
llvm::sys::Path Path(InFile);
|
||||
Path.eraseSuffix();
|
||||
Path.appendSuffix(Extension);
|
||||
OutFile = Path.toString();
|
||||
OutFile = Path.str();
|
||||
} else {
|
||||
OutFile = "-";
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче