mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[PrintAsClang] NFC, refactor primitive type mapping logic out from DeclAndTypePrinter
This will allow us to use type mappings in the C ABI function printer.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "CxxSynthesis.h"
|
||||
#include "DeclAndTypePrinter.h"
|
||||
#include "OutputLanguageMode.h"
|
||||
#include "PrimitiveTypeMapping.h"
|
||||
|
||||
#include "swift/AST/ExistentialLayout.h"
|
||||
#include "swift/AST/Module.h"
|
||||
@@ -123,6 +124,7 @@ class ModuleWriter {
|
||||
llvm::DenseMap<const TypeDecl *, std::pair<EmissionState, bool>> seenTypes;
|
||||
std::vector<const Decl *> declsToWrite;
|
||||
DelayedMemberSet delayedMembers;
|
||||
PrimitiveTypeMapping typeMapping;
|
||||
DeclAndTypePrinter printer;
|
||||
OutputLanguageMode outputLangMode;
|
||||
|
||||
@@ -131,7 +133,8 @@ public:
|
||||
llvm::SmallPtrSetImpl<ImportModuleTy> &imports, ModuleDecl &mod,
|
||||
AccessLevel access, OutputLanguageMode outputLang)
|
||||
: os(os), imports(imports), M(mod),
|
||||
printer(M, os, prologueOS, delayedMembers, access, outputLang),
|
||||
printer(M, os, prologueOS, delayedMembers, typeMapping, access,
|
||||
outputLang),
|
||||
outputLangMode(outputLang) {}
|
||||
|
||||
/// Returns true if we added the decl's module to the import set, false if
|
||||
|
||||
Reference in New Issue
Block a user