[interop] NFC, create ClangSyntaxPrinter class

This commit is contained in:
Alex Lorenz
2022-03-24 09:07:09 -07:00
parent 5a02fde5ca
commit 9d56de1c0c
5 changed files with 15 additions and 16 deletions

View File

@@ -12,7 +12,7 @@
#include "ModuleContentsWriter.h"
#include "CxxSynthesis.h"
#include "ClangSyntaxPrinter.h"
#include "DeclAndTypePrinter.h"
#include "OutputLanguageMode.h"
#include "PrimitiveTypeMapping.h"
@@ -642,8 +642,6 @@ swift::printModuleContentsAsObjC(raw_ostream &os,
void swift::printModuleContentsAsCxx(
raw_ostream &os, llvm::SmallPtrSetImpl<ImportModuleTy> &imports,
ModuleDecl &M) {
using cxx_synthesis::CxxPrinter;
std::string moduleContentsBuf;
llvm::raw_string_ostream moduleOS{moduleContentsBuf};
std::string modulePrologueBuf;
@@ -671,7 +669,7 @@ void swift::printModuleContentsAsCxx(
}
// Construct a C++ namespace for the module.
CxxPrinter(os).printNamespace(
ClangSyntaxPrinter(os).printNamespace(
[&](raw_ostream &os) { M.ValueDecl::getName().print(os); },
[&](raw_ostream &os) { os << moduleOS.str(); });
}