diff options
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 803e418..6de1531 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -387,9 +387,7 @@ void CompilerInstance::createCodeCompletionConsumer() { setCodeCompletionConsumer( createCodeCompletionConsumer(getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column, - getFrontendOpts().ShowMacrosInCodeCompletion, - getFrontendOpts().ShowCodePatternsInCodeCompletion, - getFrontendOpts().ShowGlobalSymbolsInCodeCompletion, + getFrontendOpts().CodeCompleteOpts, llvm::outs())); if (!CompletionConsumer) return; @@ -415,16 +413,13 @@ CompilerInstance::createCodeCompletionConsumer(Preprocessor &PP, const std::string &Filename, unsigned Line, unsigned Column, - bool ShowMacros, - bool ShowCodePatterns, - bool ShowGlobals, + const CodeCompleteOptions &Opts, raw_ostream &OS) { if (EnableCodeCompletion(PP, Filename, Line, Column)) return 0; // Set up the creation routine for code-completion. - return new PrintingCodeCompleteConsumer(ShowMacros, ShowCodePatterns, - ShowGlobals, OS); + return new PrintingCodeCompleteConsumer(Opts, OS); } void CompilerInstance::createSema(TranslationUnitKind TUKind, @@ -456,7 +451,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) { FileMgr->FixupRelativePath(NewOutFile); if (llvm::error_code ec = llvm::sys::fs::rename(it->TempFilename, NewOutFile.str())) { - getDiagnostics().Report(diag::err_fe_unable_to_rename_temp) + getDiagnostics().Report(diag::err_unable_to_rename_temp) << it->TempFilename << it->Filename << ec.message(); bool existed; @@ -560,7 +555,8 @@ CompilerInstance::createOutputFile(StringRef OutputPath, TempPath += "-%%%%%%%%"; int fd; if (llvm::sys::fs::unique_file(TempPath.str(), fd, TempPath, - /*makeAbsolute=*/false) == llvm::errc::success) { + /*makeAbsolute=*/false, 0664) + == llvm::errc::success) { OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true)); OSFile = TempFile = TempPath.str(); } @@ -859,13 +855,6 @@ Module *CompilerInstance::loadModule(SourceLocation ImportLoc, } // Determine what file we're searching from. - SourceManager &SourceMgr = getSourceManager(); - SourceLocation ExpandedImportLoc = SourceMgr.getExpansionLoc(ImportLoc); - const FileEntry *CurFile - = SourceMgr.getFileEntryForID(SourceMgr.getFileID(ExpandedImportLoc)); - if (!CurFile) - CurFile = SourceMgr.getFileEntryForID(SourceMgr.getMainFileID()); - StringRef ModuleName = Path[0].first->getName(); SourceLocation ModuleNameLoc = Path[0].second; |