aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Checker/AnalysisConsumer.h35
-rw-r--r--include/clang/Checker/FrontendActions.h29
-rw-r--r--include/clang/Checker/PathDiagnosticClients.h (renamed from include/clang/Frontend/PathDiagnosticClients.h)4
-rw-r--r--include/clang/CodeGen/BackendUtil.h (renamed from include/clang/Frontend/BackendUtil.h)5
-rw-r--r--include/clang/CodeGen/CodeGenAction.h (renamed from include/clang/Frontend/CodeGenAction.h)5
-rw-r--r--include/clang/Frontend/ASTConsumers.h14
-rw-r--r--include/clang/Frontend/AnalyzerOptions.h (renamed from include/clang/Frontend/AnalysisConsumer.h)17
-rw-r--r--include/clang/Frontend/CompilerInvocation.h2
-rw-r--r--include/clang/Frontend/FrontendActions.h50
-rw-r--r--include/clang/Frontend/Utils.h6
-rw-r--r--include/clang/Rewrite/ASTConsumers.h45
-rw-r--r--include/clang/Rewrite/FixItRewriter.h (renamed from include/clang/Frontend/FixItRewriter.h)6
-rw-r--r--include/clang/Rewrite/FrontendActions.h69
-rw-r--r--include/clang/Rewrite/Rewriters.h31
14 files changed, 230 insertions, 88 deletions
diff --git a/include/clang/Checker/AnalysisConsumer.h b/include/clang/Checker/AnalysisConsumer.h
new file mode 100644
index 0000000000..c236766f0a
--- /dev/null
+++ b/include/clang/Checker/AnalysisConsumer.h
@@ -0,0 +1,35 @@
+//===--- AnalysisConsumer.h - Front-end Analysis Engine Hooks ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header contains the functions necessary for a front-end to run various
+// analyses.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CHECKER_ANALYSISCONSUMER_H
+#define LLVM_CLANG_CHECKER_ANALYSISCONSUMER_H
+
+#include <string>
+
+namespace clang {
+
+class AnalyzerOptions;
+class ASTConsumer;
+class Preprocessor;
+
+/// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
+/// analysis passes. (The set of analyses run is controlled by command-line
+/// options.)
+ASTConsumer* CreateAnalysisConsumer(const Preprocessor &pp,
+ const std::string &output,
+ const AnalyzerOptions& Opts);
+
+}
+
+#endif
diff --git a/include/clang/Checker/FrontendActions.h b/include/clang/Checker/FrontendActions.h
new file mode 100644
index 0000000000..1c0bbb78ba
--- /dev/null
+++ b/include/clang/Checker/FrontendActions.h
@@ -0,0 +1,29 @@
+//===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CHECKER_FRONTENDACTIONS_H
+#define LLVM_CLANG_CHECKER_FRONTENDACTIONS_H
+
+#include "clang/Frontend/FrontendAction.h"
+
+namespace clang {
+
+//===----------------------------------------------------------------------===//
+// AST Consumer Actions
+//===----------------------------------------------------------------------===//
+
+class AnalysisAction : public ASTFrontendAction {
+protected:
+ virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef InFile);
+};
+
+} // end namespace clang
+
+#endif
diff --git a/include/clang/Frontend/PathDiagnosticClients.h b/include/clang/Checker/PathDiagnosticClients.h
index f8d2eebeb6..d3aa3b2114 100644
--- a/include/clang/Frontend/PathDiagnosticClients.h
+++ b/include/clang/Checker/PathDiagnosticClients.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_FRONTEND_PATH_DIAGNOSTIC_CLIENTS_H
-#define LLVM_CLANG_FRONTEND_PATH_DIAGNOSTIC_CLiENTS_H
+#ifndef LLVM_CLANG_CHECKER_PATH_DIAGNOSTIC_CLIENTS_H
+#define LLVM_CLANG_CHECKER_PATH_DIAGNOSTIC_CLiENTS_H
#include <string>
diff --git a/include/clang/Frontend/BackendUtil.h b/include/clang/CodeGen/BackendUtil.h
index 39c743c634..abcef8130d 100644
--- a/include/clang/Frontend/BackendUtil.h
+++ b/include/clang/CodeGen/BackendUtil.h
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_CODEGEN_BACKEND_UTIL_H
+#define LLVM_CLANG_CODEGEN_BACKEND_UTIL_H
+
namespace llvm {
class Module;
class raw_ostream;
@@ -30,3 +33,5 @@ namespace clang {
const TargetOptions &TOpts, llvm::Module *M,
BackendAction Action, llvm::raw_ostream *OS);
}
+
+#endif
diff --git a/include/clang/Frontend/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h
index e05176a689..cecfcda461 100644
--- a/include/clang/Frontend/CodeGenAction.h
+++ b/include/clang/CodeGen/CodeGenAction.h
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
+#define LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
+
#include "clang/Frontend/FrontendAction.h"
#include "llvm/ADT/OwningPtr.h"
@@ -72,3 +75,5 @@ public:
};
}
+
+#endif
diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h
index 9163a208de..e42b1f2cd9 100644
--- a/include/clang/Frontend/ASTConsumers.h
+++ b/include/clang/Frontend/ASTConsumers.h
@@ -57,20 +57,6 @@ ASTConsumer *CreateASTViewer();
// to stderr; this is intended for debugging.
ASTConsumer *CreateDeclContextPrinter();
-// ObjC rewriter: attempts tp rewrite ObjC constructs into pure C code.
-// This is considered experimental, and only works with Apple's ObjC runtime.
-ASTConsumer *CreateObjCRewriter(const std::string &InFile,
- llvm::raw_ostream *OS,
- Diagnostic &Diags,
- const LangOptions &LOpts,
- bool SilenceRewriteMacroWarning);
-
-/// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
-/// HTML with syntax highlighting suitable for viewing in a web-browser.
-ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP,
- bool SyntaxHighlight = true,
- bool HighlightMacros = true);
-
// PCH generator: generates a precompiled header file; this file can be used
// later with the PCHReader (clang -cc1 option -include-pch) to speed up compile
// times.
diff --git a/include/clang/Frontend/AnalysisConsumer.h b/include/clang/Frontend/AnalyzerOptions.h
index 2cbdf368a8..d8fcdeb9b0 100644
--- a/include/clang/Frontend/AnalysisConsumer.h
+++ b/include/clang/Frontend/AnalyzerOptions.h
@@ -1,4 +1,4 @@
-//===--- AnalysisConsumer.h - Front-end Analysis Engine Hooks ---*- C++ -*-===//
+//===--- AnalyzerOptions.h - Analysis Engine Options ------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
//
-// This header contains the functions necessary for a front-end to run various
-// analyses.
+// This header contains the structures necessary for a front-end to specify
+// various analyses.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_FRONTEND_ANALYSISCONSUMER_H
-#define LLVM_CLANG_FRONTEND_ANALYSISCONSUMER_H
+#ifndef LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
+#define LLVM_CLANG_FRONTEND_ANALYZEROPTIONS_H
#include <string>
#include <vector>
@@ -92,13 +92,6 @@ public:
}
};
-/// CreateAnalysisConsumer - Creates an ASTConsumer to run various code
-/// analysis passes. (The set of analyses run is controlled by command-line
-/// options.)
-ASTConsumer* CreateAnalysisConsumer(const Preprocessor &pp,
- const std::string &output,
- const AnalyzerOptions& Opts);
-
}
#endif
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h
index f5a9053ceb..05e1aa09cf 100644
--- a/include/clang/Frontend/CompilerInvocation.h
+++ b/include/clang/Frontend/CompilerInvocation.h
@@ -13,7 +13,7 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/CodeGen/CodeGenOptions.h"
-#include "clang/Frontend/AnalysisConsumer.h"
+#include "clang/Frontend/AnalyzerOptions.h"
#include "clang/Frontend/DependencyOutputOptions.h"
#include "clang/Frontend/DiagnosticOptions.h"
#include "clang/Frontend/FrontendOptions.h"
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h
index 2e22435422..26262cfa95 100644
--- a/include/clang/Frontend/FrontendActions.h
+++ b/include/clang/Frontend/FrontendActions.h
@@ -15,8 +15,6 @@
#include <vector>
namespace clang {
-class FixItRewriter;
-class FixItPathRewriter;
//===----------------------------------------------------------------------===//
// Custom Consumer Actions
@@ -38,12 +36,6 @@ public:
// AST Consumer Actions
//===----------------------------------------------------------------------===//
-class AnalysisAction : public ASTFrontendAction {
-protected:
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile);
-};
-
class ASTPrintAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
@@ -74,26 +66,6 @@ protected:
llvm::StringRef InFile);
};
-class FixItAction : public ASTFrontendAction {
-protected:
- llvm::OwningPtr<FixItRewriter> Rewriter;
- llvm::OwningPtr<FixItPathRewriter> PathRewriter;
-
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile);
-
- virtual bool BeginSourceFileAction(CompilerInstance &CI,
- llvm::StringRef Filename);
-
- virtual void EndSourceFileAction();
-
- virtual bool hasASTFileSupport() const { return false; }
-
-public:
- FixItAction();
- ~FixItAction();
-};
-
class GeneratePCHAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
@@ -104,24 +76,12 @@ protected:
virtual bool hasASTFileSupport() const { return false; }
};
-class HTMLPrintAction : public ASTFrontendAction {
-protected:
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile);
-};
-
class InheritanceViewAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef InFile);
};
-class RewriteObjCAction : public ASTFrontendAction {
-protected:
- virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
- llvm::StringRef InFile);
-};
-
class SyntaxOnlyAction : public ASTFrontendAction {
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
@@ -215,16 +175,6 @@ protected:
virtual bool hasPCHSupport() const { return true; }
};
-class RewriteMacrosAction : public PreprocessorFrontendAction {
-protected:
- void ExecuteAction();
-};
-
-class RewriteTestAction : public PreprocessorFrontendAction {
-protected:
- void ExecuteAction();
-};
-
} // end namespace clang
#endif
diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h
index c1d483164a..f37cc01a27 100644
--- a/include/clang/Frontend/Utils.h
+++ b/include/clang/Frontend/Utils.h
@@ -65,12 +65,6 @@ void ProcessWarningOptions(Diagnostic &Diags, const DiagnosticOptions &Opts);
void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS,
const PreprocessorOutputOptions &Opts);
-/// RewriteMacrosInInput - Implement -rewrite-macros mode.
-void RewriteMacrosInInput(Preprocessor &PP, llvm::raw_ostream* OS);
-
-/// RewriteMacrosInInput - A simple test for the TokenRewriter class.
-void DoRewriteTest(Preprocessor &PP, llvm::raw_ostream* OS);
-
/// CreatePrintParserActionsAction - Return the actions implementation that
/// implements the -parse-print-callbacks option.
MinimalAction *CreatePrintParserActionsAction(Preprocessor &PP,
diff --git a/include/clang/Rewrite/ASTConsumers.h b/include/clang/Rewrite/ASTConsumers.h
new file mode 100644
index 0000000000..5fb107ccbe
--- /dev/null
+++ b/include/clang/Rewrite/ASTConsumers.h
@@ -0,0 +1,45 @@
+//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// AST Consumers.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef REWRITE_ASTCONSUMERS_H
+#define REWRITE_ASTCONSUMERS_H
+
+#include <string>
+
+namespace llvm {
+ class raw_ostream;
+}
+namespace clang {
+
+class ASTConsumer;
+class Diagnostic;
+class LangOptions;
+class Preprocessor;
+
+// ObjC rewriter: attempts tp rewrite ObjC constructs into pure C code.
+// This is considered experimental, and only works with Apple's ObjC runtime.
+ASTConsumer *CreateObjCRewriter(const std::string &InFile,
+ llvm::raw_ostream *OS,
+ Diagnostic &Diags,
+ const LangOptions &LOpts,
+ bool SilenceRewriteMacroWarning);
+
+/// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
+/// HTML with syntax highlighting suitable for viewing in a web-browser.
+ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP,
+ bool SyntaxHighlight = true,
+ bool HighlightMacros = true);
+
+} // end clang namespace
+
+#endif
diff --git a/include/clang/Frontend/FixItRewriter.h b/include/clang/Rewrite/FixItRewriter.h
index b432d747de..4ebcef0fff 100644
--- a/include/clang/Frontend/FixItRewriter.h
+++ b/include/clang/Rewrite/FixItRewriter.h
@@ -12,8 +12,8 @@
// then forwards any diagnostics to the adapted diagnostic client.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_FRONTEND_FIX_IT_REWRITER_H
-#define LLVM_CLANG_FRONTEND_FIX_IT_REWRITER_H
+#ifndef LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H
+#define LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"
@@ -101,4 +101,4 @@ public:
}
-#endif // LLVM_CLANG_FRONTEND_FIX_IT_REWRITER_H
+#endif // LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H
diff --git a/include/clang/Rewrite/FrontendActions.h b/include/clang/Rewrite/FrontendActions.h
new file mode 100644
index 0000000000..2ff8d0a5b6
--- /dev/null
+++ b/include/clang/Rewrite/FrontendActions.h
@@ -0,0 +1,69 @@
+//===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_REWRITE_FRONTENDACTIONS_H
+#define LLVM_CLANG_REWRITE_FRONTENDACTIONS_H
+
+#include "clang/Frontend/FrontendAction.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+class FixItRewriter;
+class FixItPathRewriter;
+
+//===----------------------------------------------------------------------===//
+// AST Consumer Actions
+//===----------------------------------------------------------------------===//
+
+class HTMLPrintAction : public ASTFrontendAction {
+protected:
+ virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef InFile);
+};
+
+class FixItAction : public ASTFrontendAction {
+protected:
+ llvm::OwningPtr<FixItRewriter> Rewriter;
+ llvm::OwningPtr<FixItPathRewriter> PathRewriter;
+
+ virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef InFile);
+
+ virtual bool BeginSourceFileAction(CompilerInstance &CI,
+ llvm::StringRef Filename);
+
+ virtual void EndSourceFileAction();
+
+ virtual bool hasASTFileSupport() const { return false; }
+
+public:
+ FixItAction();
+ ~FixItAction();
+};
+
+class RewriteObjCAction : public ASTFrontendAction {
+protected:
+ virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef InFile);
+};
+
+class RewriteMacrosAction : public PreprocessorFrontendAction {
+protected:
+ void ExecuteAction();
+};
+
+class RewriteTestAction : public PreprocessorFrontendAction {
+protected:
+ void ExecuteAction();
+};
+
+} // end namespace clang
+
+#endif
diff --git a/include/clang/Rewrite/Rewriters.h b/include/clang/Rewrite/Rewriters.h
new file mode 100644
index 0000000000..669cf8c208
--- /dev/null
+++ b/include/clang/Rewrite/Rewriters.h
@@ -0,0 +1,31 @@
+//===--- Rewriters.h - Rewriter implementations -------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header contains miscellaneous utilities for various front-end actions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_REWRITE_REWRITERS_H
+#define LLVM_CLANG_REWRITE_REWRITERS_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/raw_ostream.h"
+
+namespace clang {
+class Preprocessor;
+
+/// RewriteMacrosInInput - Implement -rewrite-macros mode.
+void RewriteMacrosInInput(Preprocessor &PP, llvm::raw_ostream* OS);
+
+/// DoRewriteTest - A simple test for the TokenRewriter class.
+void DoRewriteTest(Preprocessor &PP, llvm::raw_ostream* OS);
+
+} // end namespace clang
+
+#endif