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 8828c1c..8215295 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -4349,7 +4349,18 @@
/// 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.