From: Steve Naroff Date: Wed, 17 Dec 2008 00:20:22 +0000 (+0000) Subject: Tweaks to allow us to rewrite with -x=objective-c++ enabled. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb73530987a22a6877039b9404b29aba3bf226e0;p=clang 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 --- 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(D)) { + for (LinkageSpecDecl::decl_iterator i = LSD->decls_begin(), + e = LSD->decls_end(); i != e; ++i) { + HandleDeclInMainFile(*i); + } + return; + } if (FunctionDecl *FD = dyn_cast(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.