[cfe-commits] r72059 - in /cfe/trunk/tools/clang-cc: ASTConsumers.h RewriteObjC.cpp clang-cc.cpp
Eli Friedman
eli.friedman at gmail.com
Mon May 18 15:39:17 PDT 2009
Author: efriedma
Date: Mon May 18 17:39:16 2009
New Revision: 72059
URL: http://llvm.org/viewvc/llvm-project?rev=72059&view=rev
Log:
Move the Wno-rewrite-macros option out of RewriteObjC.cpp in prepration
for moving ASTConsumers.h to include/clang/Frontend.
Modified:
cfe/trunk/tools/clang-cc/ASTConsumers.h
cfe/trunk/tools/clang-cc/RewriteObjC.cpp
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/tools/clang-cc/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/ASTConsumers.h?rev=72059&r1=72058&r2=72059&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/ASTConsumers.h (original)
+++ cfe/trunk/tools/clang-cc/ASTConsumers.h Mon May 18 17:39:16 2009
@@ -58,7 +58,8 @@
ASTConsumer *CreateObjCRewriter(const std::string& InFile,
llvm::raw_ostream* OS,
Diagnostic &Diags,
- const LangOptions &LOpts);
+ const LangOptions &LOpts,
+ bool SilenceRewriteMacroWarning);
// LLVM code generator: uses the code generation backend to generate LLVM
// assembly. This runs optimizations depending on the CompileOptions
Modified: cfe/trunk/tools/clang-cc/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/RewriteObjC.cpp?rev=72059&r1=72058&r2=72059&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/RewriteObjC.cpp (original)
+++ cfe/trunk/tools/clang-cc/RewriteObjC.cpp Mon May 18 17:39:16 2009
@@ -31,10 +31,6 @@
using namespace clang;
using llvm::utostr;
-static llvm::cl::opt<bool>
-SilenceRewriteMacroWarning("Wno-rewrite-macros", llvm::cl::init(false),
- llvm::cl::desc("Silence ObjC rewriting warnings"));
-
namespace {
class RewriteObjC : public ASTConsumer {
Rewriter Rewrite;
@@ -94,7 +90,9 @@
std::string InFileName;
llvm::raw_ostream* OutFile;
-
+
+ bool SilenceRewriteMacroWarning;
+
std::string Preamble;
// Block expressions.
@@ -137,7 +135,8 @@
void HandleTopLevelSingleDecl(Decl *D);
void HandleDeclInMainFile(Decl *D);
RewriteObjC(std::string inFile, llvm::raw_ostream *OS,
- Diagnostic &D, const LangOptions &LOpts);
+ Diagnostic &D, const LangOptions &LOpts,
+ bool silenceMacroWarn);
~RewriteObjC() {}
@@ -417,8 +416,10 @@
}
RewriteObjC::RewriteObjC(std::string inFile, llvm::raw_ostream* OS,
- Diagnostic &D, const LangOptions &LOpts)
- : Diags(D), LangOpts(LOpts), InFileName(inFile), OutFile(OS) {
+ Diagnostic &D, const LangOptions &LOpts,
+ bool silenceMacroWarn)
+ : Diags(D), LangOpts(LOpts), InFileName(inFile), OutFile(OS),
+ SilenceRewriteMacroWarning(silenceMacroWarn) {
IsHeader = IsHeaderFile(inFile);
RewriteFailedDiag = Diags.getCustomDiagID(Diagnostic::Warning,
"rewriting sub-expression within a macro (may not be correct)");
@@ -430,8 +431,9 @@
ASTConsumer *clang::CreateObjCRewriter(const std::string& InFile,
llvm::raw_ostream* OS,
Diagnostic &Diags,
- const LangOptions &LOpts) {
- return new RewriteObjC(InFile, OS, Diags, LOpts);
+ const LangOptions &LOpts,
+ bool SilenceRewriteMacroWarning) {
+ return new RewriteObjC(InFile, OS, Diags, LOpts, SilenceRewriteMacroWarning);
}
void RewriteObjC::Initialize(ASTContext &context) {
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=72059&r1=72058&r2=72059&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Mon May 18 17:39:16 2009
@@ -1490,6 +1490,13 @@
llvm::cl::desc("Perform Fix-It modifications at the given source location"));
//===----------------------------------------------------------------------===//
+// ObjC Rewriter Options
+//===----------------------------------------------------------------------===//
+static llvm::cl::opt<bool>
+SilenceRewriteMacroWarning("Wno-rewrite-macros", llvm::cl::init(false),
+ llvm::cl::desc("Silence ObjC rewriting warnings"));
+
+//===----------------------------------------------------------------------===//
// -dump-build-information Stuff
//===----------------------------------------------------------------------===//
@@ -1692,7 +1699,8 @@
case RewriteObjC:
OS.reset(ComputeOutFile(InFile, "cpp", true, OutPath));
Consumer.reset(CreateObjCRewriter(InFile, OS.get(), PP.getDiagnostics(),
- PP.getLangOptions()));
+ PP.getLangOptions(),
+ SilenceRewriteMacroWarning));
break;
case RewriteBlocks:
More information about the cfe-commits
mailing list