Files
swift-mirror/stdlib/public/SDK/ObjectiveC/ObjectiveC.mm
Saleem Abdulrasool 42678c1e00 stdlib: tweak import declarations
Ensure that the functions which are declared with @_silgen_name for importing
from external libraries are described with the correct linkage.  If the declared
functions are marked with internal or no linkage, the declaration for the import
will be given internal linkage.  However, this is incorrect if the definition is
not part of the image.

The remaining uses were filtered on the assumption that the swift standard
library is statically linked and provides the definitions for those symbols and
thus will be part of the image.

This was noticed by manual inspection of the IR generated.  Thanks to Dmitri
Gribenko for the hint about the trampoline construction.
2016-03-17 17:22:50 -07:00

29 lines
855 B
Plaintext

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include <objc/objc-api.h>
OBJC_EXPORT
void *objc_autoreleasePoolPush(void);
OBJC_EXPORT
void objc_autoreleasePoolPop(void *);
extern "C" void *_swift_objc_autoreleasePoolPush(void) {
return objc_autoreleasePoolPush();
}
extern "C" void _swift_objc_autoreleasePoolPop(void *context) {
return objc_autoreleasePoolPop(context);
}