]> granicus.if.org Git - clang/commitdiff
Tweaks to allow us to rewrite with -x=objective-c++ enabled.
authorSteve Naroff <snaroff@apple.com>
Wed, 17 Dec 2008 00:20:22 +0000 (00:20 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 17 Dec 2008 00:20:22 +0000 (00:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61113 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index 8828c1c2d352d59686d9d887e3edf86f9436ae8c..821529584693c9c83d1a3db43b02374df61ed1bc 100644 (file)
@@ -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.