[cfe-commits] r90441 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td lib/AST/TypePrinter.cpp lib/Frontend/ASTConsumers.cpp lib/Frontend/DiagChecker.cpp lib/Frontend/FixItRewriter.cpp lib/Frontend/InitHeaderSearch.cpp
Daniel Dunbar
daniel at zuster.org
Thu Dec 3 01:14:02 PST 2009
Author: ddunbar
Date: Thu Dec 3 03:14:02 2009
New Revision: 90441
URL: http://llvm.org/viewvc/llvm-project?rev=90441&view=rev
Log:
Kill a few more random stderr uses.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
cfe/trunk/lib/AST/TypePrinter.cpp
cfe/trunk/lib/Frontend/ASTConsumers.cpp
cfe/trunk/lib/Frontend/DiagChecker.cpp
cfe/trunk/lib/Frontend/FixItRewriter.cpp
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Thu Dec 3 03:14:02 2009
@@ -71,6 +71,8 @@
def note_fixit_failed : Note<
"FIX-IT unable to apply suggested code changes">;
def note_fixit_unfixed_error : Note<"FIX-IT detected an error it cannot fix">;
+def note_fixit_main_file_unchanged : Note<
+ "main file unchanged">;
def warn_fixit_no_changes : Note<
"FIX-IT detected errors it could not fix; no output will be generated">;
Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Thu Dec 3 03:14:02 2009
@@ -683,9 +683,8 @@
LangOptions LO;
getAsStringInternal(R, PrintingPolicy(LO));
if (msg)
- fprintf(stderr, "%s: %s\n", msg, R.c_str());
- else
- fprintf(stderr, "%s\n", R.c_str());
+ llvm::errs() << msg << ": ";
+ llvm::errs() << R << "\n";
}
void QualType::dump() const {
dump("");
Modified: cfe/trunk/lib/Frontend/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTConsumers.cpp?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTConsumers.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTConsumers.cpp Thu Dec 3 03:14:02 2009
@@ -28,8 +28,6 @@
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Path.h"
-#include <cstdio>
-
using namespace clang;
//===----------------------------------------------------------------------===//
@@ -406,7 +404,7 @@
break;
}
default:
- fprintf(stderr, "DeclKind: %d \"%s\"\n", DK, I->getDeclKindName());
+ Out << "DeclKind: " << DK << '"' << I->getDeclKindName() << "\"\n";
assert(0 && "decl unhandled");
}
}
Modified: cfe/trunk/lib/Frontend/DiagChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/DiagChecker.cpp?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/DiagChecker.cpp (original)
+++ cfe/trunk/lib/Frontend/DiagChecker.cpp Thu Dec 3 03:14:02 2009
@@ -17,7 +17,7 @@
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Preprocessor.h"
-#include <cstdio>
+#include "llvm/Support/raw_ostream.h"
using namespace clang;
typedef TextDiagnosticBuffer::DiagList DiagList;
@@ -190,12 +190,10 @@
const char *Msg) {
if (diag_begin == diag_end) return false;
- fprintf(stderr, "%s\n", Msg);
-
+ llvm::errs() << Msg << "\n";
for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I)
- fprintf(stderr, " Line %d: %s\n",
- SourceMgr.getInstantiationLineNumber(I->first),
- I->second.c_str());
+ llvm::errs() << " Line " << SourceMgr.getInstantiationLineNumber(I->first)
+ << " " << I->second << "\n";
return true;
}
Modified: cfe/trunk/lib/Frontend/FixItRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FixItRewriter.cpp?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FixItRewriter.cpp (original)
+++ cfe/trunk/lib/Frontend/FixItRewriter.cpp Thu Dec 3 03:14:02 2009
@@ -66,7 +66,7 @@
Rewrite.getRewriteBufferFor(MainFileID)) {
*OutFile << std::string(RewriteBuf->begin(), RewriteBuf->end());
} else {
- std::fprintf(stderr, "Main file is unchanged\n");
+ Diag(FullSourceLoc(), diag::note_fixit_main_file_unchanged);
}
OutFile->flush();
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=90441&r1=90440&r2=90441&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Thu Dec 3 03:14:02 2009
@@ -24,7 +24,6 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Path.h"
#include "llvm/Config/config.h"
-#include <cstdio>
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
@@ -643,11 +642,11 @@
}
if (Verbose) {
- fprintf(stderr, "ignoring duplicate directory \"%s\"\n",
- CurEntry.getName());
+ llvm::errs() << "ignoring duplicate directory \""
+ << CurEntry.getName() << "\"\n";
if (DirToRemove != i)
- fprintf(stderr, " as it is a non-system directory that duplicates"
- " a system directory\n");
+ llvm::errs() << " as it is a non-system directory that duplicates "
+ << "a system directory\n";
}
// This is reached if the current entry is a duplicate. Remove the
@@ -680,11 +679,11 @@
// If verbose, print the list of directories that will be searched.
if (Verbose) {
- fprintf(stderr, "#include \"...\" search starts here:\n");
+ llvm::errs() << "#include \"...\" search starts here:\n";
unsigned QuotedIdx = IncludeGroup[Quoted].size();
for (unsigned i = 0, e = SearchList.size(); i != e; ++i) {
if (i == QuotedIdx)
- fprintf(stderr, "#include <...> search starts here:\n");
+ llvm::errs() << "#include <...> search starts here:\n";
const char *Name = SearchList[i].getName();
const char *Suffix;
if (SearchList[i].isNormalDir())
@@ -695,9 +694,9 @@
assert(SearchList[i].isHeaderMap() && "Unknown DirectoryLookup");
Suffix = " (headermap)";
}
- fprintf(stderr, " %s%s\n", Name, Suffix);
+ llvm::errs() << " " << Name << Suffix << "\n";
}
- fprintf(stderr, "End of search list.\n");
+ llvm::errs() << "End of search list.\n";
}
}
More information about the cfe-commits
mailing list