Files
swift-mirror/include/swift/AST/KnownIdentifiers.def
Doug Gregor 776e31d101 Only allow _ObjectiveCBridgeable conformances in the type's defining module.
With the exception of a specific whitelist of cases where the
Foundation module defines conformances to _ObjectiveCBridgeable for
standard library types, only permit an _ObjectiveCBridgeable
conformance in the same module as the type that's conforming to the
protocol. Among other things, this prevents the optimizer from
concluding that a dynamic cast between a Swift value type and its
bridged Objective-C class type can never succeed. See

  34ff1c8e6d

for the optimizer issue. As part of this, bring the whitelist in sync
with reality, now that the compiler enforces it.
2016-03-17 16:28:13 -07:00

116 lines
3.1 KiB
C++

//===-- KnownIdentifiers.def - Known identifier metaprogramming -*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file defines macros used for macro-metaprogramming with compiler-known
// identifiers.
//
//===----------------------------------------------------------------------===//
#ifndef IDENTIFIER_WITH_NAME
# error Must define IDENTIFIER_WITH_NAME(Name, IdStr) before including this x-macro file
#endif
#define IDENTIFIER(name) IDENTIFIER_WITH_NAME(name, #name)
#define IDENTIFIER_(name) IDENTIFIER_WITH_NAME(name, "_" #name)
IDENTIFIER(alloc)
IDENTIFIER(allocWithZone)
IDENTIFIER(allZeros)
IDENTIFIER(atIndexedSubscript)
IDENTIFIER_(bridgeToObjectiveC)
IDENTIFIER_WITH_NAME(code_, "_code")
IDENTIFIER(CGFloat)
IDENTIFIER(CVarArg)
IDENTIFIER(Darwin)
IDENTIFIER(dealloc)
IDENTIFIER(deinit)
IDENTIFIER(Element)
IDENTIFIER(error)
IDENTIFIER(forKeyedSubscript)
IDENTIFIER(Foundation)
IDENTIFIER(fromRaw)
IDENTIFIER(hashValue)
IDENTIFIER(init)
IDENTIFIER(initStorage)
IDENTIFIER(initialValue)
IDENTIFIER(makeIterator)
IDENTIFIER(Iterator)
IDENTIFIER(load)
IDENTIFIER(next)
IDENTIFIER(none)
IDENTIFIER_(nsErrorDomain)
IDENTIFIER(objectAtIndexedSubscript)
IDENTIFIER(objectForKeyedSubscript)
IDENTIFIER(ObjectiveC)
IDENTIFIER_(OptionalNilComparisonType)
IDENTIFIER(parameter)
IDENTIFIER(Protocol)
IDENTIFIER(rawValue)
IDENTIFIER(RawValue)
IDENTIFIER(Selector)
IDENTIFIER(self)
IDENTIFIER(Self)
IDENTIFIER(setObject)
IDENTIFIER(simd)
IDENTIFIER(some)
IDENTIFIER(storage)
IDENTIFIER(subscript)
IDENTIFIER(SwiftObject)
IDENTIFIER(toRaw)
IDENTIFIER(Type)
IDENTIFIER(Value)
IDENTIFIER(value)
IDENTIFIER_WITH_NAME(value_, "_value")
IDENTIFIER(with)
// Operators
IDENTIFIER_WITH_NAME(MatchOperator, "~=")
IDENTIFIER_WITH_NAME(EqualsOperator, "==")
// Builtins and literals
IDENTIFIER_(MaxBuiltinIntegerType)
IDENTIFIER(IntegerLiteralType)
IDENTIFIER(boolValue)
IDENTIFIER(nilLiteral)
IDENTIFIER(integerLiteral)
IDENTIFIER_(builtinIntegerLiteral)
IDENTIFIER_(MaxBuiltinFloatType)
IDENTIFIER(FloatLiteralType)
IDENTIFIER(floatLiteral)
IDENTIFIER_(builtinFloatLiteral)
IDENTIFIER(BooleanLiteralType)
IDENTIFIER_(builtinBooleanLiteral)
IDENTIFIER(booleanLiteral)
IDENTIFIER(ExtendedGraphemeClusterLiteralType)
IDENTIFIER_(builtinExtendedGraphemeClusterLiteral)
IDENTIFIER(extendedGraphemeClusterLiteral)
IDENTIFIER(UnicodeScalarLiteralType)
IDENTIFIER_(builtinUnicodeScalarLiteral)
IDENTIFIER(unicodeScalarLiteral)
IDENTIFIER(stringLiteral)
IDENTIFIER_(builtinUTF16StringLiteral)
IDENTIFIER_(builtinStringLiteral)
IDENTIFIER(StringLiteralType)
IDENTIFIER(stringInterpolation)
IDENTIFIER(stringInterpolationSegment)
IDENTIFIER(arrayLiteral)
IDENTIFIER(dictionaryLiteral)
IDENTIFIER_(getBuiltinLogicValue)
IDENTIFIER(className)
#undef IDENTIFIER
#undef IDENTIFIER_
#undef IDENTIFIER_WITH_NAME