diff options
author | Steve Naroff <snaroff@apple.com> | 2008-12-17 00:20:22 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-12-17 00:20:22 +0000 |
commit | cb73530987a22a6877039b9404b29aba3bf226e0 (patch) | |
tree | 9eba305e820f7542d0585ed7f0a190d5c71515a3 | |
parent | 6b6609f875cc4baa97a7c7db31b86da88706dcc9 (diff) |
Tweaks to allow us to rewrite with -x=objective-c++ enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61113 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/RewriteObjC.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp index 8828c1c2d3..8215295846 100644 --- a/Driver/RewriteObjC.cpp +++ b/Driver/RewriteObjC.cpp @@ -4349,7 +4349,18 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { /// HandleDeclInMainFile - This is called for each top-level decl defined in the /// main file of the input. void RewriteObjC::HandleDeclInMainFile(Decl *D) { + // Required when rewriting in objective-c++ mode... + if (LinkageSpecDecl *LSD = dyn_cast<LinkageSpecDecl>(D)) { + for (LinkageSpecDecl::decl_iterator i = LSD->decls_begin(), + e = LSD->decls_end(); i != e; ++i) { + HandleDeclInMainFile(*i); + } + return; + } if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { + if (FD->isOverloadedOperator()) + return; + // Since function prototypes don't have ParmDecl's, we check the function // prototype. This enables us to rewrite function declarations and // definitions using the same code. |