Remove RewriteBlocks. It has been superseded by RewriteObjC
llvm-svn: 92014
This commit is contained in:
parent
6d5479e103
commit
55e74a1a6a
|
@ -284,8 +284,6 @@ def rewrite_objc : Flag<"-rewrite-objc">,
|
|||
HelpText<"Rewrite ObjC into C (code rewriter example)">;
|
||||
def rewrite_macros : Flag<"-rewrite-macros">,
|
||||
HelpText<"Expand macros without full preprocessing">;
|
||||
def rewrite_blocks : Flag<"-rewrite-blocks">,
|
||||
HelpText<"Rewrite Blocks to C">;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -101,12 +101,6 @@ ASTConsumer *CreatePCHGenerator(const Preprocessor &PP,
|
|||
llvm::raw_ostream *OS,
|
||||
const char *isysroot = 0);
|
||||
|
||||
// Block rewriter: rewrites code using the Apple blocks extension to pure
|
||||
// C code. Output is always sent to stdout.
|
||||
ASTConsumer *CreateBlockRewriter(const std::string &InFile,
|
||||
Diagnostic &Diags,
|
||||
const LangOptions &LangOpts);
|
||||
|
||||
// Inheritance viewer: for C++ code, creates a graph of the inheritance
|
||||
// tree for the given class and displays it with "dotty".
|
||||
ASTConsumer *CreateInheritanceViewer(const std::string& clsname);
|
||||
|
|
|
@ -110,12 +110,6 @@ protected:
|
|||
llvm::StringRef InFile);
|
||||
};
|
||||
|
||||
class RewriteBlocksAction : public ASTFrontendAction {
|
||||
protected:
|
||||
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
|
||||
llvm::StringRef InFile);
|
||||
};
|
||||
|
||||
class SyntaxOnlyAction : public ASTFrontendAction {
|
||||
protected:
|
||||
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
|
||||
|
|
|
@ -41,7 +41,6 @@ namespace frontend {
|
|||
PluginAction, ///< Run a plugin action, \see ActionName.
|
||||
PrintDeclContext, ///< Print DeclContext and their Decls.
|
||||
PrintPreprocessedInput, ///< -E mode.
|
||||
RewriteBlocks, ///< ObjC->C Rewriter for Blocks.
|
||||
RewriteMacros, ///< Expand macros but not #includes.
|
||||
RewriteObjC, ///< ObjC->C Rewriter.
|
||||
RewriteTest, ///< Rewriter playground
|
||||
|
|
|
@ -31,7 +31,6 @@ add_clang_library(clangFrontend
|
|||
PlistDiagnostics.cpp
|
||||
PrintParserCallbacks.cpp
|
||||
PrintPreprocessedOutput.cpp
|
||||
RewriteBlocks.cpp
|
||||
RewriteMacros.cpp
|
||||
RewriteObjC.cpp
|
||||
RewriteTest.cpp
|
||||
|
|
|
@ -280,7 +280,6 @@ static const char *getActionName(frontend::ActionKind Kind) {
|
|||
case frontend::ParseSyntaxOnly: return "-fsyntax-only";
|
||||
case frontend::PrintDeclContext: return "-print-decl-contexts";
|
||||
case frontend::PrintPreprocessedInput: return "-E";
|
||||
case frontend::RewriteBlocks: return "-rewrite-blocks";
|
||||
case frontend::RewriteMacros: return "-rewrite-macros";
|
||||
case frontend::RewriteObjC: return "-rewrite-objc";
|
||||
case frontend::RewriteTest: return "-rewrite-test";
|
||||
|
@ -858,8 +857,6 @@ ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Diagnostic &Diags) {
|
|||
Opts.ProgramAction = frontend::PrintDeclContext; break;
|
||||
case OPT_E:
|
||||
Opts.ProgramAction = frontend::PrintPreprocessedInput; break;
|
||||
case OPT_rewrite_blocks:
|
||||
Opts.ProgramAction = frontend::RewriteBlocks; break;
|
||||
case OPT_rewrite_macros:
|
||||
Opts.ProgramAction = frontend::RewriteMacros; break;
|
||||
case OPT_rewrite_objc:
|
||||
|
|
|
@ -154,11 +154,6 @@ ASTConsumer *RewriteObjCAction::CreateASTConsumer(CompilerInstance &CI,
|
|||
return 0;
|
||||
}
|
||||
|
||||
ASTConsumer *RewriteBlocksAction::CreateASTConsumer(CompilerInstance &CI,
|
||||
llvm::StringRef InFile) {
|
||||
return CreateBlockRewriter(InFile, CI.getDiagnostics(), CI.getLangOpts());
|
||||
}
|
||||
|
||||
ASTConsumer *SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI,
|
||||
llvm::StringRef InFile) {
|
||||
return new ASTConsumer();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,38 +0,0 @@
|
|||
// RUN: %clang_cc1 -rewrite-blocks %s -fblocks -o -
|
||||
|
||||
static int (^block)(const void *, const void *) = (int (^)(const void *, const void *))0;
|
||||
static int (*func)(int (^block)(void *, void *)) = (int (*)(int (^block)(void *, void *)))0;
|
||||
|
||||
typedef int (^block_T)(const void *, const void *);
|
||||
typedef int (*func_T)(int (^block)(void *, void *));
|
||||
|
||||
void foo(const void *a, const void *b, void *c) {
|
||||
int (^block)(const void *, const void *) = (int (^)(const void *, const void *))c;
|
||||
int (*func)(int (^block)(void *, void *)) = (int (*)(int (^block)(void *, void *)))c;
|
||||
}
|
||||
|
||||
typedef void (^test_block_t)();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int a;
|
||||
|
||||
void (^test_block_v)();
|
||||
void (^test_block_v2)(int, float);
|
||||
|
||||
void (^test_block_v3)(void (^barg)(int));
|
||||
|
||||
a = 77;
|
||||
test_block_v = ^(){ int local=1; printf("a=%d\n",a+local); };
|
||||
test_block_v();
|
||||
a++;
|
||||
test_block_v();
|
||||
|
||||
__block int b;
|
||||
|
||||
b = 88;
|
||||
test_block_v2 = ^(int x, float f){ printf("b=%d\n",b); };
|
||||
test_block_v2(1,2.0);
|
||||
b++;
|
||||
test_block_v2(3,4.0);
|
||||
return 7;
|
||||
}
|
|
@ -110,7 +110,6 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
|
|||
|
||||
case PrintDeclContext: return new DeclContextPrintAction();
|
||||
case PrintPreprocessedInput: return new PrintPreprocessedAction();
|
||||
case RewriteBlocks: return new RewriteBlocksAction();
|
||||
case RewriteMacros: return new RewriteMacrosAction();
|
||||
case RewriteObjC: return new RewriteObjCAction();
|
||||
case RewriteTest: return new RewriteTestAction();
|
||||
|
|
Loading…
Reference in New Issue