diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 32 | ||||
-rw-r--r-- | lib/Frontend/ChainedIncludesSource.cpp | 14 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 14 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 8 | ||||
-rw-r--r-- | lib/Frontend/SerializedDiagnosticPrinter.cpp | 2 |
7 files changed, 39 insertions, 39 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index a9454a1aa0..fce28b7488 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -654,7 +654,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, RemappedFile *RemappedFiles, unsigned NumRemappedFiles, bool CaptureDiagnostics) { - llvm::OwningPtr<ASTUnit> AST(new ASTUnit(true)); + OwningPtr<ASTUnit> AST(new ASTUnit(true)); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit> @@ -729,7 +729,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, std::string Predefines; unsigned Counter; - llvm::OwningPtr<ASTReader> Reader; + OwningPtr<ASTReader> Reader; AST->PP = new Preprocessor(AST->getDiagnostics(), AST->ASTFileLangOpts, /*Target=*/0, AST->getSourceManager(), HeaderInfo, @@ -778,7 +778,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, // source, so that declarations will be deserialized from the // AST file as needed. ASTReader *ReaderPtr = Reader.get(); - llvm::OwningPtr<ExternalASTSource> Source(Reader.take()); + OwningPtr<ExternalASTSource> Source(Reader.take()); // Unregister the cleanup for ASTReader. It will get cleaned up // by the ASTUnit cleanup. @@ -1025,7 +1025,7 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) { } // Create the compiler instance to use for building the AST. - llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance()); + OwningPtr<CompilerInstance> Clang(new CompilerInstance()); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1114,7 +1114,7 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) { SavedMainFileBuffer = OverrideMainBuffer; } - llvm::OwningPtr<TopLevelDeclTrackerAction> Act( + OwningPtr<TopLevelDeclTrackerAction> Act( new TopLevelDeclTrackerAction(*this)); // Recover resources if we crash before exiting this method. @@ -1319,7 +1319,7 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble( = ComputePreamble(*PreambleInvocation, MaxLines, CreatedPreambleBuffer); // If ComputePreamble() Take ownership of the preamble buffer. - llvm::OwningPtr<llvm::MemoryBuffer> OwnedPreambleBuffer; + OwningPtr<llvm::MemoryBuffer> OwnedPreambleBuffer; if (CreatedPreambleBuffer) OwnedPreambleBuffer.reset(NewPreamble.first); @@ -1501,7 +1501,7 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble( PreprocessorOpts.PrecompiledPreambleBytes.second = false; // Create the compiler instance to use for building the precompiled preamble. - llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance()); + OwningPtr<CompilerInstance> Clang(new CompilerInstance()); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1553,7 +1553,7 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble( Clang->setSourceManager(new SourceManager(getDiagnostics(), Clang->getFileManager())); - llvm::OwningPtr<PrecompilePreambleAction> Act; + OwningPtr<PrecompilePreambleAction> Act; Act.reset(new PrecompilePreambleAction(*this)); if (!Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) { llvm::sys::Path(FrontendOpts.OutputFile).eraseFromDisk(); @@ -1648,7 +1648,7 @@ StringRef ASTUnit::getMainFileName() const { ASTUnit *ASTUnit::create(CompilerInvocation *CI, llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags, bool CaptureDiagnostics) { - llvm::OwningPtr<ASTUnit> AST; + OwningPtr<ASTUnit> AST; AST.reset(new ASTUnit(false)); ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics); AST->Diagnostics = Diags; @@ -1672,7 +1672,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI, bool CacheCodeCompletionResults) { assert(CI && "A CompilerInvocation is required"); - llvm::OwningPtr<ASTUnit> OwnAST; + OwningPtr<ASTUnit> OwnAST; ASTUnit *AST = Unit; if (!AST) { // Create the AST unit. @@ -1707,7 +1707,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI, AST->TargetFeatures = CI->getTargetOpts().Features; // Create the compiler instance to use for building the AST. - llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance()); + OwningPtr<CompilerInstance> Clang(new CompilerInstance()); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -1754,7 +1754,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI, ASTFrontendAction *Act = Action; - llvm::OwningPtr<TopLevelDeclTrackerAction> TrackerAct; + OwningPtr<TopLevelDeclTrackerAction> TrackerAct; if (!Act) { TrackerAct.reset(new TopLevelDeclTrackerAction(*AST)); Act = TrackerAct.get(); @@ -1835,7 +1835,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI, bool CacheCodeCompletionResults, bool NestedMacroExpansions) { // Create the AST unit. - llvm::OwningPtr<ASTUnit> AST; + OwningPtr<ASTUnit> AST; AST.reset(new ASTUnit(false)); ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics); AST->Diagnostics = Diags; @@ -1911,7 +1911,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath; // Create the AST unit. - llvm::OwningPtr<ASTUnit> AST; + OwningPtr<ASTUnit> AST; AST.reset(new ASTUnit(false)); ConfigureDiags(Diags, ArgBegin, ArgEnd, *AST, CaptureDiagnostics); AST->Diagnostics = Diags; @@ -2270,7 +2270,7 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column, // Set the language options appropriately. LangOpts = *CCInvocation->getLangOpts(); - llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance()); + OwningPtr<CompilerInstance> Clang(new CompilerInstance()); // Recover resources if we crash before exiting this method. llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance> @@ -2378,7 +2378,7 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column, // Disable the preprocessing record PreprocessorOpts.DetailedRecord = false; - llvm::OwningPtr<SyntaxOnlyAction> Act; + OwningPtr<SyntaxOnlyAction> Act; Act.reset(new SyntaxOnlyAction); if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0])) { if (OverrideMainBuffer) { diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index 45cf672aa8..4ecc052198 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -31,7 +31,7 @@ static ASTReader *createASTReader(CompilerInstance &CI, SmallVector<std::string, 4> &bufNames, ASTDeserializationListener *deserialListener = 0) { Preprocessor &PP = CI.getPreprocessor(); - llvm::OwningPtr<ASTReader> Reader; + OwningPtr<ASTReader> Reader; Reader.reset(new ASTReader(PP, CI.getASTContext(), /*isysroot=*/"", /*DisableValidation=*/true)); for (unsigned ti = 0; ti < bufNames.size(); ++ti) { @@ -62,7 +62,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { std::vector<std::string> &includes = CI.getPreprocessorOpts().ChainedIncludes; assert(!includes.empty() && "No '-chain-include' in options!"); - llvm::OwningPtr<ChainedIncludesSource> source(new ChainedIncludesSource()); + OwningPtr<ChainedIncludesSource> source(new ChainedIncludesSource()); InputKind IK = CI.getFrontendOpts().Inputs[0].Kind; SmallVector<llvm::MemoryBuffer *, 4> serialBufs; @@ -70,7 +70,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { for (unsigned i = 0, e = includes.size(); i != e; ++i) { bool firstInclude = (i == 0); - llvm::OwningPtr<CompilerInvocation> CInvok; + OwningPtr<CompilerInvocation> CInvok; CInvok.reset(new CompilerInvocation(CI.getInvocation())); CInvok->getPreprocessorOpts().ChainedIncludes.clear(); @@ -91,7 +91,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags( new DiagnosticsEngine(DiagID, DiagClient)); - llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance()); + OwningPtr<CompilerInstance> Clang(new CompilerInstance()); Clang->setInvocation(CInvok.take()); Clang->setDiagnostics(Diags.getPtr()); Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(), @@ -105,7 +105,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { SmallVector<char, 256> serialAST; llvm::raw_svector_ostream OS(serialAST); - llvm::OwningPtr<ASTConsumer> consumer; + OwningPtr<ASTConsumer> consumer; consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", 0, /*isysroot=*/"", &OS)); Clang->getASTContext().setASTMutationListener( @@ -132,7 +132,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { serialBufNames.push_back(pchName); - llvm::OwningPtr<ExternalASTSource> Reader; + OwningPtr<ExternalASTSource> Reader; Reader.reset(createASTReader(*Clang, pchName, bufs, serialBufNames, Clang->getASTConsumer().GetASTDeserializationListener())); @@ -156,7 +156,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { assert(!serialBufs.empty()); std::string pchName = includes.back() + ".pch-final"; serialBufNames.push_back(pchName); - llvm::OwningPtr<ASTReader> Reader; + OwningPtr<ASTReader> Reader; Reader.reset(createASTReader(CI, pchName, serialBufs, serialBufNames)); if (!Reader) return 0; diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 03dc626170..a3669d798a 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -95,7 +95,7 @@ static void SetUpBuildDumpLog(const DiagnosticOptions &DiagOpts, unsigned argc, const char* const *argv, DiagnosticsEngine &Diags) { std::string ErrorInfo; - llvm::OwningPtr<raw_ostream> OS( + 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) @@ -148,7 +148,7 @@ static void SetupSerializedDiagnostics(const DiagnosticOptions &DiagOpts, DiagnosticsEngine &Diags, StringRef OutputFile) { std::string ErrorInfo; - llvm::OwningPtr<llvm::raw_fd_ostream> OS; + OwningPtr<llvm::raw_fd_ostream> OS; OS.reset(new llvm::raw_fd_ostream(OutputFile.str().c_str(), ErrorInfo, llvm::raw_fd_ostream::F_Binary)); @@ -308,7 +308,7 @@ void CompilerInstance::createPCHExternalASTSource(StringRef Path, bool DisablePCHValidation, bool DisableStatCache, void *DeserializationListener){ - llvm::OwningPtr<ExternalASTSource> Source; + OwningPtr<ExternalASTSource> Source; bool Preamble = getPreprocessorOpts().PrecompiledPreambleBytes.first != 0; Source.reset(createPCHExternalASTSource(Path, getHeaderSearchOpts().Sysroot, DisablePCHValidation, @@ -329,7 +329,7 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path, ASTContext &Context, void *DeserializationListener, bool Preamble) { - llvm::OwningPtr<ASTReader> Reader; + OwningPtr<ASTReader> Reader; Reader.reset(new ASTReader(PP, Context, Sysroot.empty() ? "" : Sysroot.c_str(), DisablePCHValidation, DisableStatCache)); @@ -525,7 +525,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath, OutFile = "-"; } - llvm::OwningPtr<llvm::raw_fd_ostream> OS; + OwningPtr<llvm::raw_fd_ostream> OS; std::string OSFile; if (UseTemporary && OutFile != "-") { @@ -593,7 +593,7 @@ bool CompilerInstance::InitializeSourceManager(StringRef InputFile, } SourceMgr.createMainFileID(File, Kind); } else { - llvm::OwningPtr<llvm::MemoryBuffer> SB; + OwningPtr<llvm::MemoryBuffer> SB; if (llvm::MemoryBuffer::getSTDIN(SB)) { // FIXME: Give ec.message() in this diag. Diags.Report(diag::err_fe_error_reading_stdin); @@ -935,7 +935,7 @@ Module *CompilerInstance::loadModule(SourceLocation ImportLoc, getASTContext().setASTMutationListener( getASTConsumer().GetASTMutationListener()); } - llvm::OwningPtr<ExternalASTSource> Source; + OwningPtr<ExternalASTSource> Source; Source.reset(ModuleManager); getASTContext().setExternalSource(Source); if (hasSema()) diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 7fd2247907..7876bcb243 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2059,9 +2059,9 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, bool Success = true; // Parse the arguments. - llvm::OwningPtr<OptTable> Opts(createCC1OptTable()); + OwningPtr<OptTable> Opts(createCC1OptTable()); unsigned MissingArgIndex, MissingArgCount; - llvm::OwningPtr<InputArgList> Args( + OwningPtr<InputArgList> Args( Opts->ParseArgs(ArgBegin, ArgEnd,MissingArgIndex, MissingArgCount)); // Check for missing argument error. diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index f7a296143f..fec9b6691b 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -54,7 +54,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, // Don't check that inputs exist, they may have been remapped. TheDriver.setCheckInputsExist(false); - llvm::OwningPtr<driver::Compilation> C(TheDriver.BuildCompilation(Args)); + OwningPtr<driver::Compilation> C(TheDriver.BuildCompilation(Args)); // Just print the cc1 options if -### was present. if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) { @@ -80,7 +80,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, } const driver::ArgStringList &CCArgs = Cmd->getArguments(); - llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation()); + OwningPtr<CompilerInvocation> CI(new CompilerInvocation()); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast<const char **>(CCArgs.data()), const_cast<const char **>(CCArgs.data()) + diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index 11ac572479..34f445f062 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -144,7 +144,7 @@ ASTConsumer* FrontendAction::CreateWrappedASTConsumer(CompilerInstance &CI, ie = FrontendPluginRegistry::end(); it != ie; ++it) { if (it->getName() == CI.getFrontendOpts().AddPluginActions[i]) { - llvm::OwningPtr<PluginASTAction> P(it->instantiate()); + OwningPtr<PluginASTAction> P(it->instantiate()); FrontendAction* c = P.get(); if (P->ParseArgs(CI, CI.getFrontendOpts().AddPluginArgs[i])) Consumers.push_back(c->CreateASTConsumer(CI, InFile)); @@ -238,7 +238,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (!usesPreprocessorOnly()) { CI.createASTContext(); - llvm::OwningPtr<ASTConsumer> Consumer( + OwningPtr<ASTConsumer> Consumer( CreateWrappedASTConsumer(CI, Input.File)); if (!Consumer) goto failure; @@ -247,7 +247,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) { // Convert headers to PCH and chain them. - llvm::OwningPtr<ExternalASTSource> source; + OwningPtr<ExternalASTSource> source; source.reset(ChainedIncludesSource::create(CI)); if (!source) goto failure; @@ -290,7 +290,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, // provides the layouts from that file. if (!CI.getFrontendOpts().OverrideRecordLayoutsFile.empty() && CI.hasASTContext() && !CI.getASTContext().getExternalSource()) { - llvm::OwningPtr<ExternalASTSource> + OwningPtr<ExternalASTSource> Override(new LayoutOverrideSource( CI.getFrontendOpts().OverrideRecordLayoutsFile)); CI.getASTContext().setExternalSource(Override); diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index 4bf813e160..bdf0b550c7 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -170,7 +170,7 @@ private: llvm::BitstreamWriter Stream; /// \brief The name of the diagnostics file. - llvm::OwningPtr<llvm::raw_ostream> OS; + OwningPtr<llvm::raw_ostream> OS; /// \brief The set of constructed record abbreviations. AbbreviationMap Abbrevs; |