aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/ASTConsumers.cpp14
-rw-r--r--lib/Frontend/ASTMerge.cpp4
-rw-r--r--lib/Frontend/ASTUnit.cpp60
-rw-r--r--lib/Frontend/CacheTokens.cpp20
-rw-r--r--lib/Frontend/CompilerInstance.cpp34
-rw-r--r--lib/Frontend/CompilerInvocation.cpp34
-rw-r--r--lib/Frontend/CreateInvocationFromCommandLine.cpp4
-rw-r--r--lib/Frontend/DependencyFile.cpp26
-rw-r--r--lib/Frontend/FrontendAction.cpp12
-rw-r--r--lib/Frontend/FrontendActions.cpp28
-rw-r--r--lib/Frontend/FrontendOptions.cpp2
-rw-r--r--lib/Frontend/HeaderIncludeGen.cpp8
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp62
-rw-r--r--lib/Frontend/InitPreprocessor.cpp78
-rw-r--r--lib/Frontend/LangStandards.cpp2
-rw-r--r--lib/Frontend/LogDiagnosticPrinter.cpp4
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp34
-rw-r--r--lib/Frontend/TextDiagnosticPrinter.cpp36
-rw-r--r--lib/Frontend/VerifyDiagnosticsClient.cpp10
-rw-r--r--lib/Frontend/Warnings.cpp6
20 files changed, 239 insertions, 239 deletions
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp
index 28d312a221..b0746b290c 100644
--- a/lib/Frontend/ASTConsumers.cpp
+++ b/lib/Frontend/ASTConsumers.cpp
@@ -31,11 +31,11 @@ using namespace clang;
namespace {
class ASTPrinter : public ASTConsumer {
- llvm::raw_ostream &Out;
+ raw_ostream &Out;
bool Dump;
public:
- ASTPrinter(llvm::raw_ostream* o = NULL, bool Dump = false)
+ ASTPrinter(raw_ostream* o = NULL, bool Dump = false)
: Out(o? *o : llvm::outs()), Dump(Dump) { }
virtual void HandleTranslationUnit(ASTContext &Context) {
@@ -46,7 +46,7 @@ namespace {
};
} // end anonymous namespace
-ASTConsumer *clang::CreateASTPrinter(llvm::raw_ostream* out) {
+ASTConsumer *clang::CreateASTPrinter(raw_ostream* out) {
return new ASTPrinter(out);
}
@@ -95,7 +95,7 @@ ASTConsumer *clang::CreateASTViewer() { return new ASTViewer(); }
namespace {
class DeclContextPrinter : public ASTConsumer {
- llvm::raw_ostream& Out;
+ raw_ostream& Out;
public:
DeclContextPrinter() : Out(llvm::errs()) {}
@@ -404,10 +404,10 @@ ASTConsumer *clang::CreateDeclContextPrinter() {
namespace {
class ASTDumpXML : public ASTConsumer {
- llvm::raw_ostream &OS;
+ raw_ostream &OS;
public:
- ASTDumpXML(llvm::raw_ostream &OS) : OS(OS) {}
+ ASTDumpXML(raw_ostream &OS) : OS(OS) {}
void HandleTranslationUnit(ASTContext &C) {
C.getTranslationUnitDecl()->dumpXML(OS);
@@ -415,6 +415,6 @@ public:
};
}
-ASTConsumer *clang::CreateASTDumperXML(llvm::raw_ostream &OS) {
+ASTConsumer *clang::CreateASTDumperXML(raw_ostream &OS) {
return new ASTDumpXML(OS);
}
diff --git a/lib/Frontend/ASTMerge.cpp b/lib/Frontend/ASTMerge.cpp
index 3905b99b02..df4650e68f 100644
--- a/lib/Frontend/ASTMerge.cpp
+++ b/lib/Frontend/ASTMerge.cpp
@@ -17,12 +17,12 @@
using namespace clang;
ASTConsumer *ASTMergeAction::CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile) {
+ StringRef InFile) {
return AdaptedAction->CreateASTConsumer(CI, InFile);
}
bool ASTMergeAction::BeginSourceFileAction(CompilerInstance &CI,
- llvm::StringRef Filename) {
+ StringRef Filename) {
// FIXME: This is a hack. We need a better way to communicate the
// AST file, compiler instance, and file name than member variables
// of FrontendAction.
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index e43bdb4226..cd4627bc99 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -66,7 +66,7 @@ namespace {
Start = TimeRecord::getCurrentTime();
}
- void setOutput(const llvm::Twine &Output) {
+ void setOutput(const Twine &Output) {
if (WantTiming)
this->Output = Output.str();
}
@@ -237,7 +237,7 @@ void ASTUnit::CacheCodeCompletionResults() {
// Gather the set of global code completions.
typedef CodeCompletionResult Result;
- llvm::SmallVector<Result, 8> Results;
+ SmallVector<Result, 8> Results;
CachedCompletionAllocator = new GlobalCodeCompletionAllocator;
TheSema->GatherGlobalCodeCompletions(*CachedCompletionAllocator, Results);
@@ -396,13 +396,13 @@ public:
return false;
}
- virtual bool ReadTargetTriple(llvm::StringRef Triple) {
+ virtual bool ReadTargetTriple(StringRef Triple) {
TargetTriple = Triple;
return false;
}
virtual bool ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
- llvm::StringRef OriginalFileName,
+ StringRef OriginalFileName,
std::string &SuggestedPredefines,
FileManager &FileMgr) {
Predefines = Buffers[0].Data;
@@ -422,11 +422,11 @@ public:
};
class StoredDiagnosticClient : public DiagnosticClient {
- llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiags;
+ SmallVectorImpl<StoredDiagnostic> &StoredDiags;
public:
explicit StoredDiagnosticClient(
- llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiags)
+ SmallVectorImpl<StoredDiagnostic> &StoredDiags)
: StoredDiags(StoredDiags) { }
virtual void HandleDiagnostic(Diagnostic::Level Level,
@@ -442,7 +442,7 @@ class CaptureDroppedDiagnostics {
public:
CaptureDroppedDiagnostics(bool RequestCapture, Diagnostic &Diags,
- llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiags)
+ SmallVectorImpl<StoredDiagnostic> &StoredDiags)
: Diags(Diags), Client(StoredDiags), PreviousClient(0)
{
if (RequestCapture || Diags.getClient() == 0) {
@@ -478,7 +478,7 @@ const std::string &ASTUnit::getASTFileName() {
return static_cast<ASTReader *>(Ctx->getExternalSource())->getFileName();
}
-llvm::MemoryBuffer *ASTUnit::getBufferForFile(llvm::StringRef Filename,
+llvm::MemoryBuffer *ASTUnit::getBufferForFile(StringRef Filename,
std::string *ErrorStr) {
assert(FileMgr);
return FileMgr->getBufferForFile(Filename, ErrorStr);
@@ -711,7 +711,7 @@ void AddTopLevelDeclarationToHash(Decl *D, unsigned &Hash) {
return;
}
- if (ObjCClassDecl *Class = llvm::dyn_cast<ObjCClassDecl>(D)) {
+ if (ObjCClassDecl *Class = dyn_cast<ObjCClassDecl>(D)) {
for (ObjCClassDecl::iterator I = Class->begin(), IEnd = Class->end();
I != IEnd; ++I)
AddTopLevelDeclarationToHash(I->getInterface(), Hash);
@@ -753,7 +753,7 @@ public:
ASTUnit &Unit;
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile) {
+ StringRef InFile) {
CI.getPreprocessor().addPPCallbacks(
new MacroDefinitionTrackerPPCallbacks(Unit.getCurrentTopLevelHashValue()));
return new TopLevelDeclTrackerConsumer(Unit,
@@ -778,7 +778,7 @@ class PrecompilePreambleConsumer : public PCHGenerator,
public:
PrecompilePreambleConsumer(ASTUnit &Unit,
const Preprocessor &PP, bool Chaining,
- StringRef isysroot, llvm::raw_ostream *Out)
+ StringRef isysroot, raw_ostream *Out)
: PCHGenerator(PP, "", Chaining, isysroot, Out), Unit(Unit),
Hash(Unit.getCurrentTopLevelHashValue()) {
Hash = 0;
@@ -828,10 +828,10 @@ public:
explicit PrecompilePreambleAction(ASTUnit &Unit) : Unit(Unit) {}
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile) {
+ StringRef InFile) {
std::string Sysroot;
std::string OutputFile;
- llvm::raw_ostream *OS = 0;
+ raw_ostream *OS = 0;
bool Chaining;
if (GeneratePCHAction::ComputeASTConsumerArguments(CI, InFile, Sysroot,
OutputFile,
@@ -1132,7 +1132,7 @@ ASTUnit::ComputePreamble(CompilerInvocation &Invocation,
static llvm::MemoryBuffer *CreatePaddedMainFileBuffer(llvm::MemoryBuffer *Old,
unsigned NewSize,
- llvm::StringRef NewName) {
+ StringRef NewName) {
llvm::MemoryBuffer *Result
= llvm::MemoryBuffer::getNewUninitMemBuffer(NewSize, NewName);
memcpy(const_cast<char*>(Result->getBufferStart()),
@@ -1565,7 +1565,7 @@ unsigned ASTUnit::getMaxPCHLevel() const {
return 0;
}
-llvm::StringRef ASTUnit::getMainFileName() const {
+StringRef ASTUnit::getMainFileName() const {
return Invocation->getFrontendOpts().Inputs[0].second;
}
@@ -1758,7 +1758,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
const char **ArgEnd,
llvm::IntrusiveRefCntPtr<Diagnostic> Diags,
- llvm::StringRef ResourceFilesPath,
+ StringRef ResourceFilesPath,
bool OnlyLocalDecls,
bool CaptureDiagnostics,
RemappedFile *RemappedFiles,
@@ -1778,7 +1778,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
ArgBegin);
}
- llvm::SmallVector<StoredDiagnostic, 4> StoredDiagnostics;
+ SmallVector<StoredDiagnostic, 4> StoredDiagnostics;
llvm::IntrusiveRefCntPtr<CompilerInvocation> CI;
@@ -2064,7 +2064,7 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
// Contains the set of names that are hidden by "local" completion results.
llvm::StringSet<llvm::BumpPtrAllocator> HiddenNames;
typedef CodeCompletionResult Result;
- llvm::SmallVector<Result, 8> AllResults;
+ SmallVector<Result, 8> AllResults;
for (ASTUnit::cached_completion_iterator
C = AST.cached_completion_begin(),
CEnd = AST.cached_completion_end();
@@ -2146,7 +2146,7 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
-void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
+void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
RemappedFile *RemappedFiles,
unsigned NumRemappedFiles,
bool IncludeMacros,
@@ -2154,14 +2154,14 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
CodeCompleteConsumer &Consumer,
Diagnostic &Diag, LangOptions &LangOpts,
SourceManager &SourceMgr, FileManager &FileMgr,
- llvm::SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics,
- llvm::SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers) {
+ SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics,
+ SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers) {
if (!Invocation)
return;
SimpleTimer CompletionTimer(WantTiming);
CompletionTimer.setOutput("Code completion @ " + File + ":" +
- llvm::Twine(Line) + ":" + llvm::Twine(Column));
+ Twine(Line) + ":" + Twine(Column));
llvm::IntrusiveRefCntPtr<CompilerInvocation>
CCInvocation(new CompilerInvocation(*Invocation));
@@ -2303,7 +2303,7 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
}
}
-CXSaveError ASTUnit::Save(llvm::StringRef File) {
+CXSaveError ASTUnit::Save(StringRef File) {
if (getDiagnostics().hasUnrecoverableErrorOccurred())
return CXSaveError_TranslationErrors;
@@ -2341,7 +2341,7 @@ CXSaveError ASTUnit::Save(llvm::StringRef File) {
return CXSaveError_None;
}
-bool ASTUnit::serialize(llvm::raw_ostream &OS) {
+bool ASTUnit::serialize(raw_ostream &OS) {
if (getDiagnostics().hasErrorOccurred())
return true;
@@ -2368,17 +2368,17 @@ static void TranslateSLoc(SourceLocation &L, SLocRemap &Remap) {
void ASTUnit::TranslateStoredDiagnostics(
ASTReader *MMan,
- llvm::StringRef ModName,
+ StringRef ModName,
SourceManager &SrcMgr,
- const llvm::SmallVectorImpl<StoredDiagnostic> &Diags,
- llvm::SmallVectorImpl<StoredDiagnostic> &Out) {
+ const SmallVectorImpl<StoredDiagnostic> &Diags,
+ SmallVectorImpl<StoredDiagnostic> &Out) {
// The stored diagnostic has the old source manager in it; update
// the locations to refer into the new source manager. We also need to remap
// all the locations to the new view. This includes the diag location, any
// associated source ranges, and the source ranges of associated fix-its.
// FIXME: There should be a cleaner way to do this.
- llvm::SmallVector<StoredDiagnostic, 4> Result;
+ SmallVector<StoredDiagnostic, 4> Result;
Result.reserve(Diags.size());
assert(MMan && "Don't have a module manager");
serialization::Module *Mod = MMan->Modules.lookup(ModName);
@@ -2391,7 +2391,7 @@ void ASTUnit::TranslateStoredDiagnostics(
TranslateSLoc(L, Remap);
FullSourceLoc Loc(L, SrcMgr);
- llvm::SmallVector<CharSourceRange, 4> Ranges;
+ SmallVector<CharSourceRange, 4> Ranges;
Ranges.reserve(SD.range_size());
for (StoredDiagnostic::range_iterator I = SD.range_begin(),
E = SD.range_end();
@@ -2403,7 +2403,7 @@ void ASTUnit::TranslateStoredDiagnostics(
Ranges.push_back(CharSourceRange(SourceRange(BL, EL), I->isTokenRange()));
}
- llvm::SmallVector<FixItHint, 2> FixIts;
+ SmallVector<FixItHint, 2> FixIts;
FixIts.reserve(SD.fixit_size());
for (StoredDiagnostic::fixit_iterator I = SD.fixit_begin(),
E = SD.fixit_end();
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp
index 20b51893fc..8195445fe0 100644
--- a/lib/Frontend/CacheTokens.cpp
+++ b/lib/Frontend/CacheTokens.cpp
@@ -71,13 +71,13 @@ public:
bool isFile() const { return Kind == IsFE; }
- llvm::StringRef getString() const {
+ StringRef getString() const {
return Kind == IsFE ? FE->getName() : Path;
}
unsigned getKind() const { return (unsigned) Kind; }
- void EmitData(llvm::raw_ostream& Out) {
+ void EmitData(raw_ostream& Out) {
switch (Kind) {
case IsFE:
// Emit stat information.
@@ -119,7 +119,7 @@ public:
}
static std::pair<unsigned,unsigned>
- EmitKeyDataLength(llvm::raw_ostream& Out, PTHEntryKeyVariant V,
+ EmitKeyDataLength(raw_ostream& Out, PTHEntryKeyVariant V,
const PTHEntry& E) {
unsigned n = V.getString().size() + 1 + 1;
@@ -131,14 +131,14 @@ public:
return std::make_pair(n, m);
}
- static void EmitKey(llvm::raw_ostream& Out, PTHEntryKeyVariant V, unsigned n){
+ static void EmitKey(raw_ostream& Out, PTHEntryKeyVariant V, unsigned n){
// Emit the entry kind.
::Emit8(Out, (unsigned) V.getKind());
// Emit the string.
Out.write(V.getString().data(), n - 1);
}
- static void EmitData(llvm::raw_ostream& Out, PTHEntryKeyVariant V,
+ static void EmitData(raw_ostream& Out, PTHEntryKeyVariant V,
const PTHEntry& E, unsigned) {
@@ -197,7 +197,7 @@ class PTHWriter {
Out.write(Ptr, NumBytes);
}
- void EmitString(llvm::StringRef V) {
+ void EmitString(StringRef V) {
::Emit16(Out, V.size());
EmitBuf(V.data(), V.size());
}
@@ -247,7 +247,7 @@ void PTHWriter::EmitToken(const Token& T) {
} else {
// We cache *un-cleaned* spellings. This gives us 100% fidelity with the
// source code.
- llvm::StringRef s(T.getLiteralData(), T.getLength());
+ StringRef s(T.getLiteralData(), T.getLength());
// Get the string entry.
llvm::StringMapEntry<OffsetOpt> *E = &CachedStrs.GetOrCreateValue(s);
@@ -584,20 +584,20 @@ public:
}
static std::pair<unsigned,unsigned>
- EmitKeyDataLength(llvm::raw_ostream& Out, const PTHIdKey* key, uint32_t) {
+ EmitKeyDataLength(raw_ostream& Out, const PTHIdKey* key, uint32_t) {
unsigned n = key->II->getLength() + 1;
::Emit16(Out, n);
return std::make_pair(n, sizeof(uint32_t));
}
- static void EmitKey(llvm::raw_ostream& Out, PTHIdKey* key, unsigned n) {
+ static void EmitKey(raw_ostream& Out, PTHIdKey* key, unsigned n) {
// Record the location of the key data. This is used when generating
// the mapping from persistent IDs to strings.
key->FileOffset = Out.tell();
Out.write(key->II->getNameStart(), n);
}
- static void EmitData(llvm::raw_ostream& Out, PTHIdKey*, uint32_t pID,
+ static void EmitData(raw_ostream& Out, PTHIdKey*, uint32_t pID,
unsigned) {
::Emit32(Out, pID);
}
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 8bf9ed9f9d..ef0796ab01 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -89,7 +89,7 @@ static void SetUpBuildDumpLog(const DiagnosticOptions &DiagOpts,
unsigned argc, const char* const *argv,
Diagnostic &Diags) {
std::string ErrorInfo;
- llvm::OwningPtr<llvm::raw_ostream> OS(
+ llvm::OwningPtr<raw_ostream> OS(
new llvm::raw_fd_ostream(DiagOpts.DumpBuildInformation.c_str(), ErrorInfo));
if (!ErrorInfo.empty()) {
Diags.Report(diag::err_fe_unable_to_open_logfile)
@@ -113,7 +113,7 @@ static void SetUpDiagnosticLog(const DiagnosticOptions &DiagOpts,
Diagnostic &Diags) {
std::string ErrorInfo;
bool OwnsStream = false;
- llvm::raw_ostream *OS = &llvm::errs();
+ raw_ostream *OS = &llvm::errs();
if (DiagOpts.DiagnosticLogFile != "-") {
// Create the output stream.
llvm::raw_fd_ostream *FileOS(
@@ -241,7 +241,7 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags,
if (DepOpts.ShowHeaderIncludes)
AttachHeaderIncludeGen(*PP);
if (!DepOpts.HeaderIncludeOutputFile.empty()) {
- llvm::StringRef OutputPath = DepOpts.HeaderIncludeOutputFile;
+ StringRef OutputPath = DepOpts.HeaderIncludeOutputFile;
if (OutputPath == "-")
OutputPath = "";
AttachHeaderIncludeGen(*PP, /*ShowAllHeaders=*/true, OutputPath,
@@ -263,7 +263,7 @@ void CompilerInstance::createASTContext() {
// ExternalASTSource
-void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
+void CompilerInstance::createPCHExternalASTSource(StringRef Path,
bool DisablePCHValidation,
bool DisableStatCache,
void *DeserializationListener){
@@ -280,7 +280,7 @@ void CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
}
ExternalASTSource *
-CompilerInstance::createPCHExternalASTSource(llvm::StringRef Path,
+CompilerInstance::createPCHExternalASTSource(StringRef Path,
const std::string &Sysroot,
bool DisablePCHValidation,
bool DisableStatCache,
@@ -373,7 +373,7 @@ CompilerInstance::createCodeCompletionConsumer(Preprocessor &PP,
bool ShowMacros,
bool ShowCodePatterns,
bool ShowGlobals,
- llvm::raw_ostream &OS) {
+ raw_ostream &OS) {
if (EnableCodeCompletion(PP, Filename, Line, Column))
return 0;
@@ -427,17 +427,17 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) {
llvm::raw_fd_ostream *
CompilerInstance::createDefaultOutputFile(bool Binary,
- llvm::StringRef InFile,
- llvm::StringRef Extension) {
+ StringRef InFile,
+ StringRef Extension) {
return createOutputFile(getFrontendOpts().OutputFile, Binary,
/*RemoveFileOnSignal=*/true, InFile, Extension);
}
llvm::raw_fd_ostream *
-CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
+CompilerInstance::createOutputFile(StringRef OutputPath,
bool Binary, bool RemoveFileOnSignal,
- llvm::StringRef InFile,
- llvm::StringRef Extension) {
+ StringRef InFile,
+ StringRef Extension) {
std::string Error, OutputPathName, TempPathName;
llvm::raw_fd_ostream *OS = createOutputFile(OutputPath, Error, Binary,
RemoveFileOnSignal,
@@ -459,12 +459,12 @@ CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
}
llvm::raw_fd_ostream *
-CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
+CompilerInstance::createOutputFile(StringRef OutputPath,
std::string &Error,
bool Binary,
bool RemoveFileOnSignal,
- llvm::StringRef InFile,
- llvm::StringRef Extension,
+ StringRef InFile,
+ StringRef Extension,
std::string *ResultPathName,
std::string *TempPathName) {
std::string OutFile, TempFile;
@@ -519,12 +519,12 @@ CompilerInstance::createOutputFile(llvm::StringRef OutputPath,
// Initialization Utilities
-bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile) {
+bool CompilerInstance::InitializeSourceManager(StringRef InputFile) {
return InitializeSourceManager(InputFile, getDiagnostics(), getFileManager(),
getSourceManager(), getFrontendOpts());
}
-bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
+bool CompilerInstance::InitializeSourceManager(StringRef InputFile,
Diagnostic &Diags,
FileManager &FileMgr,
SourceManager &SourceMgr,
@@ -567,7 +567,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
// FIXME: Take this as an argument, once all the APIs we used have moved to
// taking it as an input instead of hard-coding llvm::errs.
- llvm::raw_ostream &OS = llvm::errs();
+ raw_ostream &OS = llvm::errs();
// Create the target instance.
setTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), getTargetOpts()));
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index d2cdde01d9..8967d5280b 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -878,7 +878,7 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
using namespace cc1options;
if (Arg *A = Args.getLastArg(OPT_analyzer_store)) {
- llvm::StringRef Name = A->getValue(Args);
+ StringRef Name = A->getValue(Args);
AnalysisStores Value = llvm::StringSwitch<AnalysisStores>(Name)
#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \
.Case(CMDFLAG, NAME##Model)
@@ -893,7 +893,7 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
}
if (Arg *A = Args.getLastArg(OPT_analyzer_constraints)) {
- llvm::StringRef Name = A->getValue(Args);
+ StringRef Name = A->getValue(Args);
AnalysisConstraints Value = llvm::StringSwitch<AnalysisConstraints>(Name)
#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) \
.Case(CMDFLAG, NAME##Model)
@@ -908,7 +908,7 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
}
if (Arg *A = Args.getLastArg(OPT_analyzer_output)) {
- llvm::StringRef Name = A->getValue(Args);
+ StringRef Name = A->getValue(Args);
AnalysisDiagClients Value = llvm::StringSwitch<AnalysisDiagClients>(Name)
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREAT) \
.Case(CMDFLAG, PD_##NAME)
@@ -950,8 +950,8 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
bool enable = (A->getOption().getID() == OPT_analyzer_checker);
// We can have a list of comma separated checker names, e.g:
// '-analyzer-checker=cocoa,unix'
- llvm::StringRef checkerList = A->getValue(Args);
- llvm::SmallVector<llvm::StringRef, 4> checkers;
+ StringRef checkerList = A->getValue(Args);
+ SmallVector<StringRef, 4> checkers;
checkerList.split(checkers, ",");
for (unsigned i = 0, e = checkers.size(); i != e; ++i)
Opts.CheckersControlList.push_back(std::make_pair(checkers[i], enable));
@@ -1034,7 +1034,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
- llvm::StringRef Name = A->getValue(Args);
+ StringRef Name = A->getValue(Args);
unsigned Method = llvm::StringSwitch<unsigned>(Name)
.Case("legacy", CodeGenOptions::Legacy)
.Case("non-legacy", CodeGenOptions::NonLegacy)
@@ -1084,7 +1084,7 @@ static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
if (A->getOption().matches(OPT_fdiagnostics_show_note_include_stack))
Opts.ShowNoteIncludeStack = true;
- llvm::StringRef ShowOverloads =
+ StringRef ShowOverloads =
Args.getLastArgValue(OPT_fshow_overloads_EQ, "all");
if (ShowOverloads == "best")
Opts.ShowOverloads = Diagnostic::Ovl_Best;
@@ -1095,7 +1095,7 @@ static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
<< Args.getLastArg(OPT_fshow_overloads_EQ)->getAsString(Args)
<< ShowOverloads;
- llvm::StringRef ShowCategory =
+ StringRef ShowCategory =
Args.getLastArgValue(OPT_fdiagnostics_show_category, "none");
if (ShowCategory == "none")
Opts.ShowCategories = 0;
@@ -1108,7 +1108,7 @@ static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
<< Args.getLastArg(OPT_fdiagnostics_show_category)->getAsString(Args)
<< ShowCategory;
- llvm::StringRef Format =
+ StringRef Format =
Args.getLastArgValue(OPT_fdiagnostics_format, "clang");
if (Format == "clang")
Opts.Format = DiagnosticOptions::Clang;
@@ -1325,7 +1325,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
InputKind IK = DashX;
if (IK == IK_None) {
IK = FrontendOptions::getInputKindForExtension(
- llvm::StringRef(Inputs[i]).rsplit('.').second);
+ StringRef(Inputs[i]).rsplit('.').second);
// FIXME: Remove this hack.
if (i == 0)
DashX = IK;
@@ -1371,7 +1371,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
/*IsFramework=*/ (*it)->getOption().matches(OPT_F), false);
// Add -iprefix/-iwith-prefix/-iwithprefixbefore options.
- llvm::StringRef Prefix = ""; // FIXME: This isn't the correct default prefix.
+ StringRef Prefix = ""; // FIXME: This isn't the correct default prefix.
for (arg_iterator it = Args.filtered_begin(OPT_iprefix, OPT_iwithprefix,
OPT_iwithprefixbefore),
ie = Args.filtered_end(); it != ie; ++it) {
@@ -1593,7 +1593,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (Args.hasArg(OPT_fdelayed_template_parsing))
Opts.DelayedTemplateParsing = 1;
- llvm::StringRef Vis = Args.getLastArgValue(OPT_fvisibility, "default");
+ StringRef Vis = Args.getLastArgValue(OPT_fvisibility, "default");
if (Vis == "default")
Opts.setVisibilityMode(DefaultVisibility);
else if (Vis == "hidden")
@@ -1731,12 +1731,12 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
}
if (const Arg *A = Args.getLastArg(OPT_preamble_bytes_EQ)) {
- llvm::StringRef Value(A->getValue(Args));
+ StringRef Value(A->getValue(Args));
size_t Comma = Value.find(',');
unsigned Bytes = 0;
unsigned EndOfLine = 0;
- if (Comma == llvm::StringRef::npos ||
+ if (Comma == StringRef::npos ||
Value.substr(0, Comma).getAsInteger(10, Bytes) ||
Value.substr(Comma + 1).getAsInteger(10, EndOfLine))
Diags.Report(diag::err_drv_preamble_format);
@@ -1787,8 +1787,8 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
for (arg_iterator it = Args.filtered_begin(OPT_remap_file),
ie = Args.filtered_end(); it != ie; ++it) {
const Arg *A = *it;
- std::pair<llvm::StringRef,llvm::StringRef> Split =
- llvm::StringRef(A->getValue(Args)).split(';');
+ std::pair<StringRef,StringRef> Split =
+ StringRef(A->getValue(Args)).split(';');
if (Split.second.empty()) {
Diags.Report(diag::err_drv_invalid_remap_file) << A->getAsString(Args);
@@ -1799,7 +1799,7 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
}
if (Arg *A = Args.getLastArg(OPT_fobjc_arc_cxxlib_EQ)) {
- llvm::StringRef Name = A->getValue(Args);
+ StringRef Name = A->getValue(Args);
unsigned Library = llvm::StringSwitch<unsigned>(Name)
.Case("libc++", ARCXX_libcxx)
.Case("libstdc++", ARCXX_libstdcxx)
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 42b648aa64..fa34334b5d 100644
--- a/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -39,7 +39,7 @@ clang::createInvocationFromCommandLine(llvm::ArrayRef<const char *> ArgList,
ArgList.begin());
}
- llvm::SmallVector<const char *, 16> Args;
+ SmallVector<const char *, 16> Args;
Args.push_back("<clang>"); // FIXME: Remove dummy argument.
Args.insert(Args.end(), ArgList.begin(), ArgList.end());
@@ -74,7 +74,7 @@ clang::createInvocationFromCommandLine(llvm::ArrayRef<const char *> ArgList,
}
const driver::Command *Cmd = cast<driver::Command>(*Jobs.begin());
- if (llvm::StringRef(Cmd->getCreator().getName()) != "clang") {
+ if (StringRef(Cmd->getCreator().getName()) != "clang") {
Diags->Report(diag::err_fe_expected_clang_command);
return 0;
}
diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp
index 1edd09b06c..9cffed2b35 100644
--- a/lib/Frontend/DependencyFile.cpp
+++ b/lib/Frontend/DependencyFile.cpp
@@ -32,19 +32,19 @@ class DependencyFileCallback : public PPCallbacks {
llvm::StringSet<> FilesSet;
const Preprocessor *PP;
std::vector<std::string> Targets;
- llvm::raw_ostream *OS;
+ raw_ostream *OS;
bool IncludeSystemHeaders;
bool PhonyTarget;
bool AddMissingHeaderDeps;
private:
bool FileMatchesDepCriteria(const char *Filename,
SrcMgr::CharacteristicKind FileType);
- void AddFilename(llvm::StringRef Filename);
+ void AddFilename(StringRef Filename);
void OutputDependencyFile();
public:
DependencyFileCallback(const Preprocessor *_PP,
- llvm::raw_ostream *_OS,
+ raw_ostream *_OS,
const DependencyOutputOptions &Opts)
: PP(_PP), Targets(Opts.Targets), OS(_OS),
IncludeSystemHeaders(Opts.IncludeSystemHeaders),
@@ -55,12 +55,12 @@ public:
SrcMgr::CharacteristicKind FileType);
virtual void InclusionDirective(SourceLocation HashLoc,
const Token &IncludeTok,
- llvm::StringRef FileName,
+ StringRef FileName,
bool IsAngled,
const FileEntry *File,
SourceLocation EndLoc,
- llvm::StringRef SearchPath,
- llvm::StringRef RelativePath);
+ StringRef SearchPath,
+ StringRef RelativePath);
virtual void EndOfMainFile() {
OutputDependencyFile();
@@ -78,7 +78,7 @@ void clang::AttachDependencyFileGen(Preprocessor &PP,
}
std::string Err;
- llvm::raw_ostream *OS(new llvm::raw_fd_ostream(Opts.OutputFile.c_str(), Err));
+ raw_ostream *OS(new llvm::raw_fd_ostream(Opts.OutputFile.c_str(), Err));
if (!Err.empty()) {
PP.getDiagnostics().Report(diag::err_fe_error_opening)
<< Opts.OutputFile << Err;
@@ -126,7 +126,7 @@ void DependencyFileCallback::FileC