[interop][SwiftToCxx] add support for emitting Swift stdlib dependency in one header file

This is the default behavior. You can disable this by specifying the -clang-header-expose-decls= flag explicitly when generating the header
This commit is contained in:
Alex Lorenz
2022-09-28 08:06:13 -07:00
parent 1d66c339f6
commit 3a9b6dce9d
108 changed files with 203 additions and 165 deletions

View File

@@ -19,6 +19,7 @@
#include "swift/Frontend/FrontendInputsAndOutputs.h"
#include "swift/Frontend/InputFile.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringMap.h"
#include <string>
@@ -388,9 +389,16 @@ public:
/// '.../lib/swift', otherwise '.../lib/swift_static'.
bool UseSharedResourceFolder = true;
/// Indicates whether to expose all public declarations in the generated clang
enum class ClangHeaderExposeBehavior {
/// Expose all public declarations in the generated header.
AllPublic,
/// Expose declarations only when they have expose attribute.
HasExposeAttr
};
/// Indicates which declarations should be exposed in the generated clang
/// header.
bool ExposePublicDeclsInClangHeader = false;
llvm::Optional<ClangHeaderExposeBehavior> ClangHeaderExposedDecls;
/// Emit C++ bindings for the exposed Swift declarations in the generated
/// clang header.