blob: 8bb8aab4be8e6f7df28e6e673af3079cf7efd707 [file] [log] [blame]
//===--- SerializationFunctionBuilder.h -----------------------------------===//
// This source file is part of the open source project
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
// See for license information
// See for the list of Swift project authors
#include "swift/SIL/SILFunctionBuilder.h"
namespace swift {
class LLVM_LIBRARY_VISIBILITY SILSerializationFunctionBuilder {
SILFunctionBuilder builder;
SILSerializationFunctionBuilder(SILModule &mod) : builder(mod) {}
/// Create a SILFunction declaration for use either as a forward reference or
/// for the eventual deserialization of a function body.
SILFunction *createDeclaration(StringRef name, SILType type,
SILLocation loc) {
return builder.createFunction(
SILLinkage::Private, name, type.getAs<SILFunctionType>(), nullptr,
loc, IsNotBare, IsNotTransparent,
IsNotSerialized, IsNotDynamic, ProfileCounter(), IsNotThunk,
void setHasOwnership(SILFunction *f, bool newValue) {
builder.setHasOwnership(f, newValue);
} // namespace swift