diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /lib/Frontend/CompilerInstance.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
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; |