#include "clang.h"
#include "ASTConsumers.h"
-#include "TextDiagnosticBuffer.h"
+#include "clang/Driver/TextDiagnosticBuffer.h"
#include "clang/Sema/ParseAST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/SourceManager.h"
TOOLNAME = clang
USEDLIBS = clangCodeGen.a clangAnalysis.a clangRewrite.a clangSEMA.a \
- clangAST.a clangParse.a clangLex.a clangBasic.a \
+ clangDriver.a clangAST.a clangParse.a clangLex.a clangBasic.a \
LLVMCore.a LLVMSupport.a LLVMSystem.a \
LLVMBitWriter.a LLVMBitReader.a LLVMCodeGen.a LLVMAnalysis.a \
LLVMTarget.a
#include "clang.h"
#include "ASTConsumers.h"
-#include "TextDiagnosticBuffer.h"
-#include "TextDiagnosticPrinter.h"
#include "HTMLDiagnostics.h"
+#include "clang/Driver/TextDiagnosticBuffer.h"
+#include "clang/Driver/TextDiagnosticPrinter.h"
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/AST/TranslationUnit.h"
#include "clang/CodeGen/ModuleBuilder.h"
llvm::cl::desc("Generate HTML to report diagnostics"),
llvm::cl::value_desc("HTML directory"));
+static llvm::cl::opt<bool>
+NoShowColumn("fno-show-column",
+ llvm::cl::desc("Do not include column number on diagnostics"));
+
+static llvm::cl::opt<bool>
+NoCaretDiagnostics("fno-caret-diagnostics",
+ llvm::cl::desc("Do not include source line and caret with"
+ " diagnostics"));
+
+
//===----------------------------------------------------------------------===//
// Analyzer Options
//===----------------------------------------------------------------------===//
static llvm::cl::opt<bool>
ObjCEnableGC("fobjc-gc",
- llvm::cl::desc("Enable Objective-C garbage collection"));
+ llvm::cl::desc("Enable Objective-C garbage collection"));
void InitializeGCMode(LangOptions &Options) {
if (ObjCExclusiveGC)
else { // Use Text diagnostics.
if (!VerifyDiagnostics) {
// Print diagnostics to stderr by default.
- TextDiagClient = new TextDiagnosticPrinter();
+ TextDiagClient = new TextDiagnosticPrinter(!NoShowColumn,
+ !NoCaretDiagnostics);
} else {
// When checking diagnostics, just buffer them up.
TextDiagClient = new TextDiagnosticBuffer();
#ifndef DRIVER_TEXT_DIAGNOSTIC_BUFFER_H_
#define DRIVER_TEXT_DIAGNOSTIC_BUFFER_H_
-#include "TextDiagnostics.h"
+#include "clang/Driver/TextDiagnostics.h"
#include <vector>
namespace clang {
#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
#define TEXT_DIAGNOSTIC_PRINTER_H_
-#include "TextDiagnostics.h"
+#include "clang/Driver/TextDiagnostics.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/Support/Streams.h"
FullSourceLoc LastWarningLoc;
FullSourceLoc LastLoc;
llvm::OStream OS;
+ bool ShowColumn;
+ bool CaretDiagnostics;
public:
- TextDiagnosticPrinter(llvm::OStream &os = llvm::cerr) : OS(os) {}
+ TextDiagnosticPrinter(bool showColumn = true, bool caretDiagnistics = true,
+ llvm::OStream &os = llvm::cerr)
+ : OS(os), ShowColumn(showColumn), CaretDiagnostics(caretDiagnistics) {}
void PrintIncludeStack(FullSourceLoc Pos);
--- /dev/null
+##===- clang/lib/Analysis/Makefile -------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+#
+# This implements analyses built on top of source-level CFGs.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../../..
+LIBRARYNAME := clangDriver
+BUILD_ARCHIVE = 1
+CXXFLAGS = -fno-rtti
+
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+
+include $(LEVEL)/Makefile.common
+
//
//===----------------------------------------------------------------------===//
-#include "TextDiagnosticBuffer.h"
+#include "clang/Driver/TextDiagnosticBuffer.h"
#include "clang/Basic/SourceManager.h"
using namespace clang;
//
//===----------------------------------------------------------------------===//
-#include "TextDiagnosticPrinter.h"
+#include "clang/Driver/TextDiagnosticPrinter.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Lexer.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include <string>
using namespace clang;
-static llvm::cl::opt<bool>
-NoShowColumn("fno-show-column",
- llvm::cl::desc("Do not include column number on diagnostics"));
-static llvm::cl::opt<bool>
-NoCaretDiagnostics("fno-caret-diagnostics",
- llvm::cl::desc("Do not include source line and caret with"
- " diagnostics"));
-
void TextDiagnosticPrinter::
PrintIncludeStack(FullSourceLoc Pos) {
if (Pos.isInvalid()) return;
++LineEnd;
OS << Buffer->getBufferIdentifier() << ":" << LineNo << ":";
- if (ColNo && !NoShowColumn)
+ if (ColNo && ShowColumn)
OS << ColNo << ":";
OS << " ";
}
OS << FormatDiagnostic(Diags, Level, ID, Strs, NumStrs) << "\n";
- if (!NoCaretDiagnostics && Pos.isValid() && ((LastLoc != Pos) || Ranges)) {
+ if (CaretDiagnostics && Pos.isValid() && ((LastLoc != Pos) || Ranges)) {
// Cache the LastLoc, it allows us to omit duplicate source/caret spewage.
LastLoc = Pos;
//
//===----------------------------------------------------------------------===//
-#include "TextDiagnostics.h"
+#include "clang/Driver/TextDiagnostics.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/HeaderSearch.h"
##===----------------------------------------------------------------------===##
LEVEL = ../../..
-PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis Rewrite
+PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis Rewrite Driver
include $(LEVEL)/Makefile.common