code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
/*
TEST_OUTPUT:
---
fail_compilation/fail11375.d(17): Error: constructor `fail11375.D!().D.this` is not `nothrow`
fail_compilation/fail11375.d(15): Error: function `D main` may throw but is marked as `nothrow`
---
*/
class B {
this() {}
}
class D() : B {}
void main() nothrow
{
auto d = new D!()();
}
|
D
|
module akaricastd.socket;
import std.stdio;
import std.conv;
import std.algorithm;
import std.socket : InternetAddress, Socket, SocketException, SocketSet, TcpSocket;
import std.experimental.logger;
import djrpc.v2 : JsonRpc2Request, JsonRpc2Response;
import akaricastd.player : Player;
import akaricastd.playlist : Playlist;
import akaricastd.commands : Command, CommandLocator;
abstract class BaseSocket {
protected bool running = false;
private Socket socket;
private SocketSet set;
this(Socket socket) {
this.socket = socket;
this.set = new SocketSet();
}
abstract char[] handleRequest(char[] requestData);
void listen() {
this.running = true;
this.socket.listen(10);
Socket[] connectedClients;
char[1024] buffer;
while(this.running) {
this.set.reset();
this.set.add(this.socket);
foreach(client; connectedClients){
this.set.add(client);
}
if(socket.Socket.select(this.set, null, null)) {
for (size_t i = 0; i < connectedClients.length; i++) {
Socket client = connectedClients[i];
if(this.set.isSet(client)) {
// read from it and echo it back
auto got = client.receive(buffer);
// trim
auto data = (buffer[0 .. got]);
auto response = this.handleRequest(data);
client.send(response);
}
// release socket resources now
info(client.remoteAddress.toAddrString ~ " disconnected");
client.close();
connectedClients = connectedClients.remove(i);
i--;
}
if(this.set.isSet(this.socket)) {
// the listener is ready to read, that means
// a new client wants to connect. We accept it here.
auto newSocket = this.socket.accept();
info(newSocket.remoteAddress.toAddrString ~ " connected");
connectedClients ~= newSocket; // add to our listen
}
}
}
}
bool isRunning() {
return this.running;
}
}
class ControlSocket : BaseSocket {
private Player player;
private Playlist playlist;
private CommandLocator cmdLocator;
this(InternetAddress addr, Player player, Playlist playlist) {
this.player = player;
this.playlist = playlist;
this.cmdLocator = new CommandLocator(this.player, this.playlist);
auto socket = new TcpSocket();
socket.bind(addr);
super(socket);
}
override char[] handleRequest(char[] requestData) {
try {
JsonRpc2Request request = cast(JsonRpc2Request) JsonRpc2Request.parse(to!string(requestData));
string method = request.getMethod();
info("try to call method: " ~ method);
Command cmd = this.cmdLocator.getCommand(method);
JsonRpc2Response response = cmd.run(request);
return response.encode().dup();
} catch (Exception) {
writeln(requestData);
return "no".dup();
}
}
}
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/diag8714.d(9): Error: function `diag8714.foo` circular dependency. Functions cannot be interpreted while being compiled
fail_compilation/diag8714.d(15): called from here: `foo("somestring")`
---
*/
string foo(string f)
{
if (f == "somestring")
{
return "got somestring";
}
return bar!(foo("somestring"));
}
template bar(string s)
{
enum bar = s;
}
|
D
|
import std.stdio;
import cuboid.world;
import cuboid.worldloader;
void main(string[] args)
{
writeln("Initialising World...");
auto myWorld = new World(4);
}
|
D
|
/**
* Copyright (c) 2015-2016 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*
*
* Regenerated by Rikarin C2D tool.
*/
module vulkan;
auto VK_MAKE_VERSION(int major, int minor, int patch) {
return (major << 22) | (minor << 12) | patch;
}
enum VK_VERSION_1_0 = 1;
enum VK_API_VERSION = VK_MAKE_VERSION(1, 0, 3);
auto VK_VERSION_MAJOR(uint ver) { return ver >> 22; }
auto VK_VERSION_MINOR(uint ver) { return (ver >> 12) & 0x3ff; }
auto VK_VERSION_PATCH(uint ver) { return ver & 0xfff; }
alias VkFlags = uint;
alias VkBool32 = uint;
alias VkDeviceSize = ulong;
alias VkSampleMask = uint;
private template VK_DEFINE_HANDLE(string name) {
enum VK_DEFINE_HANDLE = "struct " ~ name ~ "_T; alias " ~ name ~ " = " ~ name ~ "_T*;";
}
private template VK_DEFINE_NON_DISPATCHABLE_HANDLE(string name) {
version (D_LP64) {
enum VK_DEFINE_NON_DISPATCHABLE_HANDLE = "struct " ~ name ~ "_T; alias " ~ name ~ " = " ~ name ~ "_T*;";
} else {
enum VK_DEFINE_NON_DISPATCHABLE_HANDLE = "alias " ~ name ~ " = ulong;";
}
}
mixin(VK_DEFINE_HANDLE!"VkInstance");
mixin(VK_DEFINE_HANDLE!"VkPhysicalDevice");
mixin(VK_DEFINE_HANDLE!"VkDevice");
mixin(VK_DEFINE_HANDLE!"VkQueue");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkSemaphore");
mixin(VK_DEFINE_HANDLE!"VkCommandBuffer");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkFence");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDeviceMemory");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkBuffer");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkImage");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkEvent");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkQueryPool");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkBufferView");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkImageView");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkShaderModule");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkPipelineCache");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkPipelineLayout");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkRenderPass");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkPipeline");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDescriptorSetLayout");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkSampler");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDescriptorPool");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDescriptorSet");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkFramebuffer");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkCommandPool");
enum VK_NULL_HANDLE = 0;
enum VK_LOD_CLAMP_NONE = 1000.0f;
enum VK_REMAINING_MIP_LEVELS = (~0U);
enum VK_REMAINING_ARRAY_LAYERS = (~0U);
enum VK_WHOLE_SIZE = (~0UL);
enum VK_ATTACHMENT_UNUSED = (~0U);
enum VK_TRUE = 1;
enum VK_FALSE = 0;
enum VK_QUEUE_FAMILY_IGNORED = (~0U);
enum VK_SUBPASS_EXTERNAL = (~0U);
enum VK_MAX_PHYSICAL_DEVICE_NAME_SIZE = 256;
enum VK_UUID_SIZE = 16;
enum VK_MAX_MEMORY_TYPES = 32;
enum VK_MAX_MEMORY_HEAPS = 16;
enum VK_MAX_EXTENSION_NAME_SIZE = 256;
enum VK_MAX_DESCRIPTION_SIZE = 256;
enum VkPipelineCacheHeaderVersion {
VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
VK_PIPELINE_CACHE_HEADER_VERSION_BEGIN_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE,
VK_PIPELINE_CACHE_HEADER_VERSION_END_RANGE = VK_PIPELINE_CACHE_HEADER_VERSION_ONE,
VK_PIPELINE_CACHE_HEADER_VERSION_RANGE_SIZE = (VK_PIPELINE_CACHE_HEADER_VERSION_ONE - VK_PIPELINE_CACHE_HEADER_VERSION_ONE + 1),
VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF
}
enum VkResult {
VK_SUCCESS = 0,
VK_NOT_READY = 1,
VK_TIMEOUT = 2,
VK_EVENT_SET = 3,
VK_EVENT_RESET = 4,
VK_INCOMPLETE = 5,
VK_ERROR_OUT_OF_HOST_MEMORY = -1,
VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
VK_ERROR_INITIALIZATION_FAILED = -3,
VK_ERROR_DEVICE_LOST = -4,
VK_ERROR_MEMORY_MAP_FAILED = -5,
VK_ERROR_LAYER_NOT_PRESENT = -6,
VK_ERROR_EXTENSION_NOT_PRESENT = -7,
VK_ERROR_FEATURE_NOT_PRESENT = -8,
VK_ERROR_INCOMPATIBLE_DRIVER = -9,
VK_ERROR_TOO_MANY_OBJECTS = -10,
VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
VK_ERROR_SURFACE_LOST_KHR = -1000000000,
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
VK_SUBOPTIMAL_KHR = 1000001003,
VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
VK_RESULT_BEGIN_RANGE = VK_ERROR_FORMAT_NOT_SUPPORTED,
VK_RESULT_END_RANGE = VK_INCOMPLETE,
VK_RESULT_RANGE_SIZE = (VK_INCOMPLETE - VK_ERROR_FORMAT_NOT_SUPPORTED + 1),
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
}
enum VkStructureType {
VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = 1000003000,
VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO,
VK_STRUCTURE_TYPE_RANGE_SIZE = (VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkSystemAllocationScope {
VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1,
VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4,
VK_SYSTEM_ALLOCATION_SCOPE_BEGIN_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND,
VK_SYSTEM_ALLOCATION_SCOPE_END_RANGE = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE,
VK_SYSTEM_ALLOCATION_SCOPE_RANGE_SIZE = (VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND + 1),
VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkInternalAllocationType {
VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0,
VK_INTERNAL_ALLOCATION_TYPE_BEGIN_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE,
VK_INTERNAL_ALLOCATION_TYPE_END_RANGE = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE,
VK_INTERNAL_ALLOCATION_TYPE_RANGE_SIZE = (VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE + 1),
VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkFormat {
VK_FORMAT_UNDEFINED = 0,
VK_FORMAT_R4G4_UNORM_PACK8 = 1,
VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
VK_FORMAT_R8_UNORM = 9,
VK_FORMAT_R8_SNORM = 10,
VK_FORMAT_R8_USCALED = 11,
VK_FORMAT_R8_SSCALED = 12,
VK_FORMAT_R8_UINT = 13,
VK_FORMAT_R8_SINT = 14,
VK_FORMAT_R8_SRGB = 15,
VK_FORMAT_R8G8_UNORM = 16,
VK_FORMAT_R8G8_SNORM = 17,
VK_FORMAT_R8G8_USCALED = 18,
VK_FORMAT_R8G8_SSCALED = 19,
VK_FORMAT_R8G8_UINT = 20,
VK_FORMAT_R8G8_SINT = 21,
VK_FORMAT_R8G8_SRGB = 22,
VK_FORMAT_R8G8B8_UNORM = 23,
VK_FORMAT_R8G8B8_SNORM = 24,
VK_FORMAT_R8G8B8_USCALED = 25,
VK_FORMAT_R8G8B8_SSCALED = 26,
VK_FORMAT_R8G8B8_UINT = 27,
VK_FORMAT_R8G8B8_SINT = 28,
VK_FORMAT_R8G8B8_SRGB = 29,
VK_FORMAT_B8G8R8_UNORM = 30,
VK_FORMAT_B8G8R8_SNORM = 31,
VK_FORMAT_B8G8R8_USCALED = 32,
VK_FORMAT_B8G8R8_SSCALED = 33,
VK_FORMAT_B8G8R8_UINT = 34,
VK_FORMAT_B8G8R8_SINT = 35,
VK_FORMAT_B8G8R8_SRGB = 36,
VK_FORMAT_R8G8B8A8_UNORM = 37,
VK_FORMAT_R8G8B8A8_SNORM = 38,
VK_FORMAT_R8G8B8A8_USCALED = 39,
VK_FORMAT_R8G8B8A8_SSCALED = 40,
VK_FORMAT_R8G8B8A8_UINT = 41,
VK_FORMAT_R8G8B8A8_SINT = 42,
VK_FORMAT_R8G8B8A8_SRGB = 43,
VK_FORMAT_B8G8R8A8_UNORM = 44,
VK_FORMAT_B8G8R8A8_SNORM = 45,
VK_FORMAT_B8G8R8A8_USCALED = 46,
VK_FORMAT_B8G8R8A8_SSCALED = 47,
VK_FORMAT_B8G8R8A8_UINT = 48,
VK_FORMAT_B8G8R8A8_SINT = 49,
VK_FORMAT_B8G8R8A8_SRGB = 50,
VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
VK_FORMAT_R16_UNORM = 70,
VK_FORMAT_R16_SNORM = 71,
VK_FORMAT_R16_USCALED = 72,
VK_FORMAT_R16_SSCALED = 73,
VK_FORMAT_R16_UINT = 74,
VK_FORMAT_R16_SINT = 75,
VK_FORMAT_R16_SFLOAT = 76,
VK_FORMAT_R16G16_UNORM = 77,
VK_FORMAT_R16G16_SNORM = 78,
VK_FORMAT_R16G16_USCALED = 79,
VK_FORMAT_R16G16_SSCALED = 80,
VK_FORMAT_R16G16_UINT = 81,
VK_FORMAT_R16G16_SINT = 82,
VK_FORMAT_R16G16_SFLOAT = 83,
VK_FORMAT_R16G16B16_UNORM = 84,
VK_FORMAT_R16G16B16_SNORM = 85,
VK_FORMAT_R16G16B16_USCALED = 86,
VK_FORMAT_R16G16B16_SSCALED = 87,
VK_FORMAT_R16G16B16_UINT = 88,
VK_FORMAT_R16G16B16_SINT = 89,
VK_FORMAT_R16G16B16_SFLOAT = 90,
VK_FORMAT_R16G16B16A16_UNORM = 91,
VK_FORMAT_R16G16B16A16_SNORM = 92,
VK_FORMAT_R16G16B16A16_USCALED = 93,
VK_FORMAT_R16G16B16A16_SSCALED = 94,
VK_FORMAT_R16G16B16A16_UINT = 95,
VK_FORMAT_R16G16B16A16_SINT = 96,
VK_FORMAT_R16G16B16A16_SFLOAT = 97,
VK_FORMAT_R32_UINT = 98,
VK_FORMAT_R32_SINT = 99,
VK_FORMAT_R32_SFLOAT = 100,
VK_FORMAT_R32G32_UINT = 101,
VK_FORMAT_R32G32_SINT = 102,
VK_FORMAT_R32G32_SFLOAT = 103,
VK_FORMAT_R32G32B32_UINT = 104,
VK_FORMAT_R32G32B32_SINT = 105,
VK_FORMAT_R32G32B32_SFLOAT = 106,
VK_FORMAT_R32G32B32A32_UINT = 107,
VK_FORMAT_R32G32B32A32_SINT = 108,
VK_FORMAT_R32G32B32A32_SFLOAT = 109,
VK_FORMAT_R64_UINT = 110,
VK_FORMAT_R64_SINT = 111,
VK_FORMAT_R64_SFLOAT = 112,
VK_FORMAT_R64G64_UINT = 113,
VK_FORMAT_R64G64_SINT = 114,
VK_FORMAT_R64G64_SFLOAT = 115,
VK_FORMAT_R64G64B64_UINT = 116,
VK_FORMAT_R64G64B64_SINT = 117,
VK_FORMAT_R64G64B64_SFLOAT = 118,
VK_FORMAT_R64G64B64A64_UINT = 119,
VK_FORMAT_R64G64B64A64_SINT = 120,
VK_FORMAT_R64G64B64A64_SFLOAT = 121,
VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
VK_FORMAT_D16_UNORM = 124,
VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
VK_FORMAT_D32_SFLOAT = 126,
VK_FORMAT_S8_UINT = 127,
VK_FORMAT_D16_UNORM_S8_UINT = 128,
VK_FORMAT_D24_UNORM_S8_UINT = 129,
VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
VK_FORMAT_BC2_UNORM_BLOCK = 135,
VK_FORMAT_BC2_SRGB_BLOCK = 136,
VK_FORMAT_BC3_UNORM_BLOCK = 137,
VK_FORMAT_BC3_SRGB_BLOCK = 138,
VK_FORMAT_BC4_UNORM_BLOCK = 139,
VK_FORMAT_BC4_SNORM_BLOCK = 140,
VK_FORMAT_BC5_UNORM_BLOCK = 141,
VK_FORMAT_BC5_SNORM_BLOCK = 142,
VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
VK_FORMAT_BC7_UNORM_BLOCK = 145,
VK_FORMAT_BC7_SRGB_BLOCK = 146,
VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
VK_FORMAT_BEGIN_RANGE = VK_FORMAT_UNDEFINED,
VK_FORMAT_END_RANGE = VK_FORMAT_ASTC_12x12_SRGB_BLOCK,
VK_FORMAT_RANGE_SIZE = (VK_FORMAT_ASTC_12x12_SRGB_BLOCK - VK_FORMAT_UNDEFINED + 1),
VK_FORMAT_MAX_ENUM = 0x7FFFFFFF
}
enum VkImageType {
VK_IMAGE_TYPE_1D = 0,
VK_IMAGE_TYPE_2D = 1,
VK_IMAGE_TYPE_3D = 2,
VK_IMAGE_TYPE_BEGIN_RANGE = VK_IMAGE_TYPE_1D,
VK_IMAGE_TYPE_END_RANGE = VK_IMAGE_TYPE_3D,
VK_IMAGE_TYPE_RANGE_SIZE = (VK_IMAGE_TYPE_3D - VK_IMAGE_TYPE_1D + 1),
VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkImageTiling {
VK_IMAGE_TILING_OPTIMAL = 0,
VK_IMAGE_TILING_LINEAR = 1,
VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR,
VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1),
VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF
}
enum VkPhysicalDeviceType {
VK_PHYSICAL_DEVICE_TYPE_OTHER = 0,
VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1,
VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2,
VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3,
VK_PHYSICAL_DEVICE_TYPE_CPU = 4,
VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE = VK_PHYSICAL_DEVICE_TYPE_OTHER,
VK_PHYSICAL_DEVICE_TYPE_END_RANGE = VK_PHYSICAL_DEVICE_TYPE_CPU,
VK_PHYSICAL_DEVICE_TYPE_RANGE_SIZE = (VK_PHYSICAL_DEVICE_TYPE_CPU - VK_PHYSICAL_DEVICE_TYPE_OTHER + 1),
VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkQueryType {
VK_QUERY_TYPE_OCCLUSION = 0,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION,
VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP,
VK_QUERY_TYPE_RANGE_SIZE = (VK_QUERY_TYPE_TIMESTAMP - VK_QUERY_TYPE_OCCLUSION + 1),
VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkSharingMode {
VK_SHARING_MODE_EXCLUSIVE = 0,
VK_SHARING_MODE_CONCURRENT = 1,
VK_SHARING_MODE_BEGIN_RANGE = VK_SHARING_MODE_EXCLUSIVE,
VK_SHARING_MODE_END_RANGE = VK_SHARING_MODE_CONCURRENT,
VK_SHARING_MODE_RANGE_SIZE = (VK_SHARING_MODE_CONCURRENT - VK_SHARING_MODE_EXCLUSIVE + 1),
VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF
}
enum VkImageLayout {
VK_IMAGE_LAYOUT_UNDEFINED = 0,
VK_IMAGE_LAYOUT_GENERAL = 1,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7,
VK_IMAGE_LAYOUT_PREINITIALIZED = 8,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED,
VK_IMAGE_LAYOUT_RANGE_SIZE = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1),
VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF
}
enum VkImageViewType {
VK_IMAGE_VIEW_TYPE_1D = 0,
VK_IMAGE_VIEW_TYPE_2D = 1,
VK_IMAGE_VIEW_TYPE_3D = 2,
VK_IMAGE_VIEW_TYPE_CUBE = 3,
VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4,
VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5,
VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6,
VK_IMAGE_VIEW_TYPE_BEGIN_RANGE = VK_IMAGE_VIEW_TYPE_1D,
VK_IMAGE_VIEW_TYPE_END_RANGE = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY,
VK_IMAGE_VIEW_TYPE_RANGE_SIZE = (VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - VK_IMAGE_VIEW_TYPE_1D + 1),
VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkComponentSwizzle {
VK_COMPONENT_SWIZZLE_IDENTITY = 0,
VK_COMPONENT_SWIZZLE_ZERO = 1,
VK_COMPONENT_SWIZZLE_ONE = 2,
VK_COMPONENT_SWIZZLE_R = 3,
VK_COMPONENT_SWIZZLE_G = 4,
VK_COMPONENT_SWIZZLE_B = 5,
VK_COMPONENT_SWIZZLE_A = 6,
VK_COMPONENT_SWIZZLE_BEGIN_RANGE = VK_COMPONENT_SWIZZLE_IDENTITY,
VK_COMPONENT_SWIZZLE_END_RANGE = VK_COMPONENT_SWIZZLE_A,
VK_COMPONENT_SWIZZLE_RANGE_SIZE = (VK_COMPONENT_SWIZZLE_A - VK_COMPONENT_SWIZZLE_IDENTITY + 1),
VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF
}
enum VkVertexInputRate {
VK_VERTEX_INPUT_RATE_VERTEX = 0,
VK_VERTEX_INPUT_RATE_INSTANCE = 1,
VK_VERTEX_INPUT_RATE_BEGIN_RANGE = VK_VERTEX_INPUT_RATE_VERTEX,
VK_VERTEX_INPUT_RATE_END_RANGE = VK_VERTEX_INPUT_RATE_INSTANCE,
VK_VERTEX_INPUT_RATE_RANGE_SIZE = (VK_VERTEX_INPUT_RATE_INSTANCE - VK_VERTEX_INPUT_RATE_VERTEX + 1),
VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF
}
enum VkPrimitiveTopology {
VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9,
VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10,
VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE = VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
VK_PRIMITIVE_TOPOLOGY_END_RANGE = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST,
VK_PRIMITIVE_TOPOLOGY_RANGE_SIZE = (VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - VK_PRIMITIVE_TOPOLOGY_POINT_LIST + 1),
VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF
}
enum VkPolygonMode {
VK_POLYGON_MODE_FILL = 0,
VK_POLYGON_MODE_LINE = 1,
VK_POLYGON_MODE_POINT = 2,
VK_POLYGON_MODE_BEGIN_RANGE = VK_POLYGON_MODE_FILL,
VK_POLYGON_MODE_END_RANGE = VK_POLYGON_MODE_POINT,
VK_POLYGON_MODE_RANGE_SIZE = (VK_POLYGON_MODE_POINT - VK_POLYGON_MODE_FILL + 1),
VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF
}
enum VkFrontFace {
VK_FRONT_FACE_COUNTER_CLOCKWISE = 0,
VK_FRONT_FACE_CLOCKWISE = 1,
VK_FRONT_FACE_BEGIN_RANGE = VK_FRONT_FACE_COUNTER_CLOCKWISE,
VK_FRONT_FACE_END_RANGE = VK_FRONT_FACE_CLOCKWISE,
VK_FRONT_FACE_RANGE_SIZE = (VK_FRONT_FACE_CLOCKWISE - VK_FRONT_FACE_COUNTER_CLOCKWISE + 1),
VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF
}
enum VkCompareOp {
VK_COMPARE_OP_NEVER = 0,
VK_COMPARE_OP_LESS = 1,
VK_COMPARE_OP_EQUAL = 2,
VK_COMPARE_OP_LESS_OR_EQUAL = 3,
VK_COMPARE_OP_GREATER = 4,
VK_COMPARE_OP_NOT_EQUAL = 5,
VK_COMPARE_OP_GREATER_OR_EQUAL = 6,
VK_COMPARE_OP_ALWAYS = 7,
VK_COMPARE_OP_BEGIN_RANGE = VK_COMPARE_OP_NEVER,
VK_COMPARE_OP_END_RANGE = VK_COMPARE_OP_ALWAYS,
VK_COMPARE_OP_RANGE_SIZE = (VK_COMPARE_OP_ALWAYS - VK_COMPARE_OP_NEVER + 1),
VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkStencilOp {
VK_STENCIL_OP_KEEP = 0,
VK_STENCIL_OP_ZERO = 1,
VK_STENCIL_OP_REPLACE = 2,
VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3,
VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4,
VK_STENCIL_OP_INVERT = 5,
VK_STENCIL_OP_INCREMENT_AND_WRAP = 6,
VK_STENCIL_OP_DECREMENT_AND_WRAP = 7,
VK_STENCIL_OP_BEGIN_RANGE = VK_STENCIL_OP_KEEP,
VK_STENCIL_OP_END_RANGE = VK_STENCIL_OP_DECREMENT_AND_WRAP,
VK_STENCIL_OP_RANGE_SIZE = (VK_STENCIL_OP_DECREMENT_AND_WRAP - VK_STENCIL_OP_KEEP + 1),
VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkLogicOp {
VK_LOGIC_OP_CLEAR = 0,
VK_LOGIC_OP_AND = 1,
VK_LOGIC_OP_AND_REVERSE = 2,
VK_LOGIC_OP_COPY = 3,
VK_LOGIC_OP_AND_INVERTED = 4,
VK_LOGIC_OP_NO_OP = 5,
VK_LOGIC_OP_XOR = 6,
VK_LOGIC_OP_OR = 7,
VK_LOGIC_OP_NOR = 8,
VK_LOGIC_OP_EQUIVALENT = 9,
VK_LOGIC_OP_INVERT = 10,
VK_LOGIC_OP_OR_REVERSE = 11,
VK_LOGIC_OP_COPY_INVERTED = 12,
VK_LOGIC_OP_OR_INVERTED = 13,
VK_LOGIC_OP_NAND = 14,
VK_LOGIC_OP_SET = 15,
VK_LOGIC_OP_BEGIN_RANGE = VK_LOGIC_OP_CLEAR,
VK_LOGIC_OP_END_RANGE = VK_LOGIC_OP_SET,
VK_LOGIC_OP_RANGE_SIZE = (VK_LOGIC_OP_SET - VK_LOGIC_OP_CLEAR + 1),
VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkBlendFactor {
VK_BLEND_FACTOR_ZERO = 0,
VK_BLEND_FACTOR_ONE = 1,
VK_BLEND_FACTOR_SRC_COLOR = 2,
VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3,
VK_BLEND_FACTOR_DST_COLOR = 4,
VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5,
VK_BLEND_FACTOR_SRC_ALPHA = 6,
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7,
VK_BLEND_FACTOR_DST_ALPHA = 8,
VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9,
VK_BLEND_FACTOR_CONSTANT_COLOR = 10,
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11,
VK_BLEND_FACTOR_CONSTANT_ALPHA = 12,
VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13,
VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14,
VK_BLEND_FACTOR_SRC1_COLOR = 15,
VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16,
VK_BLEND_FACTOR_SRC1_ALPHA = 17,
VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18,
VK_BLEND_FACTOR_BEGIN_RANGE = VK_BLEND_FACTOR_ZERO,
VK_BLEND_FACTOR_END_RANGE = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA,
VK_BLEND_FACTOR_RANGE_SIZE = (VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - VK_BLEND_FACTOR_ZERO + 1),
VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF
}
enum VkBlendOp {
VK_BLEND_OP_ADD = 0,
VK_BLEND_OP_SUBTRACT = 1,
VK_BLEND_OP_REVERSE_SUBTRACT = 2,
VK_BLEND_OP_MIN = 3,
VK_BLEND_OP_MAX = 4,
VK_BLEND_OP_BEGIN_RANGE = VK_BLEND_OP_ADD,
VK_BLEND_OP_END_RANGE = VK_BLEND_OP_MAX,
VK_BLEND_OP_RANGE_SIZE = (VK_BLEND_OP_MAX - VK_BLEND_OP_ADD + 1),
VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkDynamicState {
VK_DYNAMIC_STATE_VIEWPORT = 0,
VK_DYNAMIC_STATE_SCISSOR = 1,
VK_DYNAMIC_STATE_LINE_WIDTH = 2,
VK_DYNAMIC_STATE_DEPTH_BIAS = 3,
VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4,
VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5,
VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT,
VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE,
VK_DYNAMIC_STATE_RANGE_SIZE = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1),
VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF
}
enum VkFilter {
VK_FILTER_NEAREST = 0,
VK_FILTER_LINEAR = 1,
VK_FILTER_BEGIN_RANGE = VK_FILTER_NEAREST,
VK_FILTER_END_RANGE = VK_FILTER_LINEAR,
VK_FILTER_RANGE_SIZE = (VK_FILTER_LINEAR - VK_FILTER_NEAREST + 1),
VK_FILTER_MAX_ENUM = 0x7FFFFFFF
}
enum VkSamplerMipmapMode {
VK_SAMPLER_MIPMAP_MODE_NEAREST = 0,
VK_SAMPLER_MIPMAP_MODE_LINEAR = 1,
VK_SAMPLER_MIPMAP_MODE_BEGIN_RANGE = VK_SAMPLER_MIPMAP_MODE_NEAREST,
VK_SAMPLER_MIPMAP_MODE_END_RANGE = VK_SAMPLER_MIPMAP_MODE_LINEAR,
VK_SAMPLER_MIPMAP_MODE_RANGE_SIZE = (VK_SAMPLER_MIPMAP_MODE_LINEAR - VK_SAMPLER_MIPMAP_MODE_NEAREST + 1),
VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF
}
enum VkSamplerAddressMode {
VK_SAMPLER_ADDRESS_MODE_REPEAT = 0,
VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1,
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2,
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3,
VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4,
VK_SAMPLER_ADDRESS_MODE_BEGIN_RANGE = VK_SAMPLER_ADDRESS_MODE_REPEAT,
VK_SAMPLER_ADDRESS_MODE_END_RANGE = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE,
VK_SAMPLER_ADDRESS_MODE_RANGE_SIZE = (VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE - VK_SAMPLER_ADDRESS_MODE_REPEAT + 1),
VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF
}
enum VkBorderColor {
VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0,
VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1,
VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2,
VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3,
VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4,
VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5,
VK_BORDER_COLOR_BEGIN_RANGE = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
VK_BORDER_COLOR_END_RANGE = VK_BORDER_COLOR_INT_OPAQUE_WHITE,
VK_BORDER_COLOR_RANGE_SIZE = (VK_BORDER_COLOR_INT_OPAQUE_WHITE - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK + 1),
VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF
}
enum VkDescriptorType {
VK_DESCRIPTOR_TYPE_SAMPLER = 0,
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1,
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2,
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3,
VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4,
VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9,
VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10,
VK_DESCRIPTOR_TYPE_BEGIN_RANGE = VK_DESCRIPTOR_TYPE_SAMPLER,
VK_DESCRIPTOR_TYPE_END_RANGE = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
VK_DESCRIPTOR_TYPE_RANGE_SIZE = (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT - VK_DESCRIPTOR_TYPE_SAMPLER + 1),
VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkAttachmentLoadOp {
VK_ATTACHMENT_LOAD_OP_LOAD = 0,
VK_ATTACHMENT_LOAD_OP_CLEAR = 1,
VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2,
VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE = VK_ATTACHMENT_LOAD_OP_LOAD,
VK_ATTACHMENT_LOAD_OP_END_RANGE = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_ATTACHMENT_LOAD_OP_RANGE_SIZE = (VK_ATTACHMENT_LOAD_OP_DONT_CARE - VK_ATTACHMENT_LOAD_OP_LOAD + 1),
VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkAttachmentStoreOp {
VK_ATTACHMENT_STORE_OP_STORE = 0,
VK_ATTACHMENT_STORE_OP_DONT_CARE = 1,
VK_ATTACHMENT_STORE_OP_BEGIN_RANGE = VK_ATTACHMENT_STORE_OP_STORE,
VK_ATTACHMENT_STORE_OP_END_RANGE = VK_ATTACHMENT_STORE_OP_DONT_CARE,
VK_ATTACHMENT_STORE_OP_RANGE_SIZE = (VK_ATTACHMENT_STORE_OP_DONT_CARE - VK_ATTACHMENT_STORE_OP_STORE + 1),
VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF
}
enum VkPipelineBindPoint {
VK_PIPELINE_BIND_POINT_GRAPHICS = 0,
VK_PIPELINE_BIND_POINT_COMPUTE = 1,
VK_PIPELINE_BIND_POINT_BEGIN_RANGE = VK_PIPELINE_BIND_POINT_GRAPHICS,
VK_PIPELINE_BIND_POINT_END_RANGE = VK_PIPELINE_BIND_POINT_COMPUTE,
VK_PIPELINE_BIND_POINT_RANGE_SIZE = (VK_PIPELINE_BIND_POINT_COMPUTE - VK_PIPELINE_BIND_POINT_GRAPHICS + 1),
VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF
}
enum VkCommandBufferLevel {
VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0,
VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1,
VK_COMMAND_BUFFER_LEVEL_BEGIN_RANGE = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
VK_COMMAND_BUFFER_LEVEL_END_RANGE = VK_COMMAND_BUFFER_LEVEL_SECONDARY,
VK_COMMAND_BUFFER_LEVEL_RANGE_SIZE = (VK_COMMAND_BUFFER_LEVEL_SECONDARY - VK_COMMAND_BUFFER_LEVEL_PRIMARY + 1),
VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF
}
enum VkIndexType {
VK_INDEX_TYPE_UINT16 = 0,
VK_INDEX_TYPE_UINT32 = 1,
VK_INDEX_TYPE_BEGIN_RANGE = VK_INDEX_TYPE_UINT16,
VK_INDEX_TYPE_END_RANGE = VK_INDEX_TYPE_UINT32,
VK_INDEX_TYPE_RANGE_SIZE = (VK_INDEX_TYPE_UINT32 - VK_INDEX_TYPE_UINT16 + 1),
VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF
}
enum VkSubpassContents {
VK_SUBPASS_CONTENTS_INLINE = 0,
VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1,
VK_SUBPASS_CONTENTS_BEGIN_RANGE = VK_SUBPASS_CONTENTS_INLINE,
VK_SUBPASS_CONTENTS_END_RANGE = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS,
VK_SUBPASS_CONTENTS_RANGE_SIZE = (VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - VK_SUBPASS_CONTENTS_INLINE + 1),
VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF
}
alias VkInstanceCreateFlags = VkFlags;
enum VkFormatFeatureFlagBits {
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001,
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002,
VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004,
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008,
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010,
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020,
VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040,
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080,
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100,
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200,
VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400,
VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800,
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
}
alias VkFormatFeatureFlags = VkFlags;
enum VkImageUsageFlagBits {
VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001,
VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002,
VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004,
VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008,
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010,
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020,
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040,
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080,
}
alias VkImageUsageFlags = VkFlags;
enum VkImageCreateFlagBits {
VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001,
VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002,
VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008,
VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010,
}
alias VkImageCreateFlags = VkFlags;
enum VkSampleCountFlagBits {
VK_SAMPLE_COUNT_1_BIT = 0x00000001,
VK_SAMPLE_COUNT_2_BIT = 0x00000002,
VK_SAMPLE_COUNT_4_BIT = 0x00000004,
VK_SAMPLE_COUNT_8_BIT = 0x00000008,
VK_SAMPLE_COUNT_16_BIT = 0x00000010,
VK_SAMPLE_COUNT_32_BIT = 0x00000020,
VK_SAMPLE_COUNT_64_BIT = 0x00000040,
}
alias VkSampleCountFlags = VkFlags;
enum VkQueueFlagBits {
VK_QUEUE_GRAPHICS_BIT = 0x00000001,
VK_QUEUE_COMPUTE_BIT = 0x00000002,
VK_QUEUE_TRANSFER_BIT = 0x00000004,
VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008,
}
alias VkQueueFlags = VkFlags;
enum VkMemoryPropertyFlagBits {
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
}
alias VkMemoryPropertyFlags = VkFlags;
enum VkMemoryHeapFlagBits {
VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
}
alias VkMemoryHeapFlags = VkFlags;
alias VkDeviceCreateFlags = VkFlags;
alias VkDeviceQueueCreateFlags = VkFlags;
enum VkPipelineStageFlagBits {
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001,
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002,
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004,
VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008,
VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010,
VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020,
VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100,
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800,
VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
}
alias VkPipelineStageFlags = VkFlags;
alias VkMemoryMapFlags = VkFlags;
enum VkImageAspectFlagBits {
VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
}
alias VkImageAspectFlags = VkFlags;
enum VkSparseImageFormatFlagBits {
VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001,
VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002,
VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004,
}
alias VkSparseImageFormatFlags = VkFlags;
enum VkSparseMemoryBindFlagBits {
VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
}
alias VkSparseMemoryBindFlags = VkFlags;
enum VkFenceCreateFlagBits {
VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
}
alias VkFenceCreateFlags = VkFlags;
alias VkSemaphoreCreateFlags = VkFlags;
alias VkEventCreateFlags = VkFlags;
alias VkQueryPoolCreateFlags = VkFlags;
enum VkQueryPipelineStatisticFlagBits {
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001,
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002,
VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004,
VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008,
VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010,
VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020,
VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040,
VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080,
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100,
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200,
VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400,
}
alias VkQueryPipelineStatisticFlags = VkFlags;
enum VkQueryResultFlagBits {
VK_QUERY_RESULT_64_BIT = 0x00000001,
VK_QUERY_RESULT_WAIT_BIT = 0x00000002,
VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004,
VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008,
}
alias VkQueryResultFlags = VkFlags;
enum VkBufferCreateFlagBits {
VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001,
VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002,
VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
}
alias VkBufferCreateFlags = VkFlags;
enum VkBufferUsageFlagBits {
VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001,
VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002,
VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004,
VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008,
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010,
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020,
VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080,
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100,
}
alias VkBufferUsageFlags = VkFlags;
alias VkBufferViewCreateFlags = VkFlags;
alias VkImageViewCreateFlags = VkFlags;
alias VkShaderModuleCreateFlags = VkFlags;
alias VkPipelineCacheCreateFlags = VkFlags;
enum VkPipelineCreateFlagBits {
VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
}
alias VkFlags VkPipelineCreateFlags;
alias VkFlags VkPipelineShaderStageCreateFlags;
enum VkShaderStageFlagBits {
VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
VK_SHADER_STAGE_ALL_GRAPHICS = 0x1F,
VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
}
alias VkFlags VkPipelineVertexInputStateCreateFlags;
alias VkFlags VkPipelineInputAssemblyStateCreateFlags;
alias VkFlags VkPipelineTessellationStateCreateFlags;
alias VkFlags VkPipelineViewportStateCreateFlags;
alias VkFlags VkPipelineRasterizationStateCreateFlags;
enum VkCullModeFlagBits {
VK_CULL_MODE_NONE = 0,
VK_CULL_MODE_FRONT_BIT = 0x00000001,
VK_CULL_MODE_BACK_BIT = 0x00000002,
VK_CULL_MODE_FRONT_AND_BACK = 0x3,
}
alias VkFlags VkCullModeFlags;
alias VkFlags VkPipelineMultisampleStateCreateFlags;
alias VkFlags VkPipelineDepthStencilStateCreateFlags;
alias VkFlags VkPipelineColorBlendStateCreateFlags;
enum VkColorComponentFlagBits {
VK_COLOR_COMPONENT_R_BIT = 0x00000001,
VK_COLOR_COMPONENT_G_BIT = 0x00000002,
VK_COLOR_COMPONENT_B_BIT = 0x00000004,
VK_COLOR_COMPONENT_A_BIT = 0x00000008,
}
alias VkFlags VkColorComponentFlags;
alias VkFlags VkPipelineDynamicStateCreateFlags;
alias VkFlags VkPipelineLayoutCreateFlags;
alias VkFlags VkShaderStageFlags;
alias VkFlags VkSamplerCreateFlags;
alias VkFlags VkDescriptorSetLayoutCreateFlags;
enum VkDescriptorPoolCreateFlagBits {
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
}
alias VkFlags VkDescriptorPoolCreateFlags;
alias VkFlags VkDescriptorPoolResetFlags;
alias VkFlags VkFramebufferCreateFlags;
alias VkFlags VkRenderPassCreateFlags;
enum VkAttachmentDescriptionFlagBits {
VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001,
}
alias VkFlags VkAttachmentDescriptionFlags;
alias VkFlags VkSubpassDescriptionFlags;
enum VkAccessFlagBits {
VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
VK_ACCESS_INDEX_READ_BIT = 0x00000002,
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
VK_ACCESS_SHADER_READ_BIT = 0x00000020,
VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
VK_ACCESS_HOST_READ_BIT = 0x00002000,
VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
}
alias VkFlags VkAccessFlags;
enum VkDependencyFlagBits {
VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
}
alias VkFlags VkDependencyFlags;
enum VkCommandPoolCreateFlagBits {
VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001,
VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002,
}
alias VkFlags VkCommandPoolCreateFlags;
enum VkCommandPoolResetFlagBits {
VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001,
}
alias VkFlags VkCommandPoolResetFlags;
enum VkCommandBufferUsageFlagBits {
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
}
alias VkFlags VkCommandBufferUsageFlags;
enum VkQueryControlFlagBits {
VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
}
alias VkFlags VkQueryControlFlags;
enum VkCommandBufferResetFlagBits {
VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001,
}
alias VkFlags VkCommandBufferResetFlags;
enum VkStencilFaceFlagBits {
VK_STENCIL_FACE_FRONT_BIT = 0x00000001,
VK_STENCIL_FACE_BACK_BIT = 0x00000002,
VK_STENCIL_FRONT_AND_BACK = 0x3,
}
alias VkFlags VkStencilFaceFlags;
alias PFN_vkAllocationFunction = nothrow void* function(
void* pUserData,
size_t size,
size_t alignment,
VkSystemAllocationScope allocationScope);
alias PFN_vkReallocationFunction = nothrow void* function(
void* pUserData,
void* pOriginal,
size_t size,
size_t alignment,
VkSystemAllocationScope allocationScope);
alias PFN_vkFreeFunction = nothrow void function(
void* pUserData,
void* pMemory);
alias PFN_vkInternalAllocationNotification = nothrow void function(
void* pUserData,
size_t size,
VkInternalAllocationType allocationType,
VkSystemAllocationScope allocationScope);
alias PFN_vkInternalFreeNotification = nothrow void function(
void* pUserData,
size_t size,
VkInternalAllocationType allocationType,
VkSystemAllocationScope allocationScope);
alias PFN_vkVoidFunction = nothrow void function();
struct VkApplicationInfo {
VkStructureType sType;
const void* pNext;
const char* pApplicationName;
uint applicationVersion;
const char* pEngineName;
uint engineVersion;
uint apiVersion;
}
struct VkInstanceCreateInfo {
VkStructureType sType;
const void* pNext;
VkInstanceCreateFlags flags;
const VkApplicationInfo* pApplicationInfo;
uint enabledLayerCount;
const(char *)* ppEnabledLayerNames;
uint enabledExtensionCount;
const(char *)* ppEnabledExtensionNames;
}
struct VkAllocationCallbacks {
void* pUserData;
PFN_vkAllocationFunction pfnAllocation;
PFN_vkReallocationFunction pfnReallocation;
PFN_vkFreeFunction pfnFree;
PFN_vkInternalAllocationNotification pfnInternalAllocation;
PFN_vkInternalFreeNotification pfnInternalFree;
}
struct VkPhysicalDeviceFeatures {
VkBool32 robustBufferAccess;
VkBool32 fullDrawIndexUint32;
VkBool32 imageCubeArray;
VkBool32 independentBlend;
VkBool32 geometryShader;
VkBool32 tessellationShader;
VkBool32 sampleRateShading;
VkBool32 dualSrcBlend;
VkBool32 logicOp;
VkBool32 multiDrawIndirect;
VkBool32 drawIndirectFirstInstance;
VkBool32 depthClamp;
VkBool32 depthBiasClamp;
VkBool32 fillModeNonSolid;
VkBool32 depthBounds;
VkBool32 wideLines;
VkBool32 largePoints;
VkBool32 alphaToOne;
VkBool32 multiViewport;
VkBool32 samplerAnisotropy;
VkBool32 textureCompressionETC2;
VkBool32 textureCompressionASTC_LDR;
VkBool32 textureCompressionBC;
VkBool32 occlusionQueryPrecise;
VkBool32 pipelineStatisticsQuery;
VkBool32 vertexPipelineStoresAndAtomics;
VkBool32 fragmentStoresAndAtomics;
VkBool32 shaderTessellationAndGeometryPointSize;
VkBool32 shaderImageGatherExtended;
VkBool32 shaderStorageImageExtendedFormats;
VkBool32 shaderStorageImageMultisample;
VkBool32 shaderStorageImageReadWithoutFormat;
VkBool32 shaderStorageImageWriteWithoutFormat;
VkBool32 shaderUniformBufferArrayDynamicIndexing;
VkBool32 shaderSampledImageArrayDynamicIndexing;
VkBool32 shaderStorageBufferArrayDynamicIndexing;
VkBool32 shaderStorageImageArrayDynamicIndexing;
VkBool32 shaderClipDistance;
VkBool32 shaderCullDistance;
VkBool32 shaderFloat64;
VkBool32 shaderInt64;
VkBool32 shaderInt16;
VkBool32 shaderResourceResidency;
VkBool32 shaderResourceMinLod;
VkBool32 sparseBinding;
VkBool32 sparseResidencyBuffer;
VkBool32 sparseResidencyImage2D;
VkBool32 sparseResidencyImage3D;
VkBool32 sparseResidency2Samples;
VkBool32 sparseResidency4Samples;
VkBool32 sparseResidency8Samples;
VkBool32 sparseResidency16Samples;
VkBool32 sparseResidencyAliased;
VkBool32 variableMultisampleRate;
VkBool32 inheritedQueries;
}
struct VkFormatProperties {
VkFormatFeatureFlags linearTilingFeatures;
VkFormatFeatureFlags optimalTilingFeatures;
VkFormatFeatureFlags bufferFeatures;
}
struct VkExtent3D {
uint width;
uint height;
uint depth;
}
struct VkImageFormatProperties {
VkExtent3D maxExtent;
uint maxMipLevels;
uint maxArrayLayers;
VkSampleCountFlags sampleCounts;
VkDeviceSize maxResourceSize;
}
struct VkPhysicalDeviceLimits {
uint maxImageDimension1D;
uint maxImageDimension2D;
uint maxImageDimension3D;
uint maxImageDimensionCube;
uint maxImageArrayLayers;
uint maxTexelBufferElements;
uint maxUniformBufferRange;
uint maxStorageBufferRange;
uint maxPushConstantsSize;
uint maxMemoryAllocationCount;
uint maxSamplerAllocationCount;
VkDeviceSize bufferImageGranularity;
VkDeviceSize sparseAddressSpaceSize;
uint maxBoundDescriptorSets;
uint maxPerStageDescriptorSamplers;
uint maxPerStageDescriptorUniformBuffers;
uint maxPerStageDescriptorStorageBuffers;
uint maxPerStageDescriptorSampledImages;
uint maxPerStageDescriptorStorageImages;
uint maxPerStageDescriptorInputAttachments;
uint maxPerStageResources;
uint maxDescriptorSetSamplers;
uint maxDescriptorSetUniformBuffers;
uint maxDescriptorSetUniformBuffersDynamic;
uint maxDescriptorSetStorageBuffers;
uint maxDescriptorSetStorageBuffersDynamic;
uint maxDescriptorSetSampledImages;
uint maxDescriptorSetStorageImages;
uint maxDescriptorSetInputAttachments;
uint maxVertexInputAttributes;
uint maxVertexInputBindings;
uint maxVertexInputAttributeOffset;
uint maxVertexInputBindingStride;
uint maxVertexOutputComponents;
uint maxTessellationGenerationLevel;
uint maxTessellationPatchSize;
uint maxTessellationControlPerVertexInputComponents;
uint maxTessellationControlPerVertexOutputComponents;
uint maxTessellationControlPerPatchOutputComponents;
uint maxTessellationControlTotalOutputComponents;
uint maxTessellationEvaluationInputComponents;
uint maxTessellationEvaluationOutputComponents;
uint maxGeometryShaderInvocations;
uint maxGeometryInputComponents;
uint maxGeometryOutputComponents;
uint maxGeometryOutputVertices;
uint maxGeometryTotalOutputComponents;
uint maxFragmentInputComponents;
uint maxFragmentOutputAttachments;
uint maxFragmentDualSrcAttachments;
uint maxFragmentCombinedOutputResources;
uint maxComputeSharedMemorySize;
uint[3] maxComputeWorkGroupCount;
uint maxComputeWorkGroupInvocations;
uint[3] maxComputeWorkGroupSize;
uint subPixelPrecisionBits;
uint subTexelPrecisionBits;
uint mipmapPrecisionBits;
uint maxDrawIndexedIndexValue;
uint maxDrawIndirectCount;
float maxSamplerLodBias;
float maxSamplerAnisotropy;
uint maxViewports;
uint[2] maxViewportDimensions;
float[2] viewportBoundsRange;
uint viewportSubPixelBits;
size_t minMemoryMapAlignment;
VkDeviceSize minTexelBufferOffsetAlignment;
VkDeviceSize minUniformBufferOffsetAlignment;
VkDeviceSize minStorageBufferOffsetAlignment;
int minTexelOffset;
uint maxTexelOffset;
int minTexelGatherOffset;
uint maxTexelGatherOffset;
float minInterpolationOffset;
float maxInterpolationOffset;
uint subPixelInterpolationOffsetBits;
uint maxFramebufferWidth;
uint maxFramebufferHeight;
uint maxFramebufferLayers;
VkSampleCountFlags framebufferColorSampleCounts;
VkSampleCountFlags framebufferDepthSampleCounts;
VkSampleCountFlags framebufferStencilSampleCounts;
VkSampleCountFlags framebufferNoAttachmentsSampleCounts;
uint maxColorAttachments;
VkSampleCountFlags sampledImageColorSampleCounts;
VkSampleCountFlags sampledImageIntegerSampleCounts;
VkSampleCountFlags sampledImageDepthSampleCounts;
VkSampleCountFlags sampledImageStencilSampleCounts;
VkSampleCountFlags storageImageSampleCounts;
uint maxSampleMaskWords;
VkBool32 timestampComputeAndGraphics;
float timestampPeriod;
uint maxClipDistances;
uint maxCullDistances;
uint maxCombinedClipAndCullDistances;
uint discreteQueuePriorities;
float[2] pointSizeRange;
float[2] lineWidthRange;
float pointSizeGranularity;
float lineWidthGranularity;
VkBool32 strictLines;
VkBool32 standardSampleLocations;
VkDeviceSize optimalBufferCopyOffsetAlignment;
VkDeviceSize optimalBufferCopyRowPitchAlignment;
VkDeviceSize nonCoherentAtomSize;
}
struct VkPhysicalDeviceSparseProperties {
VkBool32 residencyStandard2DBlockShape;
VkBool32 residencyStandard2DMultisampleBlockShape;
VkBool32 residencyStandard3DBlockShape;
VkBool32 residencyAlignedMipSize;
VkBool32 residencyNonResidentStrict;
}
struct VkPhysicalDeviceProperties {
uint apiVersion;
uint driverVersion;
uint vendorID;
uint deviceID;
VkPhysicalDeviceType deviceType;
char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName;
ubyte[VK_UUID_SIZE] pipelineCacheUUID;
VkPhysicalDeviceLimits limits;
VkPhysicalDeviceSparseProperties sparseProperties;
}
struct VkQueueFamilyProperties {
VkQueueFlags queueFlags;
uint queueCount;
uint timestampValidBits;
VkExtent3D minImageTransferGranularity;
}
struct VkMemoryType {
VkMemoryPropertyFlags propertyFlags;
uint heapIndex;
}
struct VkMemoryHeap {
VkDeviceSize size;
VkMemoryHeapFlags flags;
}
struct VkPhysicalDeviceMemoryProperties {
uint memoryTypeCount;
VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes;
uint memoryHeapCount;
VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps;
}
struct VkDeviceQueueCreateInfo {
VkStructureType sType;
const void* pNext;
VkDeviceQueueCreateFlags flags;
uint queueFamilyIndex;
uint queueCount;
const float* pQueuePriorities;
}
struct VkDeviceCreateInfo {
VkStructureType sType;
const void* pNext;
VkDeviceCreateFlags flags;
uint queueCreateInfoCount;
const VkDeviceQueueCreateInfo* pQueueCreateInfos;
uint enabledLayerCount;
const(char *)* ppEnabledLayerNames;
uint enabledExtensionCount;
const(char *)* ppEnabledExtensionNames;
const VkPhysicalDeviceFeatures* pEnabledFeatures;
}
struct VkExtensionProperties {
char[VK_MAX_EXTENSION_NAME_SIZE] extensionName;
uint specVersion;
}
struct VkLayerProperties {
char[VK_MAX_EXTENSION_NAME_SIZE] layerName;
uint specVersion;
uint implementationVersion;
char[VK_MAX_DESCRIPTION_SIZE] description;
}
struct VkSubmitInfo {
VkStructureType sType;
const void* pNext;
uint waitSemaphoreCount;
const VkSemaphore* pWaitSemaphores;
const VkPipelineStageFlags* pWaitDstStageMask;
uint commandBufferCount;
const VkCommandBuffer* pCommandBuffers;
uint signalSemaphoreCount;
const VkSemaphore* pSignalSemaphores;
}
struct VkMemoryAllocateInfo {
VkStructureType sType;
const void* pNext;
VkDeviceSize allocationSize;
uint memoryTypeIndex;
}
struct VkMappedMemoryRange {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkDeviceSize offset;
VkDeviceSize size;
}
struct VkMemoryRequirements {
VkDeviceSize size;
VkDeviceSize alignment;
uint memoryTypeBits;
}
struct VkSparseImageFormatProperties {
VkImageAspectFlags aspectMask;
VkExtent3D imageGranularity;
VkSparseImageFormatFlags flags;
}
struct VkSparseImageMemoryRequirements {
VkSparseImageFormatProperties formatProperties;
uint imageMipTailFirstLod;
VkDeviceSize imageMipTailSize;
VkDeviceSize imageMipTailOffset;
VkDeviceSize imageMipTailStride;
}
struct VkSparseMemoryBind {
VkDeviceSize resourceOffset;
VkDeviceSize size;
VkDeviceMemory memory;
VkDeviceSize memoryOffset;
VkSparseMemoryBindFlags flags;
}
struct VkSparseBufferMemoryBindInfo {
VkBuffer buffer;
uint bindCount;
const VkSparseMemoryBind* pBinds;
}
struct VkSparseImageOpaqueMemoryBindInfo {
VkImage image;
uint bindCount;
const VkSparseMemoryBind* pBinds;
}
struct VkImageSubresource {
VkImageAspectFlags aspectMask;
uint mipLevel;
uint arrayLayer;
}
struct VkOffset3D {
int x;
int y;
int z;
}
struct VkSparseImageMemoryBind {
VkImageSubresource subresource;
VkOffset3D offset;
VkExtent3D extent;
VkDeviceMemory memory;
VkDeviceSize memoryOffset;
VkSparseMemoryBindFlags flags;
}
struct VkSparseImageMemoryBindInfo {
VkImage image;
uint bindCount;
const VkSparseImageMemoryBind* pBinds;
}
struct VkBindSparseInfo {
VkStructureType sType;
const void* pNext;
uint waitSemaphoreCount;
const VkSemaphore* pWaitSemaphores;
uint bufferBindCount;
const VkSparseBufferMemoryBindInfo* pBufferBinds;
uint imageOpaqueBindCount;
const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds;
uint imageBindCount;
const VkSparseImageMemoryBindInfo* pImageBinds;
uint signalSemaphoreCount;
const VkSemaphore* pSignalSemaphores;
}
struct VkFenceCreateInfo {
VkStructureType sType;
const void* pNext;
VkFenceCreateFlags flags;
}
struct VkSemaphoreCreateInfo {
VkStructureType sType;
const void* pNext;
VkSemaphoreCreateFlags flags;
}
struct VkEventCreateInfo {
VkStructureType sType;
const void* pNext;
VkEventCreateFlags flags;
}
struct VkQueryPoolCreateInfo {
VkStructureType sType;
const void* pNext;
VkQueryPoolCreateFlags flags;
VkQueryType queryType;
uint queryCount;
VkQueryPipelineStatisticFlags pipelineStatistics;
}
struct VkBufferCreateInfo {
VkStructureType sType;
const void* pNext;
VkBufferCreateFlags flags;
VkDeviceSize size;
VkBufferUsageFlags usage;
VkSharingMode sharingMode;
uint queueFamilyIndexCount;
const uint* pQueueFamilyIndices;
}
struct VkBufferViewCreateInfo {
VkStructureType sType;
const void* pNext;
VkBufferViewCreateFlags flags;
VkBuffer buffer;
VkFormat format;
VkDeviceSize offset;
VkDeviceSize range;
}
struct VkImageCreateInfo {
VkStructureType sType;
const void* pNext;
VkImageCreateFlags flags;
VkImageType imageType;
VkFormat format;
VkExtent3D extent;
uint mipLevels;
uint arrayLayers;
VkSampleCountFlagBits samples;
VkImageTiling tiling;
VkImageUsageFlags usage;
VkSharingMode sharingMode;
uint queueFamilyIndexCount;
const uint* pQueueFamilyIndices;
VkImageLayout initialLayout;
}
struct VkSubresourceLayout {
VkDeviceSize offset;
VkDeviceSize size;
VkDeviceSize rowPitch;
VkDeviceSize arrayPitch;
VkDeviceSize depthPitch;
}
struct VkComponentMapping {
VkComponentSwizzle r;
VkComponentSwizzle g;
VkComponentSwizzle b;
VkComponentSwizzle a;
}
struct VkImageSubresourceRange {
VkImageAspectFlags aspectMask;
uint baseMipLevel;
uint levelCount;
uint baseArrayLayer;
uint layerCount;
}
struct VkImageViewCreateInfo {
VkStructureType sType;
const void* pNext;
VkImageViewCreateFlags flags;
VkImage image;
VkImageViewType viewType;
VkFormat format;
VkComponentMapping components;
VkImageSubresourceRange subresourceRange;
}
struct VkShaderModuleCreateInfo {
VkStructureType sType;
const void* pNext;
VkShaderModuleCreateFlags flags;
size_t codeSize;
const uint* pCode;
}
struct VkPipelineCacheCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineCacheCreateFlags flags;
size_t initialDataSize;
const void* pInitialData;
}
struct VkSpecializationMapEntry {
uint constantID;
uint offset;
size_t size;
}
struct VkSpecializationInfo {
uint mapEntryCount;
const VkSpecializationMapEntry* pMapEntries;
size_t dataSize;
const void* pData;
}
struct VkPipelineShaderStageCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineShaderStageCreateFlags flags;
VkShaderStageFlagBits stage;
VkShaderModule module_;
const char* pName;
const VkSpecializationInfo* pSpecializationInfo;
}
struct VkVertexInputBindingDescription {
uint binding;
uint stride;
VkVertexInputRate inputRate;
}
struct VkVertexInputAttributeDescription {
uint location;
uint binding;
VkFormat format;
uint offset;
}
struct VkPipelineVertexInputStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineVertexInputStateCreateFlags flags;
uint vertexBindingDescriptionCount;
const VkVertexInputBindingDescription* pVertexBindingDescriptions;
uint vertexAttributeDescriptionCount;
const VkVertexInputAttributeDescription* pVertexAttributeDescriptions;
}
struct VkPipelineInputAssemblyStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineInputAssemblyStateCreateFlags flags;
VkPrimitiveTopology topology;
VkBool32 primitiveRestartEnable;
}
struct VkPipelineTessellationStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineTessellationStateCreateFlags flags;
uint patchControlPoints;
}
struct VkViewport {
float x;
float y;
float width;
float height;
float minDepth;
float maxDepth;
}
struct VkOffset2D {
int x;
int y;
}
struct VkExtent2D {
uint width;
uint height;
}
struct VkRect2D {
VkOffset2D offset;
VkExtent2D extent;
}
struct VkPipelineViewportStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineViewportStateCreateFlags flags;
uint viewportCount;
const VkViewport* pViewports;
uint scissorCount;
const VkRect2D* pScissors;
}
struct VkPipelineRasterizationStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineRasterizationStateCreateFlags flags;
VkBool32 depthClampEnable;
VkBool32 rasterizerDiscardEnable;
VkPolygonMode polygonMode;
VkCullModeFlags cullMode;
VkFrontFace frontFace;
VkBool32 depthBiasEnable;
float depthBiasConstantFactor;
float depthBiasClamp;
float depthBiasSlopeFactor;
float lineWidth;
}
struct VkPipelineMultisampleStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineMultisampleStateCreateFlags flags;
VkSampleCountFlagBits rasterizationSamples;
VkBool32 sampleShadingEnable;
float minSampleShading;
const VkSampleMask* pSampleMask;
VkBool32 alphaToCoverageEnable;
VkBool32 alphaToOneEnable;
}
struct VkStencilOpState {
VkStencilOp failOp;
VkStencilOp passOp;
VkStencilOp depthFailOp;
VkCompareOp compareOp;
uint compareMask;
uint writeMask;
uint reference;
}
struct VkPipelineDepthStencilStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineDepthStencilStateCreateFlags flags;
VkBool32 depthTestEnable;
VkBool32 depthWriteEnable;
VkCompareOp depthCompareOp;
VkBool32 depthBoundsTestEnable;
VkBool32 stencilTestEnable;
VkStencilOpState front;
VkStencilOpState back;
float minDepthBounds;
float maxDepthBounds;
}
struct VkPipelineColorBlendAttachmentState {
VkBool32 blendEnable;
VkBlendFactor srcColorBlendFactor;
VkBlendFactor dstColorBlendFactor;
VkBlendOp colorBlendOp;
VkBlendFactor srcAlphaBlendFactor;
VkBlendFactor dstAlphaBlendFactor;
VkBlendOp alphaBlendOp;
VkColorComponentFlags colorWriteMask;
}
struct VkPipelineColorBlendStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineColorBlendStateCreateFlags flags;
VkBool32 logicOpEnable;
VkLogicOp logicOp;
uint attachmentCount;
const VkPipelineColorBlendAttachmentState* pAttachments;
float[4] blendConstants;
}
struct VkPipelineDynamicStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineDynamicStateCreateFlags flags;
uint dynamicStateCount;
const VkDynamicState* pDynamicStates;
}
struct VkGraphicsPipelineCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineCreateFlags flags;
uint stageCount;
const VkPipelineShaderStageCreateInfo* pStages;
const VkPipelineVertexInputStateCreateInfo* pVertexInputState;
const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState;
const VkPipelineTessellationStateCreateInfo* pTessellationState;
const VkPipelineViewportStateCreateInfo* pViewportState;
const VkPipelineRasterizationStateCreateInfo* pRasterizationState;
const VkPipelineMultisampleStateCreateInfo* pMultisampleState;
const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState;
const VkPipelineColorBlendStateCreateInfo* pColorBlendState;
const VkPipelineDynamicStateCreateInfo* pDynamicState;
VkPipelineLayout layout;
VkRenderPass renderPass;
uint subpass;
VkPipeline basePipelineHandle;
int basePipelineIndex;
}
struct VkComputePipelineCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineCreateFlags flags;
VkPipelineShaderStageCreateInfo stage;
VkPipelineLayout layout;
VkPipeline basePipelineHandle;
int basePipelineIndex;
}
struct VkPushConstantRange {
VkShaderStageFlags stageFlags;
uint offset;
uint size;
}
struct VkPipelineLayoutCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineLayoutCreateFlags flags;
uint setLayoutCount;
const VkDescriptorSetLayout* pSetLayouts;
uint pushConstantRangeCount;
const VkPushConstantRange* pPushConstantRanges;
}
struct VkSamplerCreateInfo {
VkStructureType sType;
const void* pNext;
VkSamplerCreateFlags flags;
VkFilter magFilter;
VkFilter minFilter;
VkSamplerMipmapMode mipmapMode;
VkSamplerAddressMode addressModeU;
VkSamplerAddressMode addressModeV;
VkSamplerAddressMode addressModeW;
float mipLodBias;
VkBool32 anisotropyEnable;
float maxAnisotropy;
VkBool32 compareEnable;
VkCompareOp compareOp;
float minLod;
float maxLod;
VkBorderColor borderColor;
VkBool32 unnormalizedCoordinates;
}
struct VkDescriptorSetLayoutBinding {
uint binding;
VkDescriptorType descriptorType;
uint descriptorCount;
VkShaderStageFlags stageFlags;
const VkSampler* pImmutableSamplers;
}
struct VkDescriptorSetLayoutCreateInfo {
VkStructureType sType;
const void* pNext;
VkDescriptorSetLayoutCreateFlags flags;
uint bindingCount;
const VkDescriptorSetLayoutBinding* pBindings;
}
struct VkDescriptorPoolSize {
VkDescriptorType type;
uint descriptorCount;
}
struct VkDescriptorPoolCreateInfo {
VkStructureType sType;
const void* pNext;
VkDescriptorPoolCreateFlags flags;
uint maxSets;
uint poolSizeCount;
const VkDescriptorPoolSize* pPoolSizes;
}
struct VkDescriptorSetAllocateInfo {
VkStructureType sType;
const void* pNext;
VkDescriptorPool descriptorPool;
uint descriptorSetCount;
const VkDescriptorSetLayout* pSetLayouts;
}
struct VkDescriptorImageInfo {
VkSampler sampler;
VkImageView imageView;
VkImageLayout imageLayout;
}
struct VkDescriptorBufferInfo {
VkBuffer buffer;
VkDeviceSize offset;
VkDeviceSize range;
}
struct VkWriteDescriptorSet {
VkStructureType sType;
const void* pNext;
VkDescriptorSet dstSet;
uint dstBinding;
uint dstArrayElement;
uint descriptorCount;
VkDescriptorType descriptorType;
const VkDescriptorImageInfo* pImageInfo;
const VkDescriptorBufferInfo* pBufferInfo;
const VkBufferView* pTexelBufferView;
}
struct VkCopyDescriptorSet {
VkStructureType sType;
const void* pNext;
VkDescriptorSet srcSet;
uint srcBinding;
uint srcArrayElement;
VkDescriptorSet dstSet;
uint dstBinding;
uint dstArrayElement;
uint descriptorCount;
}
struct VkFramebufferCreateInfo {
VkStructureType sType;
const void* pNext;
VkFramebufferCreateFlags flags;
VkRenderPass renderPass;
uint attachmentCount;
const VkImageView* pAttachments;
uint width;
uint height;
uint layers;
}
struct VkAttachmentDescription {
VkAttachmentDescriptionFlags flags;
VkFormat format;
VkSampleCountFlagBits samples;
VkAttachmentLoadOp loadOp;
VkAttachmentStoreOp storeOp;
VkAttachmentLoadOp stencilLoadOp;
VkAttachmentStoreOp stencilStoreOp;
VkImageLayout initialLayout;
VkImageLayout finalLayout;
}
struct VkAttachmentReference {
uint attachment;
VkImageLayout layout;
}
struct VkSubpassDescription {
VkSubpassDescriptionFlags flags;
VkPipelineBindPoint pipelineBindPoint;
uint inputAttachmentCount;
const VkAttachmentReference* pInputAttachments;
uint colorAttachmentCount;
const VkAttachmentReference* pColorAttachments;
const VkAttachmentReference* pResolveAttachments;
const VkAttachmentReference* pDepthStencilAttachment;
uint preserveAttachmentCount;
const uint* pPreserveAttachments;
}
struct VkSubpassDependency {
uint srcSubpass;
uint dstSubpass;
VkPipelineStageFlags srcStageMask;
VkPipelineStageFlags dstStageMask;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkDependencyFlags dependencyFlags;
}
struct VkRenderPassCreateInfo {
VkStructureType sType;
const void* pNext;
VkRenderPassCreateFlags flags;
uint attachmentCount;
const VkAttachmentDescription* pAttachments;
uint subpassCount;
const VkSubpassDescription* pSubpasses;
uint dependencyCount;
const VkSubpassDependency* pDependencies;
}
struct VkCommandPoolCreateInfo {
VkStructureType sType;
const void* pNext;
VkCommandPoolCreateFlags flags;
uint queueFamilyIndex;
}
struct VkCommandBufferAllocateInfo {
VkStructureType sType;
const void* pNext;
VkCommandPool commandPool;
VkCommandBufferLevel level;
uint commandBufferCount;
}
struct VkCommandBufferInheritanceInfo {
VkStructureType sType;
const void* pNext;
VkRenderPass renderPass;
uint subpass;
VkFramebuffer framebuffer;
VkBool32 occlusionQueryEnable;
VkQueryControlFlags queryFlags;
VkQueryPipelineStatisticFlags pipelineStatistics;
}
struct VkCommandBufferBeginInfo {
VkStructureType sType;
const void* pNext;
VkCommandBufferUsageFlags flags;
const VkCommandBufferInheritanceInfo* pInheritanceInfo;
}
struct VkBufferCopy {
VkDeviceSize srcOffset;
VkDeviceSize dstOffset;
VkDeviceSize size;
}
struct VkImageSubresourceLayers {
VkImageAspectFlags aspectMask;
uint mipLevel;
uint baseArrayLayer;
uint layerCount;
}
struct VkImageCopy {
VkImageSubresourceLayers srcSubresource;
VkOffset3D srcOffset;
VkImageSubresourceLayers dstSubresource;
VkOffset3D dstOffset;
VkExtent3D extent;
}
struct VkImageBlit {
VkImageSubresourceLayers srcSubresource;
VkOffset3D[2] srcOffsets;
VkImageSubresourceLayers dstSubresource;
VkOffset3D[2] dstOffsets;
}
struct VkBufferImageCopy {
VkDeviceSize bufferOffset;
uint bufferRowLength;
uint bufferImageHeight;
VkImageSubresourceLayers imageSubresource;
VkOffset3D imageOffset;
VkExtent3D imageExtent;
}
union VkClearColorValue {
float[4] float32;
int[4] int32;
uint[4] uint32;
}
struct VkClearDepthStencilValue {
float depth;
uint stencil;
}
union VkClearValue {
VkClearColorValue color;
VkClearDepthStencilValue depthStencil;
}
struct VkClearAttachment {
VkImageAspectFlags aspectMask;
uint colorAttachment;
VkClearValue clearValue;
}
struct VkClearRect {
VkRect2D rect;
uint baseArrayLayer;
uint layerCount;
}
struct VkImageResolve {
VkImageSubresourceLayers srcSubresource;
VkOffset3D srcOffset;
VkImageSubresourceLayers dstSubresource;
VkOffset3D dstOffset;
VkExtent3D extent;
}
struct VkMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
}
struct VkBufferMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
uint srcQueueFamilyIndex;
uint dstQueueFamilyIndex;
VkBuffer buffer;
VkDeviceSize offset;
VkDeviceSize size;
}
struct VkImageMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkImageLayout oldLayout;
VkImageLayout newLayout;
uint srcQueueFamilyIndex;
uint dstQueueFamilyIndex;
VkImage image;
VkImageSubresourceRange subresourceRange;
}
struct VkRenderPassBeginInfo {
VkStructureType sType;
const void* pNext;
VkRenderPass renderPass;
VkFramebuffer framebuffer;
VkRect2D renderArea;
uint clearValueCount;
const VkClearValue* pClearValues;
}
struct VkDispatchIndirectCommand {
uint x;
uint y;
uint z;
}
struct VkDrawIndexedIndirectCommand {
uint indexCount;
uint instanceCount;
uint firstIndex;
int vertexOffset;
uint firstInstance;
}
struct VkDrawIndirectCommand {
uint vertexCount;
uint instanceCount;
uint firstVertex;
uint firstInstance;
}
alias PFN_vkCreateInstance = nothrow VkResult function(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
alias PFN_vkDestroyInstance = nothrow void function(VkInstance instance, const VkAllocationCallbacks* pAllocator);
alias PFN_vkEnumeratePhysicalDevices = nothrow VkResult function(VkInstance instance, uint* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
alias PFN_vkGetPhysicalDeviceFeatures = nothrow void function(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
alias PFN_vkGetPhysicalDeviceFormatProperties = nothrow void function(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
alias PFN_vkGetPhysicalDeviceImageFormatProperties = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
alias PFN_vkGetPhysicalDeviceProperties = nothrow void function(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
alias PFN_vkGetPhysicalDeviceQueueFamilyProperties = nothrow void function(VkPhysicalDevice physicalDevice, uint* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties);
alias PFN_vkGetPhysicalDeviceMemoryProperties = nothrow void function(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
alias PFN_vkGetInstanceProcAddr = nothrow PFN_vkVoidFunction function(VkInstance instance, const char* pName);
alias PFN_vkGetDeviceProcAddr = nothrow PFN_vkVoidFunction function(VkDevice device, const char* pName);
alias PFN_vkCreateDevice = nothrow VkResult function(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
alias PFN_vkDestroyDevice = nothrow void function(VkDevice device, const VkAllocationCallbacks* pAllocator);
alias PFN_vkEnumerateInstanceExtensionProperties = nothrow VkResult function(const char* pLayerName, uint* pPropertyCount, VkExtensionProperties* pProperties);
alias PFN_vkEnumerateDeviceExtensionProperties = nothrow VkResult function(VkPhysicalDevice physicalDevice, const char* pLayerName, uint* pPropertyCount, VkExtensionProperties* pProperties);
alias PFN_vkEnumerateInstanceLayerProperties = nothrow VkResult function(uint* pPropertyCount, VkLayerProperties* pProperties);
alias PFN_vkEnumerateDeviceLayerProperties = nothrow VkResult function(VkPhysicalDevice physicalDevice, uint* pPropertyCount, VkLayerProperties* pProperties);
alias PFN_vkGetDeviceQueue = nothrow void function(VkDevice device, uint queueFamilyIndex, uint queueIndex, VkQueue* pQueue);
alias PFN_vkQueueSubmit = nothrow VkResult function(VkQueue queue, uint submitCount, const VkSubmitInfo* pSubmits, VkFence fence);
alias PFN_vkQueueWaitIdle = nothrow VkResult function(VkQueue queue);
alias PFN_vkDeviceWaitIdle = nothrow VkResult function(VkDevice device);
alias PFN_vkAllocateMemory = nothrow VkResult function(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory);
alias PFN_vkFreeMemory = nothrow void function(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator);
alias PFN_vkMapMemory = nothrow VkResult function(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
alias PFN_vkUnmapMemory = nothrow void function(VkDevice device, VkDeviceMemory memory);
alias PFN_vkFlushMappedMemoryRanges = nothrow VkResult function(VkDevice device, uint memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
alias PFN_vkInvalidateMappedMemoryRanges = nothrow VkResult function(VkDevice device, uint memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
alias PFN_vkGetDeviceMemoryCommitment = nothrow void function(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
alias PFN_vkBindBufferMemory = nothrow VkResult function(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
alias PFN_vkBindImageMemory = nothrow VkResult function(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset);
alias PFN_vkGetBufferMemoryRequirements = nothrow void function(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
alias PFN_vkGetImageMemoryRequirements = nothrow void function(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
alias PFN_vkGetImageSparseMemoryRequirements = nothrow void function(VkDevice device, VkImage image, uint* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
alias PFN_vkGetPhysicalDeviceSparseImageFormatProperties = nothrow void function(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint* pPropertyCount, VkSparseImageFormatProperties* pProperties);
alias PFN_vkQueueBindSparse = nothrow VkResult function(VkQueue queue, uint bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence);
alias PFN_vkCreateFence = nothrow VkResult function(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence);
alias PFN_vkDestroyFence = nothrow void function(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator);
alias PFN_vkResetFences = nothrow VkResult function(VkDevice device, uint fenceCount, const VkFence* pFences);
alias PFN_vkGetFenceStatus = nothrow VkResult function(VkDevice device, VkFence fence);
alias PFN_vkWaitForFences = nothrow VkResult function(VkDevice device, uint fenceCount, const VkFence* pFences, VkBool32 waitAll, ulong timeout);
alias PFN_vkCreateSemaphore = nothrow VkResult function(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore);
alias PFN_vkDestroySemaphore = nothrow void function(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateEvent = nothrow VkResult function(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent);
alias PFN_vkDestroyEvent = nothrow void function(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetEventStatus = nothrow VkResult function(VkDevice device, VkEvent event);
alias PFN_vkSetEvent = nothrow VkResult function(VkDevice device, VkEvent event);
alias PFN_vkResetEvent = nothrow VkResult function(VkDevice device, VkEvent event);
alias PFN_vkCreateQueryPool = nothrow VkResult function(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool);
alias PFN_vkDestroyQueryPool = nothrow void function(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetQueryPoolResults = nothrow VkResult function(VkDevice device, VkQueryPool queryPool, uint firstQuery, uint queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags);
alias PFN_vkCreateBuffer = nothrow VkResult function(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
alias PFN_vkDestroyBuffer = nothrow void function(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateBufferView = nothrow VkResult function(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView);
alias PFN_vkDestroyBufferView = nothrow void function(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateImage = nothrow VkResult function(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage);
alias PFN_vkDestroyImage = nothrow void function(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetImageSubresourceLayout = nothrow void function(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
alias PFN_vkCreateImageView = nothrow VkResult function(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView);
alias PFN_vkDestroyImageView = nothrow void function(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateShaderModule = nothrow VkResult function(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule);
alias PFN_vkDestroyShaderModule = nothrow void function(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreatePipelineCache = nothrow VkResult function(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache);
alias PFN_vkDestroyPipelineCache = nothrow void function(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetPipelineCacheData = nothrow VkResult function(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData);
alias PFN_vkMergePipelineCaches = nothrow VkResult function(VkDevice device, VkPipelineCache dstCache, uint srcCacheCount, const VkPipelineCache* pSrcCaches);
alias PFN_vkCreateGraphicsPipelines = nothrow VkResult function(VkDevice device, VkPipelineCache pipelineCache, uint createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
alias PFN_vkCreateComputePipelines = nothrow VkResult function(VkDevice device, VkPipelineCache pipelineCache, uint createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
alias PFN_vkDestroyPipeline = nothrow void function(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreatePipelineLayout = nothrow VkResult function(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout);
alias PFN_vkDestroyPipelineLayout = nothrow void function(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateSampler = nothrow VkResult function(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler);
alias PFN_vkDestroySampler = nothrow void function(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateDescriptorSetLayout = nothrow VkResult function(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout);
alias PFN_vkDestroyDescriptorSetLayout = nothrow void function(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateDescriptorPool = nothrow VkResult function(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool);
alias PFN_vkDestroyDescriptorPool = nothrow void function(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator);
alias PFN_vkResetDescriptorPool = nothrow VkResult function(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
alias PFN_vkAllocateDescriptorSets = nothrow VkResult function(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets);
alias PFN_vkFreeDescriptorSets = nothrow VkResult function(VkDevice device, VkDescriptorPool descriptorPool, uint descriptorSetCount, const VkDescriptorSet* pDescriptorSets);
alias PFN_vkUpdateDescriptorSets = nothrow void function(VkDevice device, uint descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies);
alias PFN_vkCreateFramebuffer = nothrow VkResult function(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer);
alias PFN_vkDestroyFramebuffer = nothrow void function(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator);
alias PFN_vkCreateRenderPass = nothrow VkResult function(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass);
alias PFN_vkDestroyRenderPass = nothrow void function(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetRenderAreaGranularity = nothrow void function(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
alias PFN_vkCreateCommandPool = nothrow VkResult function(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool);
alias PFN_vkDestroyCommandPool = nothrow void function(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator);
alias PFN_vkResetCommandPool = nothrow VkResult function(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags);
alias PFN_vkAllocateCommandBuffers = nothrow VkResult function(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers);
alias PFN_vkFreeCommandBuffers = nothrow void function(VkDevice device, VkCommandPool commandPool, uint commandBufferCount, const VkCommandBuffer* pCommandBuffers);
alias PFN_vkBeginCommandBuffer = nothrow VkResult function(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
alias PFN_vkEndCommandBuffer = nothrow VkResult function(VkCommandBuffer commandBuffer);
alias PFN_vkResetCommandBuffer = nothrow VkResult function(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags);
alias PFN_vkCmdBindPipeline = nothrow void function(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
alias PFN_vkCmdSetViewport = nothrow void function(VkCommandBuffer commandBuffer, uint firstViewport, uint viewportCount, const VkViewport* pViewports);
alias PFN_vkCmdSetScissor = nothrow void function(VkCommandBuffer commandBuffer, uint firstScissor, uint scissorCount, const VkRect2D* pScissors);
alias PFN_vkCmdSetLineWidth = nothrow void function(VkCommandBuffer commandBuffer, float lineWidth);
alias PFN_vkCmdSetDepthBias = nothrow void function(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
alias PFN_vkCmdSetBlendConstants = nothrow void function(VkCommandBuffer commandBuffer, const float[4] blendConstants);
alias PFN_vkCmdSetDepthBounds = nothrow void function(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds);
alias PFN_vkCmdSetStencilCompareMask = nothrow void function(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint compareMask);
alias PFN_vkCmdSetStencilWriteMask = nothrow void function(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint writeMask);
alias PFN_vkCmdSetStencilReference = nothrow void function(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint reference);
alias PFN_vkCmdBindDescriptorSets = nothrow void function(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint firstSet, uint descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint dynamicOffsetCount, const uint* pDynamicOffsets);
alias PFN_vkCmdBindIndexBuffer = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
alias PFN_vkCmdBindVertexBuffers = nothrow void function(VkCommandBuffer commandBuffer, uint firstBinding, uint bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
alias PFN_vkCmdDraw = nothrow void function(VkCommandBuffer commandBuffer, uint vertexCount, uint instanceCount, uint firstVertex, uint firstInstance);
alias PFN_vkCmdDrawIndexed = nothrow void function(VkCommandBuffer commandBuffer, uint indexCount, uint instanceCount, uint firstIndex, int vertexOffset, uint firstInstance);
alias PFN_vkCmdDrawIndirect = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint drawCount, uint stride);
alias PFN_vkCmdDrawIndexedIndirect = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint drawCount, uint stride);
alias PFN_vkCmdDispatch = nothrow void function(VkCommandBuffer commandBuffer, uint x, uint y, uint z);
alias PFN_vkCmdDispatchIndirect = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
alias PFN_vkCmdCopyBuffer = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint regionCount, const VkBufferCopy* pRegions);
alias PFN_vkCmdCopyImage = nothrow void function(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint regionCount, const VkImageCopy* pRegions);
alias PFN_vkCmdBlitImage = nothrow void function(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint regionCount, const VkImageBlit* pRegions, VkFilter filter);
alias PFN_vkCmdCopyBufferToImage = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint regionCount, const VkBufferImageCopy* pRegions);
alias PFN_vkCmdCopyImageToBuffer = nothrow void function(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint regionCount, const VkBufferImageCopy* pRegions);
alias PFN_vkCmdUpdateBuffer = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint* pData);
alias PFN_vkCmdFillBuffer = nothrow void function(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint data);
alias PFN_vkCmdClearColorImage = nothrow void function(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint rangeCount, const VkImageSubresourceRange* pRanges);
alias PFN_vkCmdClearDepthStencilImage = nothrow void function(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint rangeCount, const VkImageSubresourceRange* pRanges);
alias PFN_vkCmdClearAttachments = nothrow void function(VkCommandBuffer commandBuffer, uint attachmentCount, const VkClearAttachment* pAttachments, uint rectCount, const VkClearRect* pRects);
alias PFN_vkCmdResolveImage = nothrow void function(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint regionCount, const VkImageResolve* pRegions);
alias PFN_vkCmdSetEvent = nothrow void function(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
alias PFN_vkCmdResetEvent = nothrow void function(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
alias PFN_vkCmdWaitEvents = nothrow void function(VkCommandBuffer commandBuffer, uint eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
alias PFN_vkCmdPipelineBarrier = nothrow void function(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
alias PFN_vkCmdBeginQuery = nothrow void function(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint query, VkQueryControlFlags flags);
alias PFN_vkCmdEndQuery = nothrow void function(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint query);
alias PFN_vkCmdResetQueryPool = nothrow void function(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint firstQuery, uint queryCount);
alias PFN_vkCmdWriteTimestamp = nothrow void function(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint query);
alias PFN_vkCmdCopyQueryPoolResults = nothrow void function(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint firstQuery, uint queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags);
alias PFN_vkCmdPushConstants = nothrow void function(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint offset, uint size, const void* pValues);
alias PFN_vkCmdBeginRenderPass = nothrow void function(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents);
alias PFN_vkCmdNextSubpass = nothrow void function(VkCommandBuffer commandBuffer, VkSubpassContents contents);
alias PFN_vkCmdEndRenderPass = nothrow void function(VkCommandBuffer commandBuffer);
alias PFN_vkCmdExecuteCommands = nothrow void function(VkCommandBuffer commandBuffer, uint commandBufferCount, const VkCommandBuffer* pCommandBuffers);
extern(System) {
VkResult vkCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance);
void vkDestroyInstance(
VkInstance instance,
const VkAllocationCallbacks* pAllocator);
VkResult vkEnumeratePhysicalDevices(
VkInstance instance,
uint* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices);
void vkGetPhysicalDeviceFeatures(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures* pFeatures);
void vkGetPhysicalDeviceFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkFormatProperties* pFormatProperties);
VkResult vkGetPhysicalDeviceImageFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
VkImageTiling tiling,
VkImageUsageFlags usage,
VkImageCreateFlags flags,
VkImageFormatProperties* pImageFormatProperties);
void vkGetPhysicalDeviceProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties);
void vkGetPhysicalDeviceQueueFamilyProperties(
VkPhysicalDevice physicalDevice,
uint* pQueueFamilyPropertyCount,
VkQueueFamilyProperties* pQueueFamilyProperties);
void vkGetPhysicalDeviceMemoryProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties* pMemoryProperties);
PFN_vkVoidFunction vkGetInstanceProcAddr(
VkInstance instance,
const char* pName);
PFN_vkVoidFunction vkGetDeviceProcAddr(
VkDevice device,
const char* pName);
VkResult vkCreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice);
void vkDestroyDevice(
VkDevice device,
const VkAllocationCallbacks* pAllocator);
VkResult vkEnumerateInstanceExtensionProperties(
const char* pLayerName,
uint* pPropertyCount,
VkExtensionProperties* pProperties);
VkResult vkEnumerateDeviceExtensionProperties(
VkPhysicalDevice physicalDevice,
const char* pLayerName,
uint* pPropertyCount,
VkExtensionProperties* pProperties);
VkResult vkEnumerateInstanceLayerProperties(
uint* pPropertyCount,
VkLayerProperties* pProperties);
VkResult vkEnumerateDeviceLayerProperties(
VkPhysicalDevice physicalDevice,
uint* pPropertyCount,
VkLayerProperties* pProperties);
void vkGetDeviceQueue(
VkDevice device,
uint queueFamilyIndex,
uint queueIndex,
VkQueue* pQueue);
VkResult vkQueueSubmit(
VkQueue queue,
uint submitCount,
const VkSubmitInfo* pSubmits,
VkFence fence);
VkResult vkQueueWaitIdle(
VkQueue queue);
VkResult vkDeviceWaitIdle(
VkDevice device);
VkResult vkAllocateMemory(
VkDevice device,
const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator,
VkDeviceMemory* pMemory);
void vkFreeMemory(
VkDevice device,
VkDeviceMemory memory,
const VkAllocationCallbacks* pAllocator);
VkResult vkMapMemory(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize offset,
VkDeviceSize size,
VkMemoryMapFlags flags,
void** ppData);
void vkUnmapMemory(
VkDevice device,
VkDeviceMemory memory);
VkResult vkFlushMappedMemoryRanges(
VkDevice device,
uint memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges);
VkResult vkInvalidateMappedMemoryRanges(
VkDevice device,
uint memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges);
void vkGetDeviceMemoryCommitment(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes);
VkResult vkBindBufferMemory(
VkDevice device,
VkBuffer buffer,
VkDeviceMemory memory,
VkDeviceSize memoryOffset);
VkResult vkBindImageMemory(
VkDevice device,
VkImage image,
VkDeviceMemory memory,
VkDeviceSize memoryOffset);
void vkGetBufferMemoryRequirements(
VkDevice device,
VkBuffer buffer,
VkMemoryRequirements* pMemoryRequirements);
void vkGetImageMemoryRequirements(
VkDevice device,
VkImage image,
VkMemoryRequirements* pMemoryRequirements);
void vkGetImageSparseMemoryRequirements(
VkDevice device,
VkImage image,
uint* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
void vkGetPhysicalDeviceSparseImageFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
VkSampleCountFlagBits samples,
VkImageUsageFlags usage,
VkImageTiling tiling,
uint* pPropertyCount,
VkSparseImageFormatProperties* pProperties);
VkResult vkQueueBindSparse(
VkQueue queue,
uint bindInfoCount,
const VkBindSparseInfo* pBindInfo,
VkFence fence);
VkResult vkCreateFence(
VkDevice device,
const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFence* pFence);
void vkDestroyFence(
VkDevice device,
VkFence fence,
const VkAllocationCallbacks* pAllocator);
VkResult vkResetFences(
VkDevice device,
uint fenceCount,
const VkFence* pFences);
VkResult vkGetFenceStatus(
VkDevice device,
VkFence fence);
VkResult vkWaitForFences(
VkDevice device,
uint fenceCount,
const VkFence* pFences,
VkBool32 waitAll,
ulong timeout);
VkResult vkCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore);
void vkDestroySemaphore(
VkDevice device,
VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateEvent(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkEvent* pEvent);
void vkDestroyEvent(
VkDevice device,
VkEvent event,
const VkAllocationCallbacks* pAllocator);
VkResult vkGetEventStatus(
VkDevice device,
VkEvent event);
VkResult vkSetEvent(
VkDevice device,
VkEvent event);
VkResult vkResetEvent(
VkDevice device,
VkEvent event);
VkResult vkCreateQueryPool(
VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkQueryPool* pQueryPool);
void vkDestroyQueryPool(
VkDevice device,
VkQueryPool queryPool,
const VkAllocationCallbacks* pAllocator);
VkResult vkGetQueryPoolResults(
VkDevice device,
VkQueryPool queryPool,
uint firstQuery,
uint queryCount,
size_t dataSize,
void* pData,
VkDeviceSize stride,
VkQueryResultFlags flags);
VkResult vkCreateBuffer(
VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBuffer* pBuffer);
void vkDestroyBuffer(
VkDevice device,
VkBuffer buffer,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateBufferView(
VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferView* pView);
void vkDestroyBufferView(
VkDevice device,
VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pImage);
void vkDestroyImage(
VkDevice device,
VkImage image,
const VkAllocationCallbacks* pAllocator);
void vkGetImageSubresourceLayout(
VkDevice device,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout);
VkResult vkCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImageView* pView);
void vkDestroyImageView(
VkDevice device,
VkImageView imageView,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateShaderModule(
VkDevice device,
const VkShaderModuleCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkShaderModule* pShaderModule);
void vkDestroyShaderModule(
VkDevice device,
VkShaderModule shaderModule,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreatePipelineCache(
VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineCache* pPipelineCache);
void vkDestroyPipelineCache(
VkDevice device,
VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator);
VkResult vkGetPipelineCacheData(
VkDevice device,
VkPipelineCache pipelineCache,
size_t* pDataSize,
void* pData);
VkResult vkMergePipelineCaches(
VkDevice device,
VkPipelineCache dstCache,
uint srcCacheCount,
const VkPipelineCache* pSrcCaches);
VkResult vkCreateGraphicsPipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint createInfoCount,
const VkGraphicsPipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines);
VkResult vkCreateComputePipelines(
VkDevice device,
VkPipelineCache pipelineCache,
uint createInfoCount,
const VkComputePipelineCreateInfo* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines);
void vkDestroyPipeline(
VkDevice device,
VkPipeline pipeline,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout);
void vkDestroyPipelineLayout(
VkDevice device,
VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler);
void vkDestroySampler(
VkDevice device,
VkSampler sampler,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateDescriptorSetLayout(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout);
void vkDestroyDescriptorSetLayout(
VkDevice device,
VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateDescriptorPool(
VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool);
void vkDestroyDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator);
VkResult vkResetDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags);
VkResult vkAllocateDescriptorSets(
VkDevice device,
const VkDescriptorSetAllocateInfo* pAllocateInfo,
VkDescriptorSet* pDescriptorSets);
VkResult vkFreeDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
uint descriptorSetCount,
const VkDescriptorSet* pDescriptorSets);
void vkUpdateDescriptorSets(
VkDevice device,
uint descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites,
uint descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies);
VkResult vkCreateFramebuffer(
VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFramebuffer* pFramebuffer);
void vkDestroyFramebuffer(
VkDevice device,
VkFramebuffer framebuffer,
const VkAllocationCallbacks* pAllocator);
VkResult vkCreateRenderPass(
VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkRenderPass* pRenderPass);
void vkDestroyRenderPass(
VkDevice device,
VkRenderPass renderPass,
const VkAllocationCallbacks* pAllocator);
void vkGetRenderAreaGranularity(
VkDevice device,
VkRenderPass renderPass,
VkExtent2D* pGranularity);
VkResult vkCreateCommandPool(
VkDevice device,
const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool);
void vkDestroyCommandPool(
VkDevice device,
VkCommandPool commandPool,
const VkAllocationCallbacks* pAllocator);
VkResult vkResetCommandPool(
VkDevice device,
VkCommandPool commandPool,
VkCommandPoolResetFlags flags);
VkResult vkAllocateCommandBuffers(
VkDevice device,
const VkCommandBufferAllocateInfo* pAllocateInfo,
VkCommandBuffer* pCommandBuffers);
void vkFreeCommandBuffers(
VkDevice device,
VkCommandPool commandPool,
uint commandBufferCount,
const VkCommandBuffer* pCommandBuffers);
VkResult vkBeginCommandBuffer(
VkCommandBuffer commandBuffer,
const VkCommandBufferBeginInfo* pBeginInfo);
VkResult vkEndCommandBuffer(
VkCommandBuffer commandBuffer);
VkResult vkResetCommandBuffer(
VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags);
void vkCmdBindPipeline(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline);
void vkCmdSetViewport(
VkCommandBuffer commandBuffer,
uint firstViewport,
uint viewportCount,
const VkViewport* pViewports);
void vkCmdSetScissor(
VkCommandBuffer commandBuffer,
uint firstScissor,
uint scissorCount,
const VkRect2D* pScissors);
void vkCmdSetLineWidth(
VkCommandBuffer commandBuffer,
float lineWidth);
void vkCmdSetDepthBias(
VkCommandBuffer commandBuffer,
float depthBiasConstantFactor,
float depthBiasClamp,
float depthBiasSlopeFactor);
void vkCmdSetBlendConstants(
VkCommandBuffer commandBuffer,
const float[4] blendConstants);
void vkCmdSetDepthBounds(
VkCommandBuffer commandBuffer,
float minDepthBounds,
float maxDepthBounds);
void vkCmdSetStencilCompareMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint compareMask);
void vkCmdSetStencilWriteMask(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint writeMask);
void vkCmdSetStencilReference(
VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask,
uint reference);
void vkCmdBindDescriptorSets(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout,
uint firstSet,
uint descriptorSetCount,
const VkDescriptorSet* pDescriptorSets,
uint dynamicOffsetCount,
const uint* pDynamicOffsets);
void vkCmdBindIndexBuffer(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType);
void vkCmdBindVertexBuffers(
VkCommandBuffer commandBuffer,
uint firstBinding,
uint bindingCount,
const VkBuffer* pBuffers,
const VkDeviceSize* pOffsets);
void vkCmdDraw(
VkCommandBuffer commandBuffer,
uint vertexCount,
uint instanceCount,
uint firstVertex,
uint firstInstance);
void vkCmdDrawIndexed(
VkCommandBuffer commandBuffer,
uint indexCount,
uint instanceCount,
uint firstIndex,
int vertexOffset,
uint firstInstance);
void vkCmdDrawIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint drawCount,
uint stride);
void vkCmdDrawIndexedIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint drawCount,
uint stride);
void vkCmdDispatch(
VkCommandBuffer commandBuffer,
uint x,
uint y,
uint z);
void vkCmdDispatchIndirect(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset);
void vkCmdCopyBuffer(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint regionCount,
const VkBufferCopy* pRegions);
void vkCmdCopyImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint regionCount,
const VkImageCopy* pRegions);
void vkCmdBlitImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint regionCount,
const VkImageBlit* pRegions,
VkFilter filter);
void vkCmdCopyBufferToImage(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint regionCount,
const VkBufferImageCopy* pRegions);
void vkCmdCopyImageToBuffer(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkBuffer dstBuffer,
uint regionCount,
const VkBufferImageCopy* pRegions);
void vkCmdUpdateBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize dataSize,
const uint* pData);
void vkCmdFillBuffer(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize size,
uint data);
void vkCmdClearColorImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearColorValue* pColor,
uint rangeCount,
const VkImageSubresourceRange* pRanges);
void vkCmdClearDepthStencilImage(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearDepthStencilValue* pDepthStencil,
uint rangeCount,
const VkImageSubresourceRange* pRanges);
void vkCmdClearAttachments(
VkCommandBuffer commandBuffer,
uint attachmentCount,
const VkClearAttachment* pAttachments,
uint rectCount,
const VkClearRect* pRects);
void vkCmdResolveImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage dstImage,
VkImageLayout dstImageLayout,
uint regionCount,
const VkImageResolve* pRegions);
void vkCmdSetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask);
void vkCmdResetEvent(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask);
void vkCmdWaitEvents(
VkCommandBuffer commandBuffer,
uint eventCount,
const VkEvent* pEvents,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
uint memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers);
void vkCmdPipelineBarrier(
VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags,
uint memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers);
void vkCmdBeginQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint query,
VkQueryControlFlags flags);
void vkCmdEndQuery(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint query);
void vkCmdResetQueryPool(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint firstQuery,
uint queryCount);
void vkCmdWriteTimestamp(
VkCommandBuffer commandBuffer,
VkPipelineStageFlagBits pipelineStage,
VkQueryPool queryPool,
uint query);
void vkCmdCopyQueryPoolResults(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,
uint firstQuery,
uint queryCount,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize stride,
VkQueryResultFlags flags);
void vkCmdPushConstants(
VkCommandBuffer commandBuffer,
VkPipelineLayout layout,
VkShaderStageFlags stageFlags,
uint offset,
uint size,
const void* pValues);
void vkCmdBeginRenderPass(
VkCommandBuffer commandBuffer,
const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents contents);
void vkCmdNextSubpass(
VkCommandBuffer commandBuffer,
VkSubpassContents contents);
void vkCmdEndRenderPass(
VkCommandBuffer commandBuffer);
void vkCmdExecuteCommands(
VkCommandBuffer commandBuffer,
uint commandBufferCount,
const VkCommandBuffer* pCommandBuffers);
}
enum VK_KHR_surface = 1;
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkSurfaceKHR");
enum VK_KHR_SURFACE_SPEC_VERSION = 25;
enum VK_KHR_SURFACE_EXTENSION_NAME = "VK_KHR_surface";
enum VkColorSpaceKHR {
VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0,
VK_COLORSPACE_BEGIN_RANGE = VK_COLORSPACE_SRGB_NONLINEAR_KHR,
VK_COLORSPACE_END_RANGE = VK_COLORSPACE_SRGB_NONLINEAR_KHR,
VK_COLORSPACE_RANGE_SIZE = (VK_COLORSPACE_SRGB_NONLINEAR_KHR - VK_COLORSPACE_SRGB_NONLINEAR_KHR + 1),
VK_COLORSPACE_MAX_ENUM = 0x7FFFFFFF
}
enum VkPresentModeKHR {
VK_PRESENT_MODE_IMMEDIATE_KHR = 0,
VK_PRESENT_MODE_MAILBOX_KHR = 1,
VK_PRESENT_MODE_FIFO_KHR = 2,
VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3,
VK_PRESENT_MODE_BEGIN_RANGE = VK_PRESENT_MODE_IMMEDIATE_KHR,
VK_PRESENT_MODE_END_RANGE = VK_PRESENT_MODE_FIFO_RELAXED_KHR,
VK_PRESENT_MODE_RANGE_SIZE = (VK_PRESENT_MODE_FIFO_RELAXED_KHR - VK_PRESENT_MODE_IMMEDIATE_KHR + 1),
VK_PRESENT_MODE_MAX_ENUM = 0x7FFFFFFF
}
enum VkSurfaceTransformFlagBitsKHR {
VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
}
alias VkFlags VkSurfaceTransformFlagsKHR;
enum VkCompositeAlphaFlagBitsKHR {
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
}
alias VkFlags VkCompositeAlphaFlagsKHR;
struct VkSurfaceCapabilitiesKHR {
uint minImageCount;
uint maxImageCount;
VkExtent2D currentExtent;
VkExtent2D minImageExtent;
VkExtent2D maxImageExtent;
uint maxImageArrayLayers;
VkSurfaceTransformFlagsKHR supportedTransforms;
VkSurfaceTransformFlagBitsKHR currentTransform;
VkCompositeAlphaFlagsKHR supportedCompositeAlpha;
VkImageUsageFlags supportedUsageFlags;
}
struct VkSurfaceFormatKHR {
VkFormat format;
VkColorSpaceKHR colorSpace;
}
alias PFN_vkDestroySurfaceKHR = nothrow void function(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetPhysicalDeviceSurfaceSupportKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported);
alias PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
alias PFN_vkGetPhysicalDeviceSurfaceFormatsKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats);
alias PFN_vkGetPhysicalDeviceSurfacePresentModesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint* pPresentModeCount, VkPresentModeKHR* pPresentModes);
extern(System) {
void vkDestroySurfaceKHR(
VkInstance instance,
VkSurfaceKHR surface,
const VkAllocationCallbacks* pAllocator);
VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex,
VkSurfaceKHR surface,
VkBool32* pSupported);
VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
uint* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats);
VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
uint* pPresentModeCount,
VkPresentModeKHR* pPresentModes);
}
enum VK_KHR_swapchain = 1;
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkSwapchainKHR");
enum VK_KHR_SWAPCHAIN_SPEC_VERSION = 67;
enum VK_KHR_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_swapchain";
alias VkFlags VkSwapchainCreateFlagsKHR;
struct VkSwapchainCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkSwapchainCreateFlagsKHR flags;
VkSurfaceKHR surface;
uint minImageCount;
VkFormat imageFormat;
VkColorSpaceKHR imageColorSpace;
VkExtent2D imageExtent;
uint imageArrayLayers;
VkImageUsageFlags imageUsage;
VkSharingMode imageSharingMode;
uint queueFamilyIndexCount;
const uint* pQueueFamilyIndices;
VkSurfaceTransformFlagBitsKHR preTransform;
VkCompositeAlphaFlagBitsKHR compositeAlpha;
VkPresentModeKHR presentMode;
VkBool32 clipped;
VkSwapchainKHR oldSwapchain;
}
struct VkPresentInfoKHR {
VkStructureType sType;
const void* pNext;
uint waitSemaphoreCount;
const VkSemaphore* pWaitSemaphores;
uint swapchainCount;
const VkSwapchainKHR* pSwapchains;
const uint* pImageIndices;
VkResult* pResults;
}
alias PFN_vkCreateSwapchainKHR = nothrow VkResult function(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain);
alias PFN_vkDestroySwapchainKHR = nothrow void function(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator);
alias PFN_vkGetSwapchainImagesKHR = nothrow VkResult function(VkDevice device, VkSwapchainKHR swapchain, uint* pSwapchainImageCount, VkImage* pSwapchainImages);
alias PFN_vkAcquireNextImageKHR = nothrow VkResult function(VkDevice device, VkSwapchainKHR swapchain, ulong timeout, VkSemaphore semaphore, VkFence fence, uint* pImageIndex);
alias PFN_vkQueuePresentKHR = nothrow VkResult function(VkQueue queue, const VkPresentInfoKHR* pPresentInfo);
extern(System) {
VkResult vkCreateSwapchainKHR(
VkDevice device,
const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchain);
void vkDestroySwapchainKHR(
VkDevice device,
VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator);
VkResult vkGetSwapchainImagesKHR(
VkDevice device,
VkSwapchainKHR swapchain,
uint* pSwapchainImageCount,
VkImage* pSwapchainImages);
VkResult vkAcquireNextImageKHR(
VkDevice device,
VkSwapchainKHR swapchain,
ulong timeout,
VkSemaphore semaphore,
VkFence fence,
uint* pImageIndex);
VkResult vkQueuePresentKHR(
VkQueue queue,
const VkPresentInfoKHR* pPresentInfo);
}
enum VK_KHR_display = 1;
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDisplayKHR");
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDisplayModeKHR");
enum VK_KHR_DISPLAY_SPEC_VERSION = 21;
enum VK_KHR_DISPLAY_EXTENSION_NAME = "VK_KHR_display";
enum VkDisplayPlaneAlphaFlagBitsKHR {
VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
}
alias VkFlags VkDisplayModeCreateFlagsKHR;
alias VkFlags VkDisplayPlaneAlphaFlagsKHR;
alias VkFlags VkDisplaySurfaceCreateFlagsKHR;
struct VkDisplayPropertiesKHR {
VkDisplayKHR display;
const char* displayName;
VkExtent2D physicalDimensions;
VkExtent2D physicalResolution;
VkSurfaceTransformFlagsKHR supportedTransforms;
VkBool32 planeReorderPossible;
VkBool32 persistentContent;
}
struct VkDisplayModeParametersKHR {
VkExtent2D visibleRegion;
uint refreshRate;
}
struct VkDisplayModePropertiesKHR {
VkDisplayModeKHR displayMode;
VkDisplayModeParametersKHR parameters;
}
struct VkDisplayModeCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkDisplayModeCreateFlagsKHR flags;
VkDisplayModeParametersKHR parameters;
}
struct VkDisplayPlaneCapabilitiesKHR {
VkDisplayPlaneAlphaFlagsKHR supportedAlpha;
VkOffset2D minSrcPosition;
VkOffset2D maxSrcPosition;
VkExtent2D minSrcExtent;
VkExtent2D maxSrcExtent;
VkOffset2D minDstPosition;
VkOffset2D maxDstPosition;
VkExtent2D minDstExtent;
VkExtent2D maxDstExtent;
}
struct VkDisplayPlanePropertiesKHR {
VkDisplayKHR currentDisplay;
uint currentStackIndex;
}
struct VkDisplaySurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkDisplaySurfaceCreateFlagsKHR flags;
VkDisplayModeKHR displayMode;
uint planeIndex;
uint planeStackIndex;
VkSurfaceTransformFlagBitsKHR transform;
float globalAlpha;
VkDisplayPlaneAlphaFlagBitsKHR alphaMode;
VkExtent2D imageExtent;
}
alias PFN_vkGetPhysicalDeviceDisplayPropertiesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, uint* pPropertyCount, VkDisplayPropertiesKHR* pProperties);
alias PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, uint* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties);
alias PFN_vkGetDisplayPlaneSupportedDisplaysKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, uint planeIndex, uint* pDisplayCount, VkDisplayKHR* pDisplays);
alias PFN_vkGetDisplayModePropertiesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint* pPropertyCount, VkDisplayModePropertiesKHR* pProperties);
alias PFN_vkCreateDisplayModeKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR*pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode);
alias PFN_vkGetDisplayPlaneCapabilitiesKHR = nothrow VkResult function(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities);
alias PFN_vkCreateDisplayPlaneSurfaceKHR = nothrow VkResult function(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
extern(System) {
VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
VkPhysicalDevice physicalDevice,
uint* pPropertyCount,
VkDisplayPropertiesKHR* pProperties);
VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
VkPhysicalDevice physicalDevice,
uint* pPropertyCount,
VkDisplayPlanePropertiesKHR* pProperties);
VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
VkPhysicalDevice physicalDevice,
uint planeIndex,
uint* pDisplayCount,
VkDisplayKHR* pDisplays);
VkResult vkGetDisplayModePropertiesKHR(
VkPhysicalDevice physicalDevice,
VkDisplayKHR display,
uint* pPropertyCount,
VkDisplayModePropertiesKHR* pProperties);
VkResult vkCreateDisplayModeKHR(
VkPhysicalDevice physicalDevice,
VkDisplayKHR display,
const VkDisplayModeCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDisplayModeKHR* pMode);
VkResult vkGetDisplayPlaneCapabilitiesKHR(
VkPhysicalDevice physicalDevice,
VkDisplayModeKHR mode,
uint planeIndex,
VkDisplayPlaneCapabilitiesKHR* pCapabilities);
VkResult vkCreateDisplayPlaneSurfaceKHR(
VkInstance instance,
const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
}
enum VK_KHR_display_swapchain = 1;
enum VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION = 9;
enum VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME = "VK_KHR_display_swapchain";
struct VkDisplayPresentInfoKHR {
VkStructureType sType;
const void* pNext;
VkRect2D srcRect;
VkRect2D dstRect;
VkBool32 persistent;
}
alias PFN_vkCreateSharedSwapchainsKHR = nothrow VkResult function(VkDevice device, uint swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains);
extern(System) {
VkResult vkCreateSharedSwapchainsKHR(
VkDevice device,
uint swapchainCount,
const VkSwapchainCreateInfoKHR* pCreateInfos,
const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchains);
}
/+#ifdef VK_USE_PLATFORM_XLIB_KHR
#define VK_KHR_xlib_surface 1
#include <X11/Xlib.h>
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
typedef struct VkXlibSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXlibSurfaceCreateFlagsKHR flags;
Display* dpy;
Window window;
} VkXlibSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex,
Display* dpy,
VisualID visualID);
#endif
#endif /* VK_USE_PLATFORM_XLIB_KHR */
+/
/+
#ifdef VK_USE_PLATFORM_XCB_KHR
#define VK_KHR_xcb_surface 1
#include <xcb/xcb.h>
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
typedef struct VkXcbSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXcbSurfaceCreateFlagsKHR flags;
xcb_connection_t* connection;
xcb_window_t window;
} VkXcbSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
#endif
#endif /* VK_USE_PLATFORM_XCB_KHR */
+//+
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#define VK_KHR_wayland_surface 1
#include <wayland-client.h>
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
typedef struct VkWaylandSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWaylandSurfaceCreateFlagsKHR flags;
struct wl_display* display;
struct wl_surface* surface;
} VkWaylandSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex,
struct wl_display* display);
#endif
#endif /* VK_USE_PLATFORM_WAYLAND_KHR */
+//+
#ifdef VK_USE_PLATFORM_MIR_KHR
#define VK_KHR_mir_surface 1
#include <mir_toolkit/client_types.h>
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
typedef struct VkMirSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkMirSurfaceCreateFlagsKHR flags;
MirConnection* connection;
MirSurface* mirSurface;
} VkMirSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint queueFamilyIndex, MirConnection* connection);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
VkInstance instance,
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex,
MirConnection* connection);
#endif
#endif /* VK_USE_PLATFORM_MIR_KHR */
+//+
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#define VK_KHR_android_surface 1
#include <android/native_window.h>
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkAndroidSurfaceCreateFlagsKHR flags;
ANativeWindow* window;
} VkAndroidSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif /* VK_USE_PLATFORM_ANDROID_KHR */
+/
version(Windows) {
import core.sys.windows.windows;
enum VK_KHR_win32_surface = 1;
enum VK_KHR_WIN32_SURFACE_SPEC_VERSION = 5;
enum VK_KHR_WIN32_SURFACE_EXTENSION_NAME = "VK_KHR_win32_surface";
alias VkFlags VkWin32SurfaceCreateFlagsKHR;
struct VkWin32SurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWin32SurfaceCreateFlagsKHR flags;
HINSTANCE hinstance;
HWND hwnd;
}
alias PFN_vkCreateWin32SurfaceKHR = nothrow VkResult function(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
alias PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR = nothrow VkBool32 function(VkPhysicalDevice physicalDevice, uint queueFamilyIndex);
extern(System) {
VkResult vkCreateWin32SurfaceKHR(
VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint queueFamilyIndex);
}
}
enum VK_EXT_debug_report = 1;
mixin(VK_DEFINE_NON_DISPATCHABLE_HANDLE!"VkDebugReportCallbackEXT");
enum VK_EXT_DEBUG_REPORT_SPEC_VERSION = 1;
enum VK_EXT_DEBUG_REPORT_EXTENSION_NAME = "VK_EXT_debug_report";
enum VkDebugReportObjectTypeEXT {
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
}
enum VkDebugReportErrorEXT {
VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
}
enum VkDebugReportFlagBitsEXT {
VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
}
alias VkFlags VkDebugReportFlagsEXT;
alias PFN_vkDebugReportCallbackEXT = extern(System) VkBool32 function(
VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType,
ulong object,
size_t location,
int messageCode,
const char* pLayerPrefix,
const char* pMessage,
void* pUserData);
struct VkDebugReportCallbackCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkDebugReportFlagsEXT flags;
PFN_vkDebugReportCallbackEXT pfnCallback;
void* pUserData;
}
alias PFN_vkCreateDebugReportCallbackEXT = nothrow VkResult function(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback);
alias PFN_vkDestroyDebugReportCallbackEXT = nothrow void function(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator);
alias PFN_vkDebugReportMessageEXT = nothrow void function(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, ulong object, size_t location, int messageCode, const char* pLayerPrefix, const char* pMessage);
extern(System) {
VkResult vkCreateDebugReportCallbackEXT(
VkInstance instance,
const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDebugReportCallbackEXT* pCallback);
void vkDestroyDebugReportCallbackEXT(
VkInstance instance,
VkDebugReportCallbackEXT callback,
const VkAllocationCallbacks* pAllocator);
void vkDebugReportMessageEXT(
VkInstance instance,
VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType,
ulong object,
size_t location,
int messageCode,
const char* pLayerPrefix,
const char* pMessage);
}
|
D
|
# FIXED
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/gpio.c
driverlib/gpio.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.7.LTS/include/stdbool.h
driverlib/gpio.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.7.LTS/include/stdint.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_gpio.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_ints.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_memmap.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_sysctl.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_types.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/debug.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/gpio.h
driverlib/gpio.obj: C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/interrupt.h
C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/gpio.c:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.7.LTS/include/stdbool.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.7.LTS/include/stdint.h:
C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_gpio.h:
C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_ints.h:
C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_memmap.h:
C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_sysctl.h:
C:/ti/TivaWare_C_Series-2.1.3.156/inc/hw_types.h:
C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/debug.h:
C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/gpio.h:
C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/interrupt.h:
|
D
|
import vibe.d;
import std.random;
enum numSeries = 7;
struct Room {
WebSocket socket;
int[numSeries] curVals;
this(WebSocket sock) {
socket = sock;
foreach(ref x; curVals) {
x = 0;
}
}
void sendData() {
auto json = serializeToJsonString(curVals);
socket.send(json);
}
}
private Room[string] rooms;
final class QuickChart {
void getWS(string room, scope WebSocket socket) {
rooms[room] = Room(socket);
while (socket.waitForData) {
if (!socket.connected) break;
auto text = socket.receiveText;
logInfo("Received: \"%s\" from %s.", text, room);
}
socket.close;
rooms.remove(room);
}
}
void testData() {
if(!("main" in rooms)) return;
auto room = rooms["main"];
room.curVals[0] = uniform(0,100);
room.curVals[1] = uniform(20,50);
room.curVals[2] = uniform(0,20);
room.sendData();
}
shared static this() {
auto router = new URLRouter;
router.registerWebInterface(new QuickChart);
router.get("*", serveStaticFiles("./public/"));
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, router);
logInfo("Please open http://127.0.0.1:8080/ in your browser.");
setTimer(msecs(500), toDelegate(&testData), true);
}
|
D
|
/Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Crypto.build/Random/Hash+Random.swift.o : /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/ByteStream.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Hash+Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/PseudoRandom.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/LibreSSLError.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Helpers.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/libc.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Core.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/CHTTP.build/module.modulemap
/Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Crypto.build/Hash+Random~partial.swiftmodule : /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/ByteStream.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Hash+Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/PseudoRandom.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/LibreSSLError.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Helpers.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/libc.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Core.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/CHTTP.build/module.modulemap
/Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Crypto.build/Hash+Random~partial.swiftdoc : /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/HMAC/HMAC+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Hash/Hash.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/ByteStream.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Hash+Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/Random.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/PseudoRandom.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Random/LibreSSLError.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Helpers.swift /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Essentials/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/libc.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Core.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/Fklemke/swiftbenchmarkproject/vaporJSON/.build/debug/CHTTP.build/module.modulemap
|
D
|
/workspace/triathlon_tracker/triathlon-tracker-lib/target/rls/debug/build/proc-macro-hack-b0b37f556499f9e7/build_script_build-b0b37f556499f9e7: /workspace/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-hack-0.5.19/build.rs
/workspace/triathlon_tracker/triathlon-tracker-lib/target/rls/debug/build/proc-macro-hack-b0b37f556499f9e7/build_script_build-b0b37f556499f9e7.d: /workspace/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-hack-0.5.19/build.rs
/workspace/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-hack-0.5.19/build.rs:
|
D
|
instance NOV_1353_NOVIZE(NPC_DEFAULT)
{
name[0] = NAME_NOVIZE;
npctype = NPCTYPE_AMBIENT;
guild = GIL_NOV;
level = 3;
flags = 0;
voice = 3;
id = 1353;
attribute[ATR_STRENGTH] = 10;
attribute[ATR_DEXTERITY] = 10;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 76;
attribute[ATR_HITPOINTS] = 76;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",34,1,nov_armor_l);
b_scale(self);
Mdl_SetModelFatness(self,-1);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,itmw_1h_hatchet_01);
daily_routine = rtn_start_1353;
};
func void rtn_start_1353()
{
ta_sleep(23,0,7,30,"PSI_25_HUT_IN");
ta_listen(7,30,23,0,"PSI_PLATFORM_1");
};
func void rtn_remove_1353()
{
ta_stay(23,0,7,45,"WP_INTRO01");
ta_stay(7,45,23,0,"WP_INTRO01");
};
|
D
|
/Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/DerivedData/Scrambles/Build/Intermediates/Scrambles.build/Release-iphonesimulator/Scrambles.build/Objects-normal/x86_64/MasterViewController.o : /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/MasterViewController.swift /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
/Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/DerivedData/Scrambles/Build/Intermediates/Scrambles.build/Release-iphonesimulator/Scrambles.build/Objects-normal/x86_64/MasterViewController~partial.swiftmodule : /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/MasterViewController.swift /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
/Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/DerivedData/Scrambles/Build/Intermediates/Scrambles.build/Release-iphonesimulator/Scrambles.build/Objects-normal/x86_64/MasterViewController~partial.swiftdoc : /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/MasterViewController.swift /Users/Mandy_Cho/Documents/getS(ch)wifty/Scrambles/Scrambles/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
|
D
|
module android.java.android.bluetooth.le.ScanCallback_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import0 = android.java.android.bluetooth.le.ScanResult_d_interface;
import import2 = android.java.java.lang.Class_d_interface;
import import1 = android.java.java.util.List_d_interface;
final class ScanCallback : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import this(arsd.jni.Default);
@Import void onScanResult(int, import0.ScanResult);
@Import void onBatchScanResults(import1.List);
@Import void onScanFailed(int);
@Import import2.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/bluetooth/le/ScanCallback;";
}
|
D
|
/**
* Allocate memory using `malloc` or the GC depending on the configuration.
*
* Copyright: Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
* Authors: Walter Bright, http://www.digitalmars.com
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/root/rmem.d, root/_rmem.d)
* Documentation: https://dlang.org/phobos/dmd_root_rmem.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/root/rmem.d
*/
module dmd.root.rmem;
import core.exception : onOutOfMemoryError;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import core.memory : GC;
extern (C++) struct Mem
{
static char* xstrdup(const(char)* s) nothrow
{
if (isGCEnabled)
return s ? s[0 .. strlen(s) + 1].dup.ptr : null;
return s ? cast(char*)check(.strdup(s)) : null;
}
static void xfree(void* p) pure nothrow
{
if (isGCEnabled)
return GC.free(p);
pureFree(p);
}
static void* xmalloc(size_t size) pure nothrow
{
if (isGCEnabled)
return size ? GC.malloc(size) : null;
return size ? check(pureMalloc(size)) : null;
}
static void* xmalloc_noscan(size_t size) pure nothrow
{
if (isGCEnabled)
return size ? GC.malloc(size, GC.BlkAttr.NO_SCAN) : null;
return size ? check(pureMalloc(size)) : null;
}
static void* xcalloc(size_t size, size_t n) pure nothrow
{
if (isGCEnabled)
return size * n ? GC.calloc(size * n) : null;
return (size && n) ? check(pureCalloc(size, n)) : null;
}
static void* xcalloc_noscan(size_t size, size_t n) pure nothrow
{
if (isGCEnabled)
return size * n ? GC.calloc(size * n, GC.BlkAttr.NO_SCAN) : null;
return (size && n) ? check(pureCalloc(size, n)) : null;
}
static void* xrealloc(void* p, size_t size) pure nothrow
{
if (isGCEnabled)
return GC.realloc(p, size);
if (!size)
{
pureFree(p);
return null;
}
return check(pureRealloc(p, size));
}
static void* xrealloc_noscan(void* p, size_t size) pure nothrow
{
if (isGCEnabled)
return GC.realloc(p, size, GC.BlkAttr.NO_SCAN);
if (!size)
{
pureFree(p);
return null;
}
return check(pureRealloc(p, size));
}
static void* error() pure nothrow @nogc
{
onOutOfMemoryError();
assert(0);
}
/**
* Check p for null. If it is, issue out of memory error
* and exit program.
* Params:
* p = pointer to check for null
* Returns:
* p if not null
*/
static void* check(void* p) pure nothrow @nogc
{
return p ? p : error();
}
__gshared bool _isGCEnabled = true;
// fake purity by making global variable immutable (_isGCEnabled only modified before startup)
enum _pIsGCEnabled = cast(immutable bool*) &_isGCEnabled;
static bool isGCEnabled() pure nothrow @nogc @safe
{
return *_pIsGCEnabled;
}
static void disableGC() nothrow @nogc
{
_isGCEnabled = false;
}
static void addRange(const(void)* p, size_t size) nothrow @nogc
{
if (isGCEnabled)
GC.addRange(p, size);
}
static void removeRange(const(void)* p) nothrow @nogc
{
if (isGCEnabled)
GC.removeRange(p);
}
}
extern (C++) const __gshared Mem mem;
enum CHUNK_SIZE = (256 * 4096 - 64);
__gshared size_t heapleft = 0;
__gshared void* heapp;
extern (D) void* allocmemoryNoFree(size_t m_size) nothrow @nogc
{
// 16 byte alignment is better (and sometimes needed) for doubles
m_size = (m_size + 15) & ~15;
// The layout of the code is selected so the most common case is straight through
if (m_size <= heapleft)
{
L1:
heapleft -= m_size;
auto p = heapp;
heapp = cast(void*)(cast(char*)heapp + m_size);
return p;
}
if (m_size > CHUNK_SIZE)
{
return Mem.check(malloc(m_size));
}
heapleft = CHUNK_SIZE;
heapp = Mem.check(malloc(CHUNK_SIZE));
goto L1;
}
extern (D) void* allocmemory(size_t m_size) nothrow
{
if (mem.isGCEnabled)
return GC.malloc(m_size);
return allocmemoryNoFree(m_size);
}
version (DigitalMars)
{
enum OVERRIDE_MEMALLOC = true;
}
else version (LDC)
{
// Memory allocation functions gained weak linkage when the @weak attribute was introduced.
import ldc.attributes;
enum OVERRIDE_MEMALLOC = is(typeof(ldc.attributes.weak));
}
else version (GNU)
{
version (IN_GCC)
enum OVERRIDE_MEMALLOC = false;
else
enum OVERRIDE_MEMALLOC = true;
}
else
{
enum OVERRIDE_MEMALLOC = false;
}
static if (OVERRIDE_MEMALLOC)
{
// Override the host druntime allocation functions in order to use the bump-
// pointer allocation scheme (`allocmemoryNoFree()` above) if the GC is disabled.
// That scheme is faster and comes with less memory overhead than using a
// disabled GC alone.
extern (C) void* _d_allocmemory(size_t m_size) nothrow
{
return allocmemory(m_size);
}
private void* allocClass(const ClassInfo ci) nothrow pure
{
alias BlkAttr = GC.BlkAttr;
assert(!(ci.m_flags & TypeInfo_Class.ClassFlags.isCOMclass));
BlkAttr attr = BlkAttr.NONE;
if (ci.m_flags & TypeInfo_Class.ClassFlags.hasDtor
&& !(ci.m_flags & TypeInfo_Class.ClassFlags.isCPPclass))
attr |= BlkAttr.FINALIZE;
if (ci.m_flags & TypeInfo_Class.ClassFlags.noPointers)
attr |= BlkAttr.NO_SCAN;
return GC.malloc(ci.initializer.length, attr, ci);
}
extern (C) void* _d_newitemU(const TypeInfo ti) nothrow;
extern (C) Object _d_newclass(const ClassInfo ci) nothrow
{
const initializer = ci.initializer;
auto p = mem.isGCEnabled ? allocClass(ci) : allocmemoryNoFree(initializer.length);
memcpy(p, initializer.ptr, initializer.length);
return cast(Object) p;
}
version (LDC)
{
extern (C) Object _d_allocclass(const ClassInfo ci) nothrow
{
if (mem.isGCEnabled)
return cast(Object) allocClass(ci);
return cast(Object) allocmemoryNoFree(ci.initializer.length);
}
}
extern (C) void* _d_newitemT(TypeInfo ti) nothrow
{
auto p = mem.isGCEnabled ? _d_newitemU(ti) : allocmemoryNoFree(ti.tsize);
memset(p, 0, ti.tsize);
return p;
}
extern (C) void* _d_newitemiT(TypeInfo ti) nothrow
{
auto p = mem.isGCEnabled ? _d_newitemU(ti) : allocmemoryNoFree(ti.tsize);
const initializer = ti.initializer;
memcpy(p, initializer.ptr, initializer.length);
return p;
}
// TypeInfo.initializer for compilers older than 2.070
static if(!__traits(hasMember, TypeInfo, "initializer"))
private const(void[]) initializer(T : TypeInfo)(const T t)
nothrow pure @safe @nogc
{
return t.init;
}
}
extern (C) pure @nogc nothrow
{
/**
* Pure variants of C's memory allocation functions `malloc`, `calloc`, and
* `realloc` and deallocation function `free`.
*
* UNIX 98 requires that errno be set to ENOMEM upon failure.
* https://linux.die.net/man/3/malloc
* However, this is irrelevant for DMD's purposes, and best practice
* protocol for using errno is to treat it as an `out` parameter, and not
* something with state that can be relied on across function calls.
* So, we'll ignore it.
*
* See_Also:
* $(LINK2 https://dlang.org/spec/function.html#pure-functions, D's rules for purity),
* which allow for memory allocation under specific circumstances.
*/
pragma(mangle, "malloc") void* pureMalloc(size_t size) @trusted;
/// ditto
pragma(mangle, "calloc") void* pureCalloc(size_t nmemb, size_t size) @trusted;
/// ditto
pragma(mangle, "realloc") void* pureRealloc(void* ptr, size_t size) @system;
/// ditto
pragma(mangle, "free") void pureFree(void* ptr) @system;
}
/**
Makes a null-terminated copy of the given string on newly allocated memory.
The null-terminator won't be part of the returned string slice. It will be
at position `n` where `n` is the length of the input string.
Params:
s = string to copy
Returns: A null-terminated copy of the input array.
*/
extern (D) char[] xarraydup(const(char)[] s) pure nothrow
{
if (!s)
return null;
auto p = cast(char*)mem.xmalloc_noscan(s.length + 1);
char[] a = p[0 .. s.length];
a[] = s[0 .. s.length];
p[s.length] = 0; // preserve 0 terminator semantics
return a;
}
///
pure nothrow unittest
{
auto s1 = "foo";
auto s2 = s1.xarraydup;
s2[0] = 'b';
assert(s1 == "foo");
assert(s2 == "boo");
assert(*(s2.ptr + s2.length) == '\0');
string sEmpty;
assert(sEmpty.xarraydup is null);
}
/**
Makes a copy of the given array on newly allocated memory.
Params:
s = array to copy
Returns: A copy of the input array.
*/
extern (D) T[] arraydup(T)(const scope T[] s) pure nothrow
{
if (!s)
return null;
const dim = s.length;
auto p = (cast(T*)mem.xmalloc(T.sizeof * dim))[0 .. dim];
p[] = s;
return p;
}
///
pure nothrow unittest
{
auto s1 = [0, 1, 2];
auto s2 = s1.arraydup;
s2[0] = 4;
assert(s1 == [0, 1, 2]);
assert(s2 == [4, 1, 2]);
string sEmpty;
assert(sEmpty.arraydup is null);
}
|
D
|
module android.java.android.app.WallpaperManager_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import8 = android.java.android.content.Intent_d_interface;
import import10 = android.java.android.graphics.Bitmap_d_interface;
import import13 = android.java.android.os.IBinder_d_interface;
import import4 = android.java.android.app.WallpaperManager_OnColorsChangedListener_d_interface;
import import9 = android.java.android.net.Uri_d_interface;
import import11 = android.java.android.graphics.Rect_d_interface;
import import5 = android.java.android.os.Handler_d_interface;
import import15 = android.java.java.lang.Class_d_interface;
import import2 = android.java.android.graphics.drawable.Drawable_d_interface;
import import7 = android.java.android.app.WallpaperInfo_d_interface;
import import12 = android.java.java.io.InputStream_d_interface;
import import14 = android.java.android.os.Bundle_d_interface;
import import3 = android.java.android.os.ParcelFileDescriptor_d_interface;
import import0 = android.java.android.app.WallpaperManager_d_interface;
import import6 = android.java.android.app.WallpaperColors_d_interface;
import import1 = android.java.android.content.Context_d_interface;
final class WallpaperManager : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import static import0.WallpaperManager getInstance(import1.Context);
@Import import2.Drawable getDrawable();
@Import import2.Drawable getBuiltInDrawable();
@Import import2.Drawable getBuiltInDrawable(int);
@Import import2.Drawable getBuiltInDrawable(int, int, bool, float, float);
@Import import2.Drawable getBuiltInDrawable(int, int, bool, float, float, int);
@Import import2.Drawable peekDrawable();
@Import import2.Drawable getFastDrawable();
@Import import2.Drawable peekFastDrawable();
@Import import3.ParcelFileDescriptor getWallpaperFile(int);
@Import void addOnColorsChangedListener(import4.WallpaperManager_OnColorsChangedListener, import5.Handler);
@Import void removeOnColorsChangedListener(import4.WallpaperManager_OnColorsChangedListener);
@Import import6.WallpaperColors getWallpaperColors(int);
@Import void forgetLoadedWallpaper();
@Import import7.WallpaperInfo getWallpaperInfo();
@Import int getWallpaperId(int);
@Import import8.Intent getCropAndSetWallpaperIntent(import9.Uri);
@Import void setResource(int);
@Import int setResource(int, int);
@Import void setBitmap(import10.Bitmap);
@Import int setBitmap(import10.Bitmap, import11.Rect, bool);
@Import int setBitmap(import10.Bitmap, import11.Rect, bool, int);
@Import void setStream(import12.InputStream);
@Import int setStream(import12.InputStream, import11.Rect, bool);
@Import int setStream(import12.InputStream, import11.Rect, bool, int);
@Import bool hasResourceWallpaper(int);
@Import int getDesiredMinimumWidth();
@Import int getDesiredMinimumHeight();
@Import void suggestDesiredDimensions(int, int);
@Import void setDisplayPadding(import11.Rect);
@Import void clearWallpaper();
@Import void setWallpaperOffsets(import13.IBinder, float, float);
@Import void setWallpaperOffsetSteps(float, float);
@Import void sendWallpaperCommand(import13.IBinder, string, int, int, int, import14.Bundle);
@Import bool isWallpaperSupported();
@Import bool isSetWallpaperAllowed();
@Import void clearWallpaperOffsets(import13.IBinder);
@Import void clear();
@Import void clear(int);
@Import import15.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/app/WallpaperManager;";
}
|
D
|
module lcda.compat._misc;
import std.stdio;
import std.exception;
import nwn.nwscript;
void SignalBug(NWString sMessage)
{
stderr.writeln("\x1b[1;31mERROR: " ~ sMessage ~ "\x1b[m");
}
void Enforce(NWInt result, NWString msg, NWString file, NWInt line){
if(!result){
SignalBug(file ~ ":" ~ IntToString(line) ~ ": Enforce failed: " ~ msg);
}
}
|
D
|
module UnrealScript.TribesGame.TrPlayerSkin3PData;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Core.UObject;
import UnrealScript.Engine.SkeletalMesh;
extern(C++) interface TrPlayerSkin3PData : UObject
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrPlayerSkin3PData")); }
private static __gshared TrPlayerSkin3PData mDefaultProperties;
@property final static TrPlayerSkin3PData DefaultProperties() { mixin(MGDPC("TrPlayerSkin3PData", "TrPlayerSkin3PData TribesGame.Default__TrPlayerSkin3PData")); }
@property final auto ref
{
int m_nSkinId() { mixin(MGPC("int", 60)); }
SkeletalMesh m_SkeletalMesh3p() { mixin(MGPC("SkeletalMesh", 68)); }
SkeletalMesh m_GibMesh() { mixin(MGPC("SkeletalMesh", 72)); }
int m_nClassId() { mixin(MGPC("int", 64)); }
}
}
|
D
|
module ddebug.gdb.gdbinterface;
public import ddebug.common.debugger;
import ddebug.common.execution;
import dlangui.core.logger;
import ddebug.common.queue;
import dlangide.builders.extprocess;
import ddebug.gdb.gdbmiparser;
import std.utf;
import std.conv : to;
import std.array : empty;
import std.algorithm : startsWith, endsWith, equal;
import core.thread;
abstract class ConsoleDebuggerInterface : DebuggerBase, TextWriter {
protected ExternalProcess _debuggerProcess;
protected ExternalProcessState runDebuggerProcess(string executable, string[]args, string dir) {
_debuggerProcess = new ExternalProcess();
ExternalProcessState state = _debuggerProcess.run(executable, args, dir, this);
return state;
}
private string[] _stdoutLines;
private char[] _stdoutBuf;
/// return true to clear lines list
protected bool onDebuggerStdoutLines(string[] lines) {
foreach(line; lines) {
onDebuggerStdoutLine(line);
}
return true;
}
protected void onDebuggerStdoutLine(string line) {
}
private void onStdoutText(string text) {
_stdoutBuf ~= text;
// pass full lines
int startPos = 0;
bool fullLinesFound = false;
for (int i = 0; i < _stdoutBuf.length; i++) {
if (_stdoutBuf[i] == '\n' || _stdoutBuf[i] == '\r') {
if (i <= startPos)
_stdoutLines ~= "";
else
_stdoutLines ~= _stdoutBuf[startPos .. i].dup;
fullLinesFound = true;
if (i + 1 < _stdoutBuf.length) {
if ((_stdoutBuf[i] == '\n' && _stdoutBuf[i + 1] == '\r')
|| (_stdoutBuf[i] == '\r' && _stdoutBuf[i + 1] == '\n'))
i++;
}
startPos = i + 1;
}
}
if (fullLinesFound) {
for (int i = 0; i + startPos < _stdoutBuf.length; i++)
_stdoutBuf[i] = _stdoutBuf[i + startPos];
_stdoutBuf.length = _stdoutBuf.length - startPos;
if (onDebuggerStdoutLines(_stdoutLines)) {
_stdoutLines.length = 0;
}
}
}
bool sendLine(string text) {
return _debuggerProcess.write(text ~ "\n");
}
/// log lines
override void writeText(dstring text) {
string text8 = toUTF8(text);
postRequest(delegate() {
onStdoutText(text8);
});
}
}
import std.process;
class GDBInterface : ConsoleDebuggerInterface {
protected int commandId;
int sendCommand(string text) {
ExternalProcessState state = _debuggerProcess.poll();
if (state != ExternalProcessState.Running) {
_stopRequested = true;
return 0;
}
commandId++;
string cmd = to!string(commandId) ~ text;
Log.d("GDB command[", commandId, "]> ", text);
sendLine(cmd);
return commandId;
}
Pid terminalPid;
string terminalTty;
string startTerminal() {
Log.d("Starting terminal ", _terminalExecutable);
import std.random;
import std.file;
import std.path;
import std.string;
import core.thread;
uint n = uniform(0, 0x10000000, rndGen());
terminalTty = null;
string termfile = buildPath(tempDir, format("dlangide-term-name-%07x.tmp", n));
Log.d("temp file for tty name: ", termfile);
try {
string[] args = [
_terminalExecutable,
"-title",
"DLangIDE External Console",
"-e",
"echo 'DlangIDE External Console' && tty > " ~ termfile ~ " && sleep 1000000"
];
Log.d("Terminal command line: ", args);
terminalPid = spawnProcess(args);
for (int i = 0; i < 40; i++) {
Thread.sleep(dur!"msecs"(100));
if (!isTerminalActive) {
Log.e("Failed to get terminal TTY");
return null;
}
if (exists(termfile)) {
Thread.sleep(dur!"msecs"(20));
break;
}
}
// read TTY from file
if (exists(termfile)) {
terminalTty = readText(termfile);
if (terminalTty.endsWith("\n"))
terminalTty = terminalTty[0 .. $-1];
// delete file
remove(termfile);
Log.d("Terminal tty: ", terminalTty);
}
} catch (Exception e) {
Log.e("Failed to start terminal ", e);
killTerminal();
}
if (terminalTty.length == 0) {
Log.i("Cannot start terminal");
killTerminal();
} else {
Log.i("Terminal: ", terminalTty);
}
return terminalTty;
}
bool isTerminalActive() {
if (_terminalExecutable.empty)
return true;
if (terminalPid is null)
return false;
auto res = tryWait(terminalPid);
if (res.terminated) {
Log.d("isTerminalActive: Terminal is stopped");
wait(terminalPid);
terminalPid = Pid.init;
return false;
} else {
return true;
}
}
void killTerminal() {
if (_terminalExecutable.empty)
return;
if (terminalPid is null)
return;
try {
Log.d("Trying to kill terminal");
kill(terminalPid, 9);
Log.d("Waiting for terminal process termination");
wait(terminalPid);
terminalPid = Pid.init;
Log.d("Killed");
} catch (Exception e) {
Log.d("Exception while killing terminal", e);
terminalPid = Pid.init;
}
}
override void startDebugging() {
Log.d("GDBInterface.startDebugging()");
string[] debuggerArgs;
if (!_terminalExecutable.empty) {
terminalTty = startTerminal();
if (terminalTty.length == 0) {
//_callback.onResponse(ResponseCode.CannotRunDebugger, "Cannot start terminal");
_status = ExecutionStatus.Error;
_stopRequested = true;
return;
}
debuggerArgs ~= "-tty";
debuggerArgs ~= terminalTty;
}
debuggerArgs ~= "--interpreter=mi";
debuggerArgs ~= "--silent";
debuggerArgs ~= "--args";
debuggerArgs ~= _executableFile;
foreach(arg; _executableArgs)
debuggerArgs ~= arg;
ExternalProcessState state = runDebuggerProcess(_debuggerExecutable, debuggerArgs, _executableWorkingDir);
Log.i("Debugger process state:");
if (state == ExternalProcessState.Running) {
Thread.sleep(dur!"seconds"(1));
_callback.onProgramLoaded(true, true);
//sendCommand("-break-insert main");
} else {
_status = ExecutionStatus.Error;
_stopRequested = true;
return;
}
}
override protected void onDebuggerThreadFinished() {
Log.d("Debugger thread finished");
if (_debuggerProcess !is null) {
Log.d("Killing debugger process");
_debuggerProcess.kill();
Log.d("Waiting for debugger process finishing");
//_debuggerProcess.wait();
}
killTerminal();
Log.d("Sending execution status");
_callback.onProgramExecutionStatus(this, _status, _exitCode);
}
bool _threadJoined = false;
override void stop() {
if (_stopRequested) {
Log.w("GDBInterface.stop() - _stopRequested flag already set");
return;
}
_stopRequested = true;
Log.d("GDBInterface.stop()");
postRequest(delegate() {
Log.d("GDBInterface.stop() processing in queue");
execStop();
});
Thread.sleep(dur!"msecs"(200));
postRequest(delegate() {
});
_queue.close();
if (!_threadJoined) {
_threadJoined = true;
if (_threadStarted) {
try {
join();
} catch (Exception e) {
Log.e("Exception while trying to join debugger thread");
}
}
}
}
/// start program execution, can be called after program is loaded
int _startRequestId;
void execStart() {
_startRequestId = sendCommand("-exec-run");
}
/// start program execution, can be called after program is loaded
int _continueRequestId;
void execContinue() {
_continueRequestId = sendCommand("-exec-continue");
}
/// stop program execution
int _stopRequestId;
void execStop() {
_continueRequestId = sendCommand("-gdb-exit");
}
/// interrupt execution
int _pauseRequestId;
void execPause() {
_pauseRequestId = sendCommand("-exec-interrupt");
}
/// step over
int _stepOverRequestId;
void execStepOver() {
_stepOverRequestId = sendCommand("-exec-next");
}
/// step in
int _stepInRequestId;
void execStepIn() {
_stepInRequestId = sendCommand("-exec-step");
}
/// step out
int _stepOutRequestId;
void execStepOut() {
_stepOutRequestId = sendCommand("-exec-finish");
}
/// restart
int _restartRequestId;
void execRestart() {
//_restartRequestId = sendCommand("-exec-restart");
}
private GDBBreakpoint[] _breakpoints;
private static class GDBBreakpoint {
Breakpoint bp;
string number;
int createRequestId;
}
private GDBBreakpoint findBreakpoint(Breakpoint bp) {
foreach(gdbbp; _breakpoints) {
if (gdbbp.bp.id == bp.id)
return gdbbp;
}
return null;
}
private GDBBreakpoint findBreakpointByRequestToken(int token) {
if (token == 0)
return null;
foreach(gdbbp; _breakpoints) {
if (gdbbp.createRequestId == token)
return gdbbp;
}
return null;
}
private GDBBreakpoint findBreakpointByNumber(string number) {
if (number.empty)
return null;
foreach(gdbbp; _breakpoints) {
if (gdbbp.number.equal(number))
return gdbbp;
}
return null;
}
void handleBreakpointRequestResult(GDBBreakpoint gdbbp, ResultClass resType, MIValue params) {
if (resType == ResultClass.done) {
if (MIValue bkpt = params["bkpt"]) {
string number = bkpt.getString("number");
gdbbp.number = number;
Log.d("GDB number for breakpoint " ~ gdbbp.bp.id.to!string ~ " assigned is " ~ number);
}
}
}
private void addBreakpoint(Breakpoint bp) {
GDBBreakpoint gdbbp = new GDBBreakpoint();
gdbbp.bp = bp;
char[] cmd;
cmd ~= "-break-insert ";
if (!bp.enabled)
cmd ~= "-d "; // create disabled
cmd ~= bp.fullFilePath;
cmd ~= ":";
cmd ~= to!string(bp.line);
gdbbp.createRequestId = sendCommand(cmd.dup);
_breakpoints ~= gdbbp;
}
/// update list of breakpoints
void setBreakpoints(Breakpoint[] breakpoints) {
char[] breakpointsToDelete;
char[] breakpointsToEnable;
char[] breakpointsToDisable;
// checking for removed breakpoints
for (int i = cast(int)_breakpoints.length - 1; i >= 0; i--) {
bool found = false;
foreach(bp; breakpoints)
if (bp.id == _breakpoints[i].bp.id) {
found = true;
break;
}
if (!found) {
for (int j = i; j < _breakpoints.length - 1; j++)
_breakpoints[j] = _breakpoints[j + 1];
_breakpoints.length = _breakpoints.length - 1;
if (breakpointsToDelete.length)
breakpointsToDelete ~= ",";
breakpointsToDelete ~= _breakpoints[i].number;
}
}
// checking for added or updated breakpoints
foreach(bp; breakpoints) {
GDBBreakpoint existing = findBreakpoint(bp);
if (!existing) {
addBreakpoint(bp);
} else {
if (bp.enabled && !existing.bp.enabled) {
if (breakpointsToEnable.length)
breakpointsToEnable ~= ",";
breakpointsToEnable ~= existing.number;
existing.bp.enabled = true;
} else if (!bp.enabled && existing.bp.enabled) {
if (breakpointsToDisable.length)
breakpointsToDisable ~= ",";
breakpointsToDisable ~= existing.number;
existing.bp.enabled = false;
}
}
}
if (breakpointsToDelete.length) {
Log.d("Deleting breakpoints: " ~ breakpointsToDelete);
sendCommand(("-break-delete " ~ breakpointsToDelete).dup);
}
if (breakpointsToEnable.length) {
Log.d("Enabling breakpoints: " ~ breakpointsToEnable);
sendCommand(("-break-enable " ~ breakpointsToEnable).dup);
}
if (breakpointsToDisable.length) {
Log.d("Disabling breakpoints: " ~ breakpointsToDisable);
sendCommand(("-break-disable " ~ breakpointsToDisable).dup);
}
}
// ~message
void handleStreamLineCLI(string s) {
Log.d("GDB CLI: ", s);
if (s.length >= 2 && s.startsWith('\"') && s.endsWith('\"'))
s = parseCString(s);
_callback.onDebuggerMessage(s);
}
// @message
void handleStreamLineProgram(string s) {
Log.d("GDB program stream: ", s);
//_callback.onDebuggerMessage(s);
}
// &message
void handleStreamLineGDBDebug(string s) {
Log.d("GDB internal debug message: ", s);
}
// *stopped,reason="exited-normally"
// *running,thread-id="all"
// *asyncclass,result
void handleExecAsyncMessage(uint token, string s) {
string msgType = parseIdentAndSkipComma(s);
AsyncClass msgId = asyncByName(msgType);
if (msgId == AsyncClass.other)
Log.d("GDB WARN unknown async class type: ", msgType);
MIValue params = parseMI(s);
if (!params) {
Log.e("Failed to parse exec state params");
return;
}
Log.v("GDB async *[", token, "] ", msgType, " params: ", params.toString);
string reason = params.getString("reason");
if (msgId == AsyncClass.running) {
_callback.onDebugState(DebuggingState.running, StateChangeReason.unknown, null, null);
} else if (msgId == AsyncClass.stopped) {
StateChangeReason reasonId = StateChangeReason.unknown;
DebugFrame location = parseFrame(params["frame"]);
string threadId = params.getString("thread-id");
string stoppedThreads = params.getString("all");
Breakpoint bp = null;
if (reason.equal("end-stepping-range")) {
updateState();
_callback.onDebugState(DebuggingState.paused, StateChangeReason.endSteppingRange, location, bp);
} else if (reason.equal("breakpoint-hit")) {
if (GDBBreakpoint gdbbp = findBreakpointByNumber(params.getString("bkptno"))) {
bp = gdbbp.bp;
if (!location && bp) {
location = new DebugFrame();
location.fillMissingFields(bp);
}
}
updateState();
_callback.onDebugState(DebuggingState.paused, StateChangeReason.breakpointHit, location, bp);
} else {
_callback.onDebugState(DebuggingState.stopped, StateChangeReason.exited, null, null);
}
}
}
int _threadInfoRequest;
int _stackListFramesRequest;
int _stackListLocalsRequest;
DebugThreadList _currentState;
void updateState() {
_currentState = null;
_threadInfoRequest = sendCommand("-thread-info");
_stackListFramesRequest = sendCommand("-stack-list-frames");
}
// +asyncclass,result
void handleStatusAsyncMessage(uint token, string s) {
string msgType = parseIdentAndSkipComma(s);
AsyncClass msgId = asyncByName(msgType);
if (msgId == AsyncClass.other)
Log.d("GDB WARN unknown async class type: ", msgType);
Log.v("GDB async +[", token, "] ", msgType, " params: ", s);
}
// =asyncclass,result
void handleNotifyAsyncMessage(uint token, string s) {
string msgType = parseIdentAndSkipComma(s);
AsyncClass msgId = asyncByName(msgType);
if (msgId == AsyncClass.other)
Log.d("GDB WARN unknown async class type: ", msgType);
Log.v("GDB async =[", token, "] ", msgType, " params: ", s);
}
// ^resultClass,result
void handleResultMessage(uint token, string s) {
Log.v("GDB result ^[", token, "] ", s);
string msgType = parseIdentAndSkipComma(s);
ResultClass msgId = resultByName(msgType);
if (msgId == ResultClass.other)
Log.d("GDB WARN unknown result class type: ", msgType);
MIValue params = parseMI(s);
Log.v("GDB result ^[", token, "] ", msgType, " params: ", (params ? params.toString : "unparsed: " ~ s));
if (GDBBreakpoint gdbbp = findBreakpointByRequestToken(token)) {
// result of breakpoint creation operation
handleBreakpointRequestResult(gdbbp, msgId, params);
return;
} else if (token == _threadInfoRequest) {
handleThreadInfoRequestResult(msgId, params);
} else if (token == _stackListFramesRequest) {
handleStackListFramesRequest(msgId, params);
} else if (token == _stackListLocalsRequest) {
handleLocalVariableListRequestResult(msgId, params);
}
}
void handleStackListFramesRequest(ResultClass msgId, MIValue params) {
if (msgId == ResultClass.done) {
DebugStack stack = parseStack(params);
if (stack) {
// TODO
Log.d("Stack frames list is parsed: " ~ to!string(stack));
if (_currentState) {
if (DebugThread currentThread = _currentState.currentThread) {
currentThread.stack = stack;
Log.d("Setting stack frames for current thread");
}
}
}
} else {
}
}
void handleThreadInfoRequestResult(ResultClass msgId, MIValue params) {
if (msgId == ResultClass.done) {
_currentState = parseThreadList(params);
if (_currentState) {
// TODO
Log.d("Thread list is parsed");
_stackListLocalsRequest = sendCommand("-stack-list-locals --thread " ~ to!string(_currentState.currentThreadId) ~ " --frame 0 --all-values");
}
} else {
}
}
void handleLocalVariableListRequestResult(ResultClass msgId, MIValue params) {
if (msgId == ResultClass.done) {
DebugVariableList variables = parseVariableList(params);
if (variables) {
// TODO
Log.d("Variable list is parsed: " ~ to!string(variables));
if (_currentState) {
if (DebugThread currentThread = _currentState.currentThread) {
if (currentThread.stack.length > 0) {
currentThread.stack[0].locals = variables;
Log.d("Setting variables for current thread top frame");
}
}
}
}
} else {
}
}
bool _firstIdle = true;
// (gdb)
void onDebuggerIdle() {
Log.d("GDB idle");
if (_firstIdle) {
_firstIdle = false;
return;
}
}
override protected void onDebuggerStdoutLine(string gdbLine) {
//Log.d("GDB stdout: '", line, "'");
string line = gdbLine;
if (line.empty)
return;
// parse token (sequence of digits at the beginning of message)
uint tokenId = 0;
int tokenLen = 0;
while (tokenLen < line.length && line[tokenLen] >= '0' && line[tokenLen] <= '9')
tokenLen++;
if (tokenLen > 0) {
tokenId = to!uint(line[0..tokenLen]);
line = line[tokenLen .. $];
}
if (line.length == 0)
return; // token only, no message!
char firstChar = line[0];
string restLine = line.length > 1 ? line[1..$] : "";
if (firstChar == '~') {
handleStreamLineCLI(restLine);
return;
} else if (firstChar == '@') {
handleStreamLineProgram(restLine);
return;
} else if (firstChar == '&') {
handleStreamLineGDBDebug(restLine);
return;
} else if (firstChar == '*') {
handleExecAsyncMessage(tokenId, restLine);
return;
} else if (firstChar == '+') {
handleStatusAsyncMessage(tokenId, restLine);
return;
} else if (firstChar == '=') {
handleNotifyAsyncMessage(tokenId, restLine);
return;
} else if (firstChar == '^') {
handleResultMessage(tokenId, restLine);
return;
} else if (line.startsWith("(gdb)")) {
onDebuggerIdle();
return;
} else {
Log.d("GDB unprocessed: ", gdbLine);
}
}
}
|
D
|
import std.stdio;
import dsfml.graphics;
import dsfml.system;
void main()
{
RenderWindow window = new RenderWindow(VideoMode(800, 600), "DSFML!");
while (window.isOpen()) {
Event event;
while (window.pollEvent(event)) {
if (event.type == Event.EventType.Closed) {
window.close();
}
}
window.clear(Color(255, 255, 0));
window.display();
}
}
|
D
|
[Service]
ExecStart=/usr/bin/node /root/bone/javascripts/mixpanel-ddc/index.js
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=ddc-mcp-serv
User=root
Group=root
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
|
D
|
module zua.compiler.sourcemap;
import std.typecons;
alias SourceIndices = Tuple!(size_t, "start", size_t, "end");
/** An object that maps a bytecode index onto source indices */
final class SourceMap {
private Tuple!(SourceIndices, size_t)[] data;
private size_t ip;
/** Write to source map */
void write(size_t start, size_t end, size_t repeat) {
SourceIndices i = tuple(start, end);
if (data.length > 0 && data[$ - 1][0] == i) {
data[$ - 1][1] += repeat;
}
else {
data ~= tuple(i, repeat);
}
ip += repeat;
}
/** Resolve a bytecode index */
SourceIndices resolve(size_t index) {
size_t at;
foreach (v; data) {
if (index >= at && index < at + v[1])
return v[0];
at += v[1];
}
return SourceIndices(0, 0);
}
}
|
D
|
/Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/JSON.build/JSONRepresentable.swift.o : /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONContext.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Fuzzy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/JSON.build/JSONRepresentable~partial.swiftmodule : /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONContext.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Fuzzy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/JSON.build/JSONRepresentable~partial.swiftdoc : /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONRepresentable.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/Sequence+Convertible.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Parse.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Serialize.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Bytes.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSONContext.swift /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/checkouts/json.git-9153249592855998091/Sources/JSON/JSON+Fuzzy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Documents/VaporProject/HerokuChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/*#D*/
// Copyright © 2013-2016, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volt.lowerer.llvmlowerer;
import watt.conv : toString;
import watt.text.format : format;
import watt.text.sink;
import watt.io.file : read, exists;
import ir = volta.ir;
import volta.util.copy;
import volta.util.util;
import volt.errors;
import volt.interfaces;
import volta.ir.location;
import volta.visitor.visitor;
import volta.visitor.scopemanager;
import volt.visitor.nodereplace;
import volt.lowerer.array;
import volt.semantic.util;
import volt.semantic.typer;
import volt.semantic.mangle;
import volt.semantic.lookup;
import volt.semantic.nested;
import volt.semantic.classify;
import volt.semantic.classresolver;
import volt.semantic.evaluate;
import volt.semantic.overload;
/*!
* Next stop, backend! The LlvmLowerer visitor (and supporting functions) have a fairly
* simple job to describe -- change any structure that the backend doesn't handle into
* something composed of things the backend DOES know how to deal with. This can involve
* turning keywords into function calls into the runtime, changing foreach statements
* to for statements, and so on.
*/
/*!
* Build a function call that inserts a value with a given key into a given AA, and
* add it to a StatementExp.
*
* Params:
* loc: Nodes created in this function will be given this location.
* lp: The LanguagePass.
* thisModule: The module that the call will be living in.
* current: The scope at the point of call.
* statExp: The StatementExp to add the call to.
* aa: The type of the that we're inserting into.
* var: The Variable containing the instance of the AA being inserted in to.
* key: The key to associate the value with.
* value: The value we are inserting.
* buildif: Generate code to initialise the AA if it's needed.
* aaIsPointer: Is the AA being held as a pointer?
*/
void lowerAAInsert(ref in Location loc, LanguagePass lp, ir.Module thisModule, ir.Scope current,
ir.StatementExp statExp, ir.AAType aa, ir.Variable var, ir.Exp key, ir.Exp value,
LlvmLowerer lowerer, bool buildif=true, bool aaIsPointer=true) {
auto aaNewFn = lp.aaNew;
ir.Function aaInsertFn;
if (aa.key.nodeType == ir.NodeType.PrimitiveType) {
aaInsertFn = lp.aaInsertPrimitive;
} else if (aa.key.nodeType == ir.NodeType.ArrayType) {
aaInsertFn = lp.aaInsertArray;
} else {
aaInsertFn = lp.aaInsertPtr;
}
ir.Exp varExp;
if (buildif) {
auto thenState = buildBlockStat(/*#ref*/loc, statExp, current);
varExp = buildExpReference(/*#ref*/loc, var, var.name);
ir.Exp[] args = [ cast(ir.Exp)buildTypeidSmart(/*#ref*/loc, lp.tiTypeInfo, aa.value),
cast(ir.Exp)buildTypeidSmart(/*#ref*/loc, lp.tiTypeInfo, aa.key)
];
buildExpStat(/*#ref*/loc, thenState,
buildAssign(/*#ref*/loc,
aaIsPointer ? buildDeref(/*#ref*/loc, varExp) : varExp,
buildCall(/*#ref*/loc, aaNewFn, args, aaNewFn.name
)
)
);
varExp = buildExpReference(/*#ref*/loc, var, var.name);
buildIfStat(/*#ref*/loc, statExp,
buildBinOp(/*#ref*/loc, ir.BinOp.Op.Is,
aaIsPointer ? buildDeref(/*#ref*/loc, varExp) : varExp,
buildConstantNull(/*#ref*/loc, buildVoidPtr(/*#ref*/loc))
),
thenState
);
}
varExp = buildExpReference(/*#ref*/loc, var, var.name);
auto call = buildExpStat(/*#ref*/loc, statExp,
buildCall(/*#ref*/loc, aaInsertFn, [
aaIsPointer ? buildDeref(/*#ref*/loc, varExp) : varExp,
lowerAAKeyCast(/*#ref*/loc, lp, thisModule, current, key, aa, lowerer),
buildCastToVoidPtr(/*#ref*/loc, buildAddrOf(value))
], aaInsertFn.name)
);
}
/*!
* Build code to lookup a key in an AA and add it to a StatementExp.
*
* Params:
* loc: Any Nodes created will be given this Location.
* lp: The LanguagePass.
* thisModule: The Module that the lookup will take place in.
* current: The Scope at the time of the lookup.
* statExp: The StatementExp to add the lookup to.
* aa: The type of the AA that we're performing a lookup on.
* var: The Variable that holds the AA.
* key: The key to lookup in the AA.
* store: A reference to a Variable of AA.value type, to hold the result of the lookup.
*/
void lowerAALookup(ref in Location loc, LanguagePass lp, ir.Module thisModule, ir.Scope current,
ir.StatementExp statExp, ir.AAType aa, ir.Variable var, ir.Exp key, ir.Exp store,
LlvmLowerer lowerer) {
ir.Function inAAFn;
if (aa.key.nodeType == ir.NodeType.PrimitiveType) {
inAAFn = lp.aaInPrimitive;
} else if (aa.key.nodeType == ir.NodeType.ArrayType) {
inAAFn = lp.aaInArray;
} else {
inAAFn = lp.aaInPtr;
}
auto thenState = buildBlockStat(/*#ref*/loc, statExp, current);
ir.Exp locstr = buildConstantStringNoEscape(/*#ref*/loc, format("%s:%s", loc.filename, loc.line));
buildExpStat(/*#ref*/loc, thenState, buildCall(/*#ref*/loc, lp.ehThrowKeyNotFoundErrorFunc, [locstr]));
buildIfStat(/*#ref*/loc, statExp,
buildBinOp(/*#ref*/loc, ir.BinOp.Op.Equal,
buildCall(/*#ref*/loc, inAAFn, [
buildDeref(/*#ref*/loc, var),
lowerAAKeyCast(/*#ref*/loc, lp, thisModule, current, key, aa, lowerer),
buildCastToVoidPtr(/*#ref*/loc,
buildAddrOf(/*#ref*/loc, store)
)
], inAAFn.name),
buildConstantBool(/*#ref*/loc, false)
),
thenState
);
}
/*!
* Given an AA key, cast in such a way that it could be given to a runtime AA function.
*
* Params:
* loc: Any Nodes created will be given this location.
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* current: The Scope where this code takes place.
* key: An expression holding the key in its normal form.
* aa: The AA type that the key belongs to.
*
* Returns: An expression casting the key.
*/
ir.Exp lowerAAKeyCast(ref in Location loc, LanguagePass lp, ir.Module thisModule,
ir.Scope current, ir.Exp key, ir.AAType aa, LlvmLowerer lowerer)
{
return lowerAACast(/*#ref*/loc, lp, thisModule, current, key, aa.key, lowerer);
}
ir.Exp lowerAAValueCast(ref in Location loc, LanguagePass lp, ir.Module thisModule,
ir.Scope current, ir.Exp key, ir.AAType aa, LlvmLowerer lowerer)
{
return lowerAACast(/*#ref*/loc, lp, thisModule, current, key, aa.value, lowerer);
}
ir.Exp lowerAACast(ref in Location loc, LanguagePass lp, ir.Module thisModule,
ir.Scope current, ir.Exp key, ir.Type t, LlvmLowerer lowerer)
{
if (t.nodeType == ir.NodeType.PrimitiveType) {
auto prim = cast(ir.PrimitiveType)t;
assert(prim.type != ir.PrimitiveType.Kind.Real);
if (prim.type == ir.PrimitiveType.Kind.Float ||
prim.type == ir.PrimitiveType.Kind.Double) {
auto type = prim.type == ir.PrimitiveType.Kind.Double ?
buildUlong(/*#ref*/loc) : buildInt(/*#ref*/loc);
key = buildCastSmart(/*#ref*/loc, type, key);
}
key = buildCastSmart(/*#ref*/loc, buildUlong(/*#ref*/loc), key);
} else {
key = lowerStructOrArrayAACast(/*#ref*/loc, lp, thisModule, current, key, t, lowerer);
}
return key;
}
ir.Exp lowerAggregateAACast(ref in Location loc, LanguagePass lp, ir.Module thisModule,
ir.Scope current, ir.Exp key, ir.Aggregate st)
{
auto sexp = buildStatementExp(/*#ref*/loc);
// aggptr := new Aggregate;
auto aggptr = buildVariableSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, st), ir.Variable.Storage.Function, "aggptr");
aggptr.assign = buildNewSmart(/*#ref*/loc, st);
sexp.statements ~= aggptr;
// *aggptr = st;
auto deref = buildDeref(/*#ref*/loc, buildExpReference(/*#ref*/loc, aggptr, aggptr.name));
auto assign = buildAssign(/*#ref*/loc, deref, key);
buildExpStat(/*#ref*/loc, sexp, assign);
// return aggptr;
sexp.exp = buildExpReference(/*#ref*/loc, aggptr, aggptr.name);
return buildCastToVoidPtr(/*#ref*/loc, sexp);
}
/*!
* Given an AA key that is a struct or an array,
* cast it in such a way that it could be given to a runtime AA function.
*
* Params:
* loc: Any Nodes created will be given this location.
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* current: The Scope where this code takes place.
* key: An expression holding the key/value in its normal form.
* t: The type of the key or value
*/
ir.Exp lowerStructOrArrayAACast(ref in Location loc, LanguagePass lp, ir.Module thisModule,
ir.Scope current, ir.Exp key, ir.Type t, LlvmLowerer lowerer)
{
if (t.nodeType != ir.NodeType.ArrayType) {
auto st = cast(ir.Aggregate)realType(t);
panicAssert(key, st !is null);
return lowerAggregateAACast(/*#ref*/loc, lp, thisModule, current, key, st);
}
// Duplicate the array.
auto beginning = buildConstantSizeT(/*#ref*/loc, lp.target, 0);
ir.Exp end = buildArrayLength(/*#ref*/loc, lp.target, copyExp(key));
ir.Exp dup = buildArrayDup(/*#ref*/loc, t, [copyExp(key), beginning, end]);
// Cast the duplicate to void[].
ir.Exp cexp = buildCastSmart(/*#ref*/loc, buildArrayType(/*#ref*/loc, buildVoid(/*#ref*/loc)), dup);
acceptExp(/*#ref*/cexp, lowerer);
return cexp;
}
/*!
* Turn a PropertyExp into a call or member call as appropriate.
*
* Params:
* lp: The LanguagePass.
* exp: The expression to write the new call to.
* prop: The PropertyExp to lower.
*/
void lowerProperty(LanguagePass lp, ref ir.Exp exp, ir.PropertyExp prop)
{
assert (prop.getFn !is null);
auto name = prop.identifier.value;
auto expRef = buildExpReference(/*#ref*/prop.loc, prop.getFn, name);
if (prop.child is null) {
exp = buildCall(/*#ref*/prop.loc, expRef, null);
} else {
exp = buildMemberCall(/*#ref*/prop.loc,
prop.child,
expRef, name, null);
}
}
//! Lower a composable string, either at compile time, or calling formatting functions with a sink.
void lowerComposableString(LanguagePass lp, ir.Scope current, ir.Function func, ref ir.Exp exp,
ir.ComposableString cs, LlvmLowerer lowerer)
{
// `new "blah ${...} blah"`
auto loc = cs.loc;
auto sexp = buildStatementExp(/*#ref*/loc);
if (func.composableSinkVariable is null) {
func.composableSinkVariable = buildVariableAnonSmartAtTop(lp.errSink, /*#ref*/loc,
func.parsedBody, lp.sinkStore, null);
}
auto sinkStoreVar = func.composableSinkVariable;
auto sinkVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, lp.sinkType,
buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.sinkInit, lp.sinkInit.name), [
cast(ir.Exp)buildExpReference(/*#ref*/loc, sinkStoreVar, sinkStoreVar.name)]));
StringSink constantSink;
foreach (component; cs.components) {
auto c = component.toConstantChecked();
if (c !is null && c._string.length > 0) {
// A constant component, like the string literal portions.
addConstantComposableStringComponent(lp.target, constantSink.sink, c);
} else {
// Empty the constant sink, and place that into the sink proper.
string str = constantSink.toString();
if (str.length > 0) {
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, str), sexp, sinkVar);
}
constantSink.reset();
// ...and then route the runtime expression to the right place.
void simpleAdd(ir.Node n)
{
auto exp = cast(ir.Exp)n;
if (exp !is null) {
buildExpStat(/*#ref*/loc, sexp, exp);
} else {
sexp.statements ~= n;
}
}
version (D_Version2) {
auto dgt = &simpleAdd;
} else {
auto dgt = simpleAdd;
}
auto rtype = realType(getExpType(component), false);
bool _string = isString(rtype);
bool _char = isChar(rtype);
if (_string) {
/* We treat top level strings differently to strings in arrays etc. (no " at top level)
* Special casing it here seems the simplest solution.
*/
lowerComposableStringStringComponent(component, sexp, sinkVar, dgt);
} else if (_char) {
/* Same deal as the strings. */
auto outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatDchar, lp.formatDchar.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
buildCast(/*#ref*/loc, buildDchar(/*#ref*/loc), copyExp(component))]);
dgt(outExp);
} else {
lowerComposableStringComponent(lp, current, component, sexp, sinkVar, dgt, lowerer);
}
}
}
// Empty the constant sink before finishing up.
string str = constantSink.toString();
if (str.length > 0) {
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, str), sexp, sinkVar);
}
sexp.exp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.sinkGetStr, lp.sinkGetStr.name), [
cast(ir.Exp)buildExpReference(/*#ref*/loc, sinkStoreVar, sinkStoreVar.name)]);
exp = sexp;
}
//! Used by the composable string lowering code.
alias NodeConsumer = void delegate(ir.Node);
//! Dispatch a composable string component to the right function.
void lowerComposableStringComponent(LanguagePass lp, ir.Scope current,
ir.Exp e, ir.StatementExp sexp, ir.Variable sinkVar, NodeConsumer dgt, LlvmLowerer lowerer)
{
auto type = realType(getExpType(e), /*stripEnum*/false);
if (e.nodeType == ir.NodeType.Constant) {
auto c = e.toConstantFast();
if (c.fromEnum !is null) {
type = c.fromEnum;
}
}
switch (type.nodeType) {
case ir.NodeType.Enum:
lowerComposableStringEnumComponent(lp, current, type.toEnumFast(), e, sexp, sinkVar, dgt);
return;
case ir.NodeType.PointerType:
lowerComposableStringPointerComponent(lp, e, sexp, sinkVar, dgt);
break;
case ir.NodeType.ArrayType:
if (isString(type)) {
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/e.loc, "\""), sexp, sinkVar, dgt);
lowerComposableStringStringComponent(e, sexp, sinkVar, dgt);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/e.loc, "\""), sexp, sinkVar, dgt);
return;
}
lowerComposableStringArrayComponent(lp, current, e, sexp, sinkVar, dgt, lowerer);
break;
case ir.NodeType.AAType:
auto aatype = type.toAATypeFast();
lowerComposableStringAAComponent(lp, current, e, aatype, sexp, sinkVar, dgt, lowerer);
break;
case ir.NodeType.PrimitiveType:
auto pt = type.toPrimitiveTypeFast();
lowerComposableStringPrimitiveComponent(lp, current, e, pt, sexp, sinkVar, dgt);
break;
case ir.NodeType.Union:
case ir.NodeType.Struct:
case ir.NodeType.Class:
auto agg = cast(ir.Aggregate)type;
auto store = lookupInGivenScopeOnly(lp, agg.myScope, /*#ref*/e.loc, "toString");
ir.Function[] functions;
if (store !is null && store.functions.length > 0) {
ir.Type[] args;
auto toStrFn = selectFunction(lp.target, store.functions, args, /*#ref*/e.loc, DoNotThrow);
if (toStrFn !is null && isString(toStrFn.type.ret)) {
ir.Postfix _call = buildMemberCall(/*#ref*/e.loc, copyExp(e), buildExpReference(/*#ref*/e.loc, toStrFn), "toString", null);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/e.loc, current, sexp, buildString(/*#ref*/e.loc), _call);
lowerComposableStringStringComponent(buildExpReference(/*#ref*/e.loc, var, var.name), sexp, sinkVar, dgt);
break;
}
}
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/e.loc, agg.name), sexp, sinkVar, dgt);
break;
default:
assert(false); // Should be caught in extyper.
}
}
//! Lower a primitive type component of a composable string.
void lowerComposableStringPrimitiveComponent(LanguagePass lp, ir.Scope current, ir.Exp e,
ir.PrimitiveType pt, ir.StatementExp sexp, ir.Variable sinkVar, NodeConsumer dgt)
{
auto loc = e.loc;
ir.Exp outExp;
final switch (pt.type) with (ir.PrimitiveType.Kind) {
case Bool:
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
[cast(ir.Exp)buildTernary(/*#ref*/loc, copyExp(e), buildConstantStringNoEscape(/*#ref*/loc, "true"),
buildConstantStringNoEscape(/*#ref*/loc, "false"))]);
break;
case Char:
case Wchar:
case Dchar:
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/e.loc, "'"), sexp, sinkVar, dgt);
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatDchar, lp.formatDchar.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
buildCast(/*#ref*/loc, buildDchar(/*#ref*/loc), copyExp(e))]);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/e.loc, "'"), sexp, sinkVar, dgt);
break;
case Ubyte:
case Ushort:
case Uint:
case Ulong:
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatU64, lp.formatU64.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
buildCast(/*#ref*/loc, buildUlong(/*#ref*/loc), copyExp(e))]);
break;
case Byte:
case Short:
case Int:
case Long:
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatI64, lp.formatI64.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
buildCast(/*#ref*/loc, buildLong(/*#ref*/loc), copyExp(e))]);
break;
case Float:
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatF32, lp.formatF32.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
copyExp(e), buildConstantInt(/*#ref*/loc, -1)]);
break;
case Double:
outExp = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatF64, lp.formatF64.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
copyExp(e), buildConstantInt(/*#ref*/loc, -1)]);
break;
case Real:
assert(false);
case ir.PrimitiveType.Kind.Invalid:
case Void:
assert(false);
}
dgt(outExp);
}
//! Lower an associative array component of a composable string.
void lowerComposableStringAAComponent(LanguagePass lp, ir.Scope current, ir.Exp e,
ir.AAType aatype, ir.StatementExp sexp, ir.Variable sinkVar, NodeConsumer dgt,
LlvmLowerer lowerer)
{
auto loc = e.loc;
ir.Variable aaVariable;
auto type = getExpType(e);
aaVariable = buildVariable(/*#ref*/loc, copyType(type), ir.Variable.Storage.Function, current.genAnonIdent(), copyExp(e));
aaVariable.mangledName = aaVariable.type.mangledName = mangle(type);
dgt(aaVariable);
ir.ExpReference aaref()
{
return buildExpReference(/*#ref*/loc, aaVariable, aaVariable.name);
}
ir.Exp keys()
{
auto _keys = buildAAKeys(/*#ref*/e.loc, aatype, [aaref()]);
ir.Exp kexp = _keys;
lowerBuiltin(lp, current, /*#ref*/kexp, _keys, lowerer);
return kexp;
}
ir.Exp values()
{
auto _values = buildAAValues(/*#ref*/e.loc, aatype, [aaref()]);
ir.Exp vexp = _values;
lowerBuiltin(lp, current,/*#ref*/ vexp, _values, lowerer);
return vexp;
}
ir.Exp length()
{
auto _length = buildAALength(/*#ref*/e.loc, lp.target, [aaref()]);
ir.Exp lexp = _length;
lowerBuiltin(lp, current, /*#ref*/lexp, _length, lowerer);
return lexp;
}
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, "["), sexp, sinkVar, dgt);
ir.ForStatement fs;
ir.Variable ivar;
buildForStatement(/*#ref*/e.loc, lp.target, current, length(), /*#out*/fs, /*#out*/ivar);
void addToForStatement(ir.Node n)
{
auto exp = cast(ir.Exp)n;
if (exp !is null) {
n = buildExpStat(/*#ref*/e.loc, exp);
}
fs.block.statements ~= n;
}
ir.Node gottenNode;
void getNode(ir.Node n)
{
gottenNode = n;
}
version (D_Version2) {
auto forDgt = &addToForStatement;
auto getDgt = &getNode;
} else {
auto forDgt = addToForStatement;
auto getDgt = getNode;
}
lowerComposableStringComponent(lp, current, buildIndex(/*#ref*/e.loc, keys(),
buildExpReference(/*#ref*/ivar.loc, ivar, ivar.name)),
sexp, sinkVar, forDgt, lowerer);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, ":"), sexp, sinkVar, forDgt);
lowerComposableStringComponent(lp, current, buildIndex(/*#ref*/e.loc, values(),
buildExpReference(/*#ref*/ivar.loc, ivar, ivar.name)),
sexp, sinkVar, forDgt, lowerer);
auto lengthSub1 = buildSub(/*#ref*/loc, length(), buildConstantSizeT(/*#ref*/loc, lp.target, 1));
auto cmp = buildBinOp(/*#ref*/loc, ir.BinOp.Op.Less, buildExpReference(/*#ref*/loc, ivar, ivar.name), lengthSub1);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, ", "), sexp, sinkVar, getDgt);
auto bs = buildBlockStat(/*#ref*/loc, null, fs.block.myScope, buildExpStat(/*#ref*/e.loc, cast(ir.Exp)gottenNode));
auto ifs = buildIfStat(/*#ref*/loc, cmp, bs);
forDgt(ifs);
dgt(fs);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, "]"), sexp, sinkVar, dgt);
}
//! Lower an array component of a composable string.
void lowerComposableStringArrayComponent(LanguagePass lp, ir.Scope current, ir.Exp e,
ir.StatementExp sexp, ir.Variable sinkVar, NodeConsumer dgt, LlvmLowerer lowerer)
{
auto loc = e.loc;
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, "["), sexp, sinkVar, dgt);
ir.Variable arrayVariable;
auto type = getExpType(e);
arrayVariable = buildVariable(/*#ref*/loc, copyType(type), ir.Variable.Storage.Function, current.genAnonIdent(), copyExp(e));
arrayVariable.mangledName = arrayVariable.type.mangledName = mangle(type);
dgt(arrayVariable);
ir.ExpReference aref()
{
return buildExpReference(/*#ref*/loc, arrayVariable, arrayVariable.name);
}
ir.ForStatement fs;
ir.Variable ivar;
buildForStatement(/*#ref*/e.loc, lp.target, current, buildArrayLength(/*#ref*/loc, lp.target, aref()), /*#out*/fs, /*#out*/ivar);
void addToForStatement(ir.Node n)
{
auto exp = cast(ir.Exp)n;
if (exp !is null) {
n = buildExpStat(/*#ref*/e.loc, exp);
}
fs.block.statements ~= n;
}
ir.Node gottenNode;
void getNode(ir.Node n)
{
gottenNode = n;
}
version (D_Version2) {
auto forDgt = &addToForStatement;
auto getDgt = &getNode;
} else {
auto forDgt = addToForStatement;
auto getDgt = getNode;
}
lowerComposableStringComponent(lp, current, buildIndex(/*#ref*/e.loc, aref(),
buildExpReference(/*#ref*/ivar.loc, ivar, ivar.name)),
sexp, sinkVar, forDgt, lowerer);
auto lengthSub1 = buildSub(/*#ref*/loc, buildArrayLength(/*#ref*/loc, lp.target, aref()), buildConstantSizeT(/*#ref*/loc, lp.target, 1));
auto cmp = buildBinOp(/*#ref*/loc, ir.BinOp.Op.Less, buildExpReference(/*#ref*/loc, ivar, ivar.name), lengthSub1);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, ", "), sexp, sinkVar, getDgt);
auto bs = buildBlockStat(/*#ref*/loc, null, fs.block.myScope, buildExpStat(/*#ref*/e.loc, cast(ir.Exp)gottenNode));
auto ifs = buildIfStat(/*#ref*/loc, cmp, bs);
forDgt(ifs);
dgt(fs);
lowerComposableStringStringComponent(buildConstantStringNoEscape(/*#ref*/loc, "]"), sexp, sinkVar, dgt);
}
//! Lower a pointer component of a composable string.
void lowerComposableStringPointerComponent(LanguagePass lp, ir.Exp e, ir.StatementExp sexp, ir.Variable sinkVar,
NodeConsumer dgt)
{
auto loc = e.loc;
auto call = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, lp.formatHex, lp.formatHex.name), [
buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name),
buildCast(/*#ref*/loc, buildUlong(/*#ref*/loc), copyExp(e)),
buildConstantSizeT(/*#ref*/loc, lp.target, lp.target.isP64 ? 16 : 8)]);
dgt(call);
}
//! Lower an enum component of a composable string.
void lowerComposableStringEnumComponent(LanguagePass lp, ir.Scope current, ir.Enum _enum, ir.Exp e,
ir.StatementExp sexp, ir.Variable sinkVar, NodeConsumer dgt)
{
if (_enum.toSink is null) {
_enum.toSink = generateToSink(/*#ref*/e.loc, lp, current, _enum);
}
auto loc = e.loc;
auto call = buildCall(/*#ref*/loc, buildExpReference(/*#ref*/loc, _enum.toSink, _enum.toSink.name), [
copyExp(e), buildExpReference(/*#ref*/loc, sinkVar, sinkVar.name)]);
dgt(call);
}
/*!
* Generate the function that fills in the `toSink` field on an `Enum`.
*
* Used by the composable string code to turn `"${SomeEnum.Member}"` into `"Member"`.
*/
ir.Function generateToSink(ref in Location loc, LanguagePass lp, ir.Scope current, ir.Enum _enum)
{
/* ```volt
* fn toSink(e: EnumName, sink: Sink) {
* // This switch is generated by a builtin in the backend.
* switch (e) {
* case EnumName.MemberZero: sink("MemberZero"); break;
* default: assert(false);
* }
* }
* ```
*/
auto mod = getModuleFromScope(/*#ref*/loc, current);
auto ftype = buildFunctionTypeSmart(/*#ref*/loc, buildVoid(/*#ref*/loc));
auto func = buildFunction(lp.errSink, /*#ref*/loc, mod.children, mod.myScope, "__toSink" ~ _enum.mangledName);
auto enumParam = addParamSmart(lp.errSink, /*#ref*/loc, func, _enum, "e");
auto sinkParam = addParamSmart(lp.errSink, /*#ref*/loc, func, lp.sinkType, "sink");
auto em = buildEnumMembers(/*#ref*/loc, _enum,
buildExpReference(/*#ref*/loc, enumParam, enumParam.name), buildExpReference(/*#ref*/loc, sinkParam, sinkParam.name));
em.functions ~= lp.ehThrowAssertErrorFunc;
func.parsedBody.statements ~= buildExpStat(/*#ref*/loc, em);
buildReturnStat(/*#ref*/loc, func.parsedBody);
return func;
}
//! Lower a string component of a composable string.
void lowerComposableStringStringComponent(ir.Exp e, ir.StatementExp sexp, ir.Variable sinkVar)
{
auto l = e.loc;
auto call = buildCall(/*#ref*/l, buildExpReference(/*#ref*/l, sinkVar, sinkVar.name), [copyExp(e)]);
buildExpStat(/*#ref*/l, sexp, call);
}
//! Lower a string component of a composable string.
void lowerComposableStringStringComponent(ir.Exp e, ir.StatementExp sexp, ir.Variable sinkVar,
NodeConsumer dgt)
{
auto l = e.loc;
auto call = buildCall(/*#ref*/l, buildExpReference(/*#ref*/l, sinkVar, sinkVar.name), [copyExp(e)]);
dgt(call);
}
//! Build an if statement based on a runtime assert.
ir.IfStatement lowerAssertIf(LanguagePass lp, ir.Scope current, ir.AssertStatement as)
{
panicAssert(as, !as.isStatic);
auto loc = as.loc;
ir.Exp message = as.message;
if (message is null) {
message = buildConstantStringNoEscape(/*#ref*/loc, "assertion failure");
}
assert(message !is null);
ir.Exp locstr = buildConstantStringNoEscape(/*#ref*/loc, format("%s:%s", as.loc.filename, as.loc.line));
auto theThrow = buildExpStat(/*#ref*/loc, buildCall(/*#ref*/loc, lp.ehThrowAssertErrorFunc, [locstr, message]));
auto thenBlock = buildBlockStat(/*#ref*/loc, null, current, theThrow);
auto ifS = buildIfStat(/*#ref*/loc, buildNot(/*#ref*/loc, as.condition), thenBlock);
return ifS;
}
/*!
* Given a throw statement, turn its expression into a call into the RT.
*
* Params:
* lp: The LanguagePass.
* t: The ThrowStatement to lower.
*/
void lowerThrow(LanguagePass lp, ir.ThrowStatement t)
{
t.exp = buildCall(/*#ref*/t.loc, lp.ehThrowFunc, [t.exp,
buildConstantStringNoEscape(/*#ref*/t.loc, format("%s:%s", t.loc.filename, t.loc.line))]);
}
/*!
* Replace a StringImport with the string in the file it points at, or error.
*
* Params:
* lp: The LanguagePass.
* current: The scope at where the StringImport is.
* exp: The expression to write the new string into.
* simport: The StringImport to lower.
*/
void lowerStringImport(Driver driver, ref ir.Exp exp, ir.StringImport simport)
{
auto constant = cast(ir.Constant)simport.filename;
panicAssert(simport, constant !is null);
// Remove string literal terminators.
auto fname = constant._string[1 .. $-1];
// Ask the driver for the file contents.
auto str = driver.stringImport(/*#ref*/exp.loc, fname);
// Build and replace.
exp = buildConstantStringNoEscape(/*#ref*/exp.loc, str);
}
/*!
* Turn `Struct a = {1, "banana"};`
* into `Struct a; a.firstField = 1; b.secondField = "banana";`.
*
* Params:
* lp: The LanguagePass.
* current: The scope where the StructLiteral occurs.
* exp: The expression of the StructLiteral.
* literal: The StructLiteral to lower.
*/
void lowerStructLiteral(LanguagePass lp, ir.Scope current, ref ir.Exp exp, ir.StructLiteral literal)
{
// Pull out the struct and its fields.
panicAssert(exp, literal.type !is null);
auto theStruct = cast(ir.Struct) realType(literal.type);
panicAssert(exp, theStruct !is null);
auto fields = getStructFieldVars(theStruct);
// The extyper should've caught this.
panicAssert(exp, fields.length >= literal.exps.length);
// Struct __anon;
auto loc = exp.loc;
auto sexp = buildStatementExp(/*#ref*/loc);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, theStruct, null);
// Assign the literal expressions to the fields.
foreach (i, e; literal.exps) {
auto eref = buildExpReference(/*#ref*/loc, var, var.name);
auto lh = buildAccessExp(/*#ref*/loc, eref, fields[i]);
auto assign = buildAssign(/*#ref*/loc, lh, e);
buildExpStat(/*#ref*/loc, sexp, assign);
}
sexp.exp = buildExpReference(/*#ref*/loc, var, var.name);
sexp.originalExp = exp;
exp = sexp;
}
/*!
* Lower a postfix index expression.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* postfix: The postfix expression to potentially lower.
*/
void lowerIndex(LanguagePass lp, ir.Scope current, ir.Module thisModule,
ref ir.Exp exp, ir.Postfix postfix, LlvmLowerer lowerer)
{
auto type = getExpType(postfix.child);
if (type.nodeType == ir.NodeType.AAType) {
lowerIndexAA(lp, current, thisModule, /*#ref*/exp, postfix, cast(ir.AAType)type, lowerer);
}
// LLVM appears to have some issues with small indices.
// If this is being indexed by a small type, cast it up.
if (postfix.arguments.length > 0) {
panicAssert(exp, postfix.arguments.length == 1);
auto prim = cast(ir.PrimitiveType)realType(getExpType(postfix.arguments[0]));
if (prim !is null && size(lp.target, prim) < 4/*Smaller than a 32 bit integer.*/) {
auto loc = postfix.arguments[0].loc;
postfix.arguments[0] = buildCastSmart(buildInt(/*#ref*/loc), postfix.arguments[0]);
}
}
}
/*!
* Lower a postfix index expression that operates on an AA.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* postfix: The postfix expression to potentially lower.
* aa: The type of the AA being operated on.
*/
void lowerIndexAA(LanguagePass lp, ir.Scope current, ir.Module thisModule,
ref ir.Exp exp, ir.Postfix postfix, ir.AAType aa, LlvmLowerer lowerer)
{
auto loc = postfix.loc;
auto statExp = buildStatementExp(/*#ref*/loc);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
buildPtrSmart(/*#ref*/loc, aa), buildAddrOf(/*#ref*/loc, postfix.child)
);
auto key = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
copyTypeSmart(/*#ref*/loc, aa.key), postfix.arguments[0]
);
auto store = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
copyTypeSmart(/*#ref*/loc, aa.value), null
);
lowerAALookup(/*#ref*/loc, lp, thisModule, current, statExp, aa, var,
buildExpReference(/*#ref*/loc, key, key.name),
buildExpReference(/*#ref*/loc, store, store.name),
lowerer
);
statExp.exp = buildExpReference(/*#ref*/loc, store);
exp = statExp;
}
/*!
* Lower an assign if it needs it.
*
* Params:
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the assign to potentially lower.
*/
void lowerAssign(LanguagePass lp, ir.Module thisModule, ref ir.Exp exp, ir.BinOp binOp)
{
auto asPostfix = cast(ir.Postfix)binOp.left;
if (asPostfix is null) {
return;
}
auto leftType = getExpType(asPostfix);
if (leftType is null || leftType.nodeType != ir.NodeType.ArrayType) {
return;
}
lowerAssignArray(lp, thisModule, /*#ref*/exp, binOp, asPostfix, cast(ir.ArrayType)leftType);
}
/*!
* Lower an assign to an array if it's being modified by a postfix.
*
* Params:
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the assign to potentially lower.
* asPostfix: The postfix operation modifying the array.
* leftType: The array type of the left hand side of the assign.
*/
void lowerAssignArray(LanguagePass lp, ir.Module thisModule, ref ir.Exp exp,
ir.BinOp binOp, ir.Postfix asPostfix, ir.ArrayType leftType)
{
auto loc = binOp.loc;
if (asPostfix.op != ir.Postfix.Op.Slice) {
return;
}
auto func = getArrayCopyFunction(/*#ref*/loc, lp, thisModule, leftType);
exp = buildCall(/*#ref*/loc, func, [asPostfix, binOp.right], func.name);
}
/*!
* Lower an assign to an AA.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the assign to potentially lower.
* asPostfix: The left hand side of the assign as a postfix.
* aa: The AA type that the expression is assigning to.
*/
void lowerAssignAA(LanguagePass lp, ir.Scope current, ir.Module thisModule,
ref ir.Exp exp, ir.BinOp binOp, ir.Postfix asPostfix, ir.AAType aa,
LlvmLowerer lowerer)
{
auto loc = binOp.loc;
assert(asPostfix.op == ir.Postfix.Op.Index);
auto statExp = buildStatementExp(/*#ref*/loc);
auto bs = cast(ir.BlockStatement)current.node;
if (bs is null) {
auto func = cast(ir.Function)current.node;
if (func !is null) {
bs = func.parsedBody;
}
}
panicAssert(exp, bs !is null);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
buildPtrSmart(/*#ref*/loc, aa), buildAddrOf(/*#ref*/loc, asPostfix.child)
);
auto key = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
copyTypeSmart(/*#ref*/loc, aa.key), asPostfix.arguments[0]
);
auto value = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
copyTypeSmart(/*#ref*/loc, aa.value), binOp.right
);
lowerAAInsert(/*#ref*/loc, lp, thisModule, current, statExp, aa, var,
buildExpReference(/*#ref*/loc, key, key.name),
buildExpReference(/*#ref*/loc, value, value.name),
lowerer
);
statExp.exp = buildExpReference(/*#ref*/loc, value, value.name);
exp = statExp;
}
/*!
* Lower a +=, *=, etc assign to an AA.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the assign to potentially lower.
* asPostfix: The left hand side of the assign as a postfix.
* aa: The AA type that the expression is assigning to.
*/
void lowerOpAssignAA(LanguagePass lp, ir.Scope current, ir.Module thisModule,
ref ir.Exp exp, ir.BinOp binOp, ir.Postfix asPostfix, ir.AAType aa,
LlvmLowerer lowerer)
{
auto loc = binOp.loc;
assert(asPostfix.op == ir.Postfix.Op.Index);
auto statExp = buildStatementExp(/*#ref*/loc);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
buildPtrSmart(/*#ref*/loc, aa), null
);
buildExpStat(/*#ref*/loc, statExp,
buildAssign(/*#ref*/loc, var, buildAddrOf(/*#ref*/loc, asPostfix.child))
);
auto key = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
copyTypeSmart(/*#ref*/loc, aa.key), null
);
buildExpStat(/*#ref*/loc, statExp,
buildAssign(/*#ref*/loc, key, asPostfix.arguments[0])
);
auto store = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, cast(ir.BlockStatement)current.node, statExp,
copyTypeSmart(/*#ref*/loc, aa.value), null
);
lowerAALookup(/*#ref*/loc, lp, thisModule, current, statExp, aa, var,
buildExpReference(/*#ref*/loc, key, key.name),
buildExpReference(/*#ref*/loc, store, store.name),
lowerer
);
buildExpStat(/*#ref*/loc, statExp,
buildBinOp(/*#ref*/loc, binOp.op,
buildExpReference(/*#ref*/loc, store, store.name),
binOp.right
)
);
lowerAAInsert(/*#ref*/loc, lp, thisModule, current, statExp, aa, var,
buildExpReference(/*#ref*/loc, key, key.name),
buildExpReference(/*#ref*/loc, store, store.name),
lowerer,
false
);
statExp.exp = buildExpReference(/*#ref*/loc, store, store.name);
exp = statExp;
}
/*!
* Lower a concatenation operation. (A ~ B)
*
* Params:
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the concatenation to lower.
*/
void lowerCat(LanguagePass lp, ir.Module thisModule, ref ir.Exp exp, ir.BinOp binOp)
{
auto loc = binOp.loc;
auto leftType = getExpType(binOp.left);
auto rightType = getExpType(binOp.right);
auto arrayType = cast(ir.ArrayType)leftType;
auto elementType = rightType;
bool reversed = false;
if (arrayType is null) {
reversed = true;
arrayType = cast(ir.ArrayType) rightType;
elementType = leftType;
if (arrayType is null) {
throw panic(/*#ref*/exp.loc, "array concat failure");
}
}
if (typesEqual(realType(elementType, true), realType(arrayType.base, true))) {
// T[] ~ T
ir.Function func;
if (reversed) {
func = getArrayPrependFunction(/*#ref*/loc, lp, thisModule, arrayType, elementType);
} else {
func = getArrayAppendFunction(/*#ref*/loc, lp, thisModule, arrayType, elementType, false);
}
exp = buildCall(/*#ref*/loc, func, [binOp.left, binOp.right], func.name);
} else {
// T[] ~ T[]
auto func = getArrayConcatFunction(/*#ref*/loc, lp, thisModule, arrayType, false);
exp = buildCall(/*#ref*/loc, func, [binOp.left, binOp.right], func.name);
}
return;
}
/*!
* Lower a concatenation assign operation. (A ~= B)
*
* Params:
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the concatenation assign to lower.
*/
void lowerCatAssign(LanguagePass lp, ir.Module thisModule, ref ir.Exp exp, ir.BinOp binOp)
{
auto loc = binOp.loc;
auto leftType = getExpType(binOp.left);
auto leftArrayType = cast(ir.ArrayType)realType(leftType);
if (leftArrayType is null) {
throw panic(binOp, "couldn't retrieve array type from cat assign.");
}
// Currently realType is not needed here, but if it ever was
// needed remember to realType leftArrayType.base as well,
// since realType will remove enum's as well.
auto rightType = getExpType(binOp.right);
if (typesEqual(realType(rightType, true), realType(leftArrayType.base, true))) {
// T[] ~ T
auto func = getArrayAppendFunction(/*#ref*/loc, lp, thisModule, leftArrayType, rightType, true);
exp = buildCall(/*#ref*/loc, func, [buildAddrOf(binOp.left), binOp.right], func.name);
} else {
auto func = getArrayConcatFunction(/*#ref*/loc, lp, thisModule, leftArrayType, true);
exp = buildCall(/*#ref*/loc, func, [buildAddrOf(binOp.left), binOp.right], func.name);
}
}
/*!
* Lower an equality operation, if it needs it.
*
* Params:
* lp: The LanguagePass.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* binOp: The BinOp with the equality operation to potentially lower.
*/
void lowerEqual(LanguagePass lp, ir.Module thisModule, ref ir.Exp exp, ir.BinOp binOp)
{
auto loc = binOp.loc;
auto leftType = getExpType(binOp.left);
auto leftArrayType = cast(ir.ArrayType)leftType;
if (leftArrayType is null) {
return;
}
auto func = getArrayCmpFunction(/*#ref*/loc, lp, thisModule, leftArrayType, binOp.op == ir.BinOp.Op.NotEqual);
exp = buildCall(/*#ref*/loc, func, [binOp.left, binOp.right], func.name);
}
/*!
* Lower an expression that casts to an interface.
*
* Params:
* loc: Nodes created in this function will be given this loc.
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* uexp: The interface cast to lower.
* exp: A reference to the relevant expression.
*/
void lowerInterfaceCast(ref in Location loc, LanguagePass lp,
ir.Scope current, ir.Unary uexp, ref ir.Exp exp)
{
if (uexp.op != ir.Unary.Op.Cast) {
return;
}
auto iface = cast(ir._Interface) realType(uexp.type);
if (iface is null) {
return;
}
auto agg = cast(ir.Aggregate) realType(getExpType(uexp.value));
if (agg is null) {
return;
}
auto store = lookupInGivenScopeOnly(lp, agg.myScope, /*#ref*/loc, mangle(iface));
panicAssert(uexp, store !is null);
auto var = cast(ir.Variable)store.node;
panicAssert(uexp, var !is null);
exp = buildAddrOf(/*#ref*/loc, buildAccessExp(/*#ref*/loc, uexp.value, var));
}
/*!
* Lower an expression that casts to an array.
*
* Params:
* loc: Nodes created in this function will be given this loc.
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* uexp: The array cast to lower.
* exp: A reference to the relevant expression.
*/
void lowerArrayCast(ref in Location loc, LanguagePass lp, ir.Scope current,
ir.Unary uexp, ref ir.Exp exp)
{
if (uexp.op != ir.Unary.Op.Cast) {
return;
}
auto toArray = cast(ir.ArrayType) realType(uexp.type);
if (toArray is null) {
return;
}
auto fromArray = cast(ir.ArrayType) getExpType(uexp.value);
if (fromArray is null) {
auto stype = cast(ir.StaticArrayType) getExpType(uexp.value);
if (stype !is null) {
uexp.value = buildSlice(/*#ref*/exp.loc, uexp.value);
fromArray = cast(ir.ArrayType)getExpType(uexp.value);
panicAssert(exp, fromArray !is null);
} else {
return;
}
}
if (typesEqual(toArray, fromArray)) {
return;
}
auto toClass = cast(ir.Class) realType(toArray.base);
auto fromClass = cast(ir.Class) realType(fromArray.base);
if (toClass !is null && fromClass !is null && isOrInheritsFrom(fromClass, toClass)) {
return;
}
auto fromSz = size(lp.target, fromArray.base);
auto toSz = size(lp.target, toArray.base);
auto biggestSz = fromSz > toSz ? fromSz : toSz;
bool decreasing = fromSz > toSz;
// Skip lowering if the same size, the backend can handle it.
if (fromSz == toSz) {
return;
}
// ({
auto sexp = new ir.StatementExp();
sexp.loc = loc;
// auto arr = <exp>
auto varName = "arr";
auto var = buildVariableSmart(/*#ref*/loc, copyTypeSmart(/*#ref*/loc, fromArray), ir.Variable.Storage.Function, varName);
var.assign = uexp.value;
sexp.statements ~= var;
if (fromSz % toSz) {
// vrt_throw_slice_error(arr.length, typeid(T).size);
auto ln = buildArrayLength(/*#ref*/loc, lp.target, buildExpReference(/*#ref*/loc, var, varName));
auto sz = getSizeOf(/*#ref*/loc, lp, toArray.base);
ir.Exp locstr = buildConstantStringNoEscape(/*#ref*/loc, format("%s:%s", exp.loc.filename, exp.loc.line));
auto rtCall = buildCall(/*#ref*/loc, lp.ehThrowSliceErrorFunc, [locstr]);
auto bs = buildBlockStat(/*#ref*/loc, rtCall, current, buildExpStat(/*#ref*/loc, rtCall));
auto check = buildBinOp(/*#ref*/loc, ir.BinOp.Op.NotEqual,
buildBinOp(/*#ref*/loc, ir.BinOp.Op.Mod, ln, sz),
buildConstantSizeT(/*#ref*/loc, lp.target, 0));
auto _if = buildIfStat(/*#ref*/loc, check, bs);
sexp.statements ~= _if;
}
auto inLength = buildArrayLength(/*#ref*/loc, lp.target, buildExpReference(/*#ref*/loc, var, varName));
ir.Exp lengthTweak;
if (fromSz == toSz) {
lengthTweak = inLength;
} else if (!decreasing) {
lengthTweak = buildBinOp(/*#ref*/loc, ir.BinOp.Op.Div, inLength,
buildConstantSizeT(/*#ref*/loc, lp.target, biggestSz));
} else {
lengthTweak = buildBinOp(/*#ref*/loc, ir.BinOp.Op.Mul, inLength,
buildConstantSizeT(/*#ref*/loc, lp.target, biggestSz));
}
auto ptrType = buildPtrSmart(/*#ref*/loc, toArray.base);
auto ptrIn = buildArrayPtr(/*#ref*/loc, fromArray.base, buildExpReference(/*#ref*/loc, var, varName));
auto ptrOut = buildCast(/*#ref*/loc, ptrType, ptrIn);
sexp.exp = buildSlice(/*#ref*/loc, ptrOut, buildConstantSizeT(/*#ref*/loc, lp.target, 0), lengthTweak);
exp = sexp;
}
/*!
* Is a given postfix an interface pointer? If so, which one?
*
* Params:
* lp: The LanguagePass.
* pfix: The Postfix to check.
* current: The scope where the postfix resides.
* iface: Will be filled in with the Interface if the postfix is a pointer to one.
*
* Returns: true if pfix's type is an interface pointer, false otherwise.
*/
bool isInterfacePointer(LanguagePass lp, ir.Postfix pfix, ir.Scope current, out ir._Interface iface)
{
pfix = cast(ir.Postfix) pfix.child;
if (pfix is null) {
return false;
}
auto t = getExpType(pfix.child);
iface = cast(ir._Interface) realType(t);
if (iface !is null) {
return true;
}
auto ptr = cast(ir.PointerType) realType(t);
if (ptr is null) {
return false;
}
ptr = cast(ir.PointerType) realType(ptr.base);
if (ptr is null) {
return false;
}
auto _struct = cast(ir.Struct) realType(ptr.base);
if (_struct is null) {
return false;
}
iface = cast(ir._Interface) _struct.loweredNode;
return iface !is null;
}
/*!
* If a postfix operates directly on a struct via a
* function call, put it in a variable first.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* exp: A reference to the relevant expression.
* ae: The AccessExp to check.
*/
void lowerStructLookupViaFunctionCall(LanguagePass lp, ir.Scope current, ref ir.Exp exp, ir.AccessExp ae, ir.Type type)
{
auto loc = ae.loc;
auto statExp = buildStatementExp(/*#ref*/loc);
auto host = getParentFunction(current);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, host.parsedBody, statExp, type,
ae.child);
ae.child = buildExpReference(/*#ref*/loc, var, var.name);
statExp.exp = exp;
exp = statExp;
}
/*!
* Rewrites a given foreach statement (fes) into a for statement.
*
* The ForStatement created uses several of the fes's nodes directly; that is
* to say, the original foreach and the new for cannot coexist.
*
* Params:
* fes: The ForeachStatement to lower.
* lp: The LanguagePass.
* current: The Scope where this code takes place.
*
* Returns: The lowered ForStatement.
*/
ir.ForStatement lowerForeach(ir.ForeachStatement fes, LanguagePass lp,
ir.Scope current)
{
auto loc = fes.loc;
auto fs = new ir.ForStatement();
fs.loc = loc;
panicAssert(fes, fes.itervars.length == 1 || fes.itervars.length == 2);
fs.initVars = fes.itervars;
fs.block = fes.block;
// foreach (i; 5 .. 7) => for (int i = 5; i < 7; i++)
// foreach_reverse (i; 5 .. 7) => for (int i = 7 - 1; i >= 5; i--)
if (fes.beginIntegerRange !is null) {
panicAssert(fes, fes.endIntegerRange !is null);
panicAssert(fes, fes.itervars.length == 1);
auto v = fs.initVars[0];
auto begin = realType(getExpType(fes.beginIntegerRange));
auto end = realType(getExpType(fes.endIntegerRange));
if (!isIntegral(begin) || !isIntegral(end)) {
throw makeExpected(/*#ref*/fes.beginIntegerRange.loc,
"integral beginning and end of range");
}
panicAssert(fes, typesEqual(begin, end));
if (v.type is null) {
v.type = copyType(begin);
}
v.assign = fes.reverse ?
buildSub(/*#ref*/loc, fes.endIntegerRange, buildConstantInt(/*#ref*/loc, 1)) :
fes.beginIntegerRange;
auto cmpRef = buildExpReference(/*#ref*/v.loc, v, v.name);
auto incRef = buildExpReference(/*#ref*/v.loc, v, v.name);
fs.test = buildBinOp(/*#ref*/loc,
fes.reverse ? ir.BinOp.Op.GreaterEqual : ir.BinOp.Op.Less,
cmpRef,
buildCastSmart(/*#ref*/loc, begin,
fes.reverse ? fes.beginIntegerRange : fes.endIntegerRange));
fs.increments ~= fes.reverse ? buildDecrement(/*#ref*/v.loc, incRef) :
buildIncrement(/*#ref*/v.loc, incRef);
return fs;
}
// foreach (e; a) => foreach (e; auto _anon = a)
auto sexp = buildStatementExp(/*#ref*/loc);
// foreach (i, e; array) => for (size_t i = 0; i < array.length; i++) auto e = array[i]; ...
// foreach_reverse (i, e; array) => for (size_t i = array.length - 1; i+1 >= 0; i--) auto e = array[i]; ..
auto aggType = realType(getExpType(fes.aggregate));
if (aggType.nodeType == ir.NodeType.ArrayType ||
aggType.nodeType == ir.NodeType.StaticArrayType) {
//
aggType = realType(getExpType(buildSlice(/*#ref*/loc, fes.aggregate)));
auto anonVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, aggType,
buildSlice(/*#ref*/loc, fes.aggregate));
anonVar.type.mangledName = mangle(aggType);
scope (exit) fs.initVars = anonVar ~ fs.initVars;
ir.ExpReference aggref() { return buildExpReference(/*#ref*/loc, anonVar, anonVar.name); }
fes.aggregate = aggref();
// i = 0 / i = array.length
ir.Variable indexVar, elementVar;
ir.Exp indexAssign;
if (!fes.reverse) {
indexAssign = buildConstantSizeT(/*#ref*/loc, lp.target, 0);
} else {
indexAssign = buildArrayLength(/*#ref*/loc, lp.target, aggref());
}
if (fs.initVars.length == 2) {
indexVar = fs.initVars[0];
if (indexVar.type is null) {
indexVar.type = buildSizeT(/*#ref*/loc, lp.target);
}
indexVar.assign = indexAssign;
elementVar = fs.initVars[1];
} else {
panicAssert(fes, fs.initVars.length == 1);
indexVar = buildVariable(/*#ref*/loc, buildSizeT(/*#ref*/loc, lp.target),
ir.Variable.Storage.Function, "i", indexAssign);
elementVar = fs.initVars[0];
}
// Move element var to statements so it can be const/immutable.
fs.initVars = [indexVar];
fs.block.statements = [cast(ir.Node)elementVar] ~ fs.block.statements;
ir.Variable nextIndexVar; // This is what we pass when decoding strings.
if (fes.decodeFunction !is null && !fes.reverse) {
auto ivar = buildExpReference(/*#ref*/indexVar.loc, indexVar, indexVar.name);
nextIndexVar = buildVariable(/*#ref*/loc, buildSizeT(/*#ref*/loc, lp.target),
ir.Variable.Storage.Function, "__nexti", ivar);
fs.initVars ~= nextIndexVar;
}
// i < array.length / i + 1 >= 0
auto tref = buildExpReference(/*#ref*/indexVar.loc, indexVar, indexVar.name);
auto rtref = buildDecrement(/*#ref*/loc, tref);
auto length = buildArrayLength(/*#ref*/loc, lp.target, fes.aggregate);
auto zero = buildConstantSizeT(/*#ref*/loc, lp.target, 0);
fs.test = buildBinOp(/*#ref*/loc, fes.reverse ? ir.BinOp.Op.Greater : ir.BinOp.Op.Less,
fes.reverse ? rtref : tref,
fes.reverse ? zero : length);
// auto e = array[i]; i++/i--
auto incRef = buildExpReference(/*#ref*/indexVar.loc, indexVar, indexVar.name);
auto accessRef = buildExpReference(/*#ref*/indexVar.loc, indexVar, indexVar.name);
auto eRef = buildExpReference(/*#ref*/elementVar.loc, elementVar, elementVar.name);
if (fes.decodeFunction !is null) { // foreach (i, dchar c; str)
auto dfn = buildExpReference(/*#ref*/loc, fes.decodeFunction, fes.decodeFunction.name);
if (!fes.reverse) {
elementVar.assign = buildCall(/*#ref*/loc, dfn,
[cast(ir.Exp)aggref(), cast(ir.Exp)buildExpReference(/*#ref*/loc, nextIndexVar,
nextIndexVar.name)]);
fs.increments ~= buildAssign(/*#ref*/loc, indexVar, nextIndexVar);
} else {
elementVar.assign = buildCall(/*#ref*/loc, dfn, [cast(ir.Exp)aggref(),
cast(ir.Exp)buildExpReference(/*#ref*/indexVar.loc, indexVar, indexVar.name)]);
}
} else {
elementVar.assign = buildIndex(/*#ref*/incRef.loc, aggref(), accessRef);
if (!fes.reverse) {
fs.increments ~= buildIncrement(/*#ref*/incRef.loc, incRef);
}
}
foreach (i, ivar; fes.itervars) {
if (!fes.refvars[i]) {
continue;
}
if (i == 0 && fes.itervars.length > 1) {
throw makeForeachIndexRef(/*#ref*/fes.loc);
}
auto nr = new ExpReferenceReplacer(ivar, elementVar.assign);
accept(fs.block, nr);
}
return fs;
}
// foreach (k, v; aa) => for (size_t i; i < aa.keys.length; i++) k = aa.keys[i]; v = aa[k];
// foreach_reverse => error, as order is undefined.
auto aaanonVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, aggType, fes.aggregate);
aaanonVar.type.mangledName = mangle(aggType);
scope (exit) fs.initVars = aaanonVar ~ fs.initVars;
ir.ExpReference aaaggref() { return buildExpReference(/*#ref*/loc, aaanonVar, aaanonVar.name); }
fes.aggregate = aaaggref();
auto aa = cast(ir.AAType) aggType;
if (aa !is null) {
ir.Exp buildAACall(ir.Function func, ir.Type outType)
{
auto eref = buildExpReference(/*#ref*/loc, func, func.name);
return buildCastSmart(/*#ref*/loc, outType, buildCall(/*#ref*/loc, eref,
[cast(ir.Exp)buildCastToVoidPtr(/*#ref*/loc, aaaggref())]));
}
if (fes.reverse) {
throw makeForeachReverseOverAA(fes);
}
if (fs.initVars.length != 1 && fs.initVars.length != 2) {
throw makeExpected(/*#ref*/fes.loc, "1 or 2 iteration variables");
}
auto valVar = fs.initVars[0];
ir.Variable keyVar;
if (fs.initVars.length == 2) {
keyVar = valVar;
valVar = fs.initVars[1];
} else {
keyVar = buildVariable(/*#ref*/loc, null, ir.Variable.Storage.Function,
format("%sk", fs.block.myScope.nestedDepth));
fs.initVars ~= keyVar;
}
auto vstor = cast(ir.StorageType) valVar.type;
if (vstor !is null && vstor.type == ir.StorageType.Kind.Auto) {
valVar.type = null;
}
auto kstor = cast(ir.StorageType) keyVar.type;
if (kstor !is null && kstor.type == ir.StorageType.Kind.Auto) {
keyVar.type = null;
}
if (valVar.type is null) {
valVar.type = copyTypeSmart(/*#ref*/loc, aa.value);
}
if (keyVar.type is null) {
keyVar.type = copyTypeSmart(/*#ref*/loc, aa.key);
}
auto indexVar = buildVariable(
/*#ref*/loc,
buildSizeT(/*#ref*/loc, lp.target),
ir.Variable.Storage.Function,
format("%si", fs.block.myScope.nestedDepth),
buildConstantSizeT(/*#ref*/loc, lp.target, 0)
);
assert(keyVar.type !is null);
assert(valVar.type !is null);
assert(indexVar.type !is null);
fs.initVars ~= indexVar;
// Cached keys array
auto keysArrayVar = buildVariable(
/*#ref*/loc,
buildArrayTypeSmart(/*#ref*/loc, keyVar.type),
ir.Variable.Storage.Function,
format("%skeysarr", fs.block.myScope.nestedDepth),
buildAACall(lp.aaGetKeys, buildArrayTypeSmart(/*#ref*/loc, keyVar.type))
);
fs.initVars ~= keysArrayVar;
// i < keysarr.length
auto index = buildExpReference(/*#ref*/loc, indexVar, indexVar.name);
auto len = buildArrayLength(/*#ref*/loc, lp.target,
buildExpReference(/*#ref*/loc, keysArrayVar, keysArrayVar.name));
fs.test = buildBinOp(/*#ref*/loc, ir.BinOp.Op.Less, index, len);
// v = aa[k]
auto rh2 = buildIndex(/*#ref*/loc, aaaggref(), buildExpReference(/*#ref*/loc, keyVar, keyVar.name));
fs.block.statements = buildExpStat(/*#ref*/loc, buildAssign(/*#ref*/loc, valVar, rh2)) ~ fs.block.statements;
// k = keysarr[i]
auto keys = buildExpReference(/*#ref*/loc, keysArrayVar, keysArrayVar.name);
auto rh = buildIndex(/*#ref*/loc, keys, buildExpReference(/*#ref*/loc, indexVar, indexVar.name));
fs.block.statements = buildExpStat(/*#ref*/loc, buildAssign(/*#ref*/loc, keyVar, rh)) ~ fs.block.statements;
// i++
fs.increments ~= buildIncrement(/*#ref*/loc, buildExpReference(/*#ref*/loc, indexVar, indexVar.name));
return fs;
}
throw panic(/*#ref*/loc, "expected foreach aggregate type");
}
/*!
* Lower an array literal to an internal array literal.
*
* The backend will treat any ArrayLiteral as full of constants, so we can't
* pass most of them through.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* inFunction: Is this ArrayLiteral in a function or not?
* exp: A reference to the relevant expression.
* al: The ArrayLiteral to lower.
*/
void lowerArrayLiteral(LanguagePass lp, ir.Scope current,
ref ir.Exp exp, ir.ArrayLiteral al)
{
auto at = getExpType(al);
if (at.nodeType == ir.NodeType.StaticArrayType) {
return;
}
assert(at.nodeType == ir.NodeType.ArrayType);
bool isScope = at.isScope;
auto arr = at.toArrayTypeFast();
bool isBaseConst = arr.base.isConst;
bool isExpsBackend;
foreach (alexp; al.exps) {
isExpsBackend = isBackendConstant(alexp);
if (!isExpsBackend) {
break;
}
}
if ((!isBaseConst || !isExpsBackend) && isScope) {
auto sa = buildStaticArrayTypeSmart(/*#ref*/exp.loc, al.exps.length, arr.base);
auto sexp = buildInternalStaticArrayLiteralSmart(lp.errSink, /*#ref*/exp.loc, sa, al.exps);
exp = buildSlice(/*#ref*/exp.loc, sexp);
} else if (!isScope || !isBaseConst || !isExpsBackend) {
auto sexp = buildInternalArrayLiteralSmart(lp.errSink, /*#ref*/al.loc, at, al.exps);
sexp.originalExp = al;
exp = sexp;
}
}
/*!
* Lower a builtin expression.
*
* These are comprised mostly of things that need calls to the RT to deal with them.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* exp: A reference to the relevant expression.
* builtin: The BuiltinExp to lower.
*/
void lowerBuiltin(LanguagePass lp, ir.Scope current, ref ir.Exp exp, ir.BuiltinExp builtin, LlvmLowerer lowerer)
{
auto loc = exp.loc;
final switch (builtin.kind) with (ir.BuiltinExp.Kind) {
case ArrayPtr:
case ArrayLength:
case BuildVtable:
case EnumMembers:
break;
case ArrayDup:
if (builtin.children.length != 3) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
auto sexp = buildStatementExp(/*#ref*/loc);
auto type = builtin.type;
auto asStatic = cast(ir.StaticArrayType)realType(type);
ir.Exp value = builtin.children[0];
value = buildSlice(/*#ref*/loc, value);
auto valueVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, type, value);
value = buildExpReference(/*#ref*/loc, valueVar, valueVar.name);
auto startCast = buildCastSmart(/*#ref*/loc, buildSizeT(/*#ref*/loc, lp.target), builtin.children[1]);
auto startVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, buildSizeT(/*#ref*/loc, lp.target), startCast);
auto start = buildExpReference(/*#ref*/loc, startVar, startVar.name);
auto endCast = buildCastSmart(/*#ref*/loc, buildSizeT(/*#ref*/loc, lp.target), builtin.children[2]);
auto endVar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, buildSizeT(/*#ref*/loc, lp.target), endCast);
auto end = buildExpReference(/*#ref*/loc, endVar, endVar.name);
auto length = buildSub(/*#ref*/loc, end, start);
auto newExp = buildNewSmart(/*#ref*/loc, type, length);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, type, newExp);
auto evar = buildExpReference(/*#ref*/loc, var, var.name);
auto sliceL = buildSlice(/*#ref*/loc, evar, copyExp(start), copyExp(end));
auto sliceR = buildSlice(/*#ref*/loc, value, copyExp(start), copyExp(end));
sexp.exp = buildAssign(/*#ref*/loc, sliceL, sliceR);
exp = sexp;
break;
case AALength:
if (builtin.children.length != 1) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
exp = buildCall(/*#ref*/exp.loc, lp.aaGetLength, builtin.children);
break;
case AAKeys:
if (builtin.children.length != 1) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
exp = buildCastSmart(/*#ref*/exp.loc, builtin.type,
buildCall(/*#ref*/exp.loc, lp.aaGetKeys, builtin.children));
break;
case AAValues:
if (builtin.children.length != 1) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
exp = buildCastSmart(/*#ref*/exp.loc, builtin.type,
buildCall(/*#ref*/exp.loc, lp.aaGetValues, builtin.children));
break;
case AARehash:
if (builtin.children.length != 1) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
exp = buildCall(/*#ref*/exp.loc, lp.aaRehash, builtin.children);
break;
case AAGet:
if (builtin.children.length != 3) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
auto aa = cast(ir.AAType)realType(getExpType(builtin.children[0]));
if (aa is null) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
// Value* ptr = cast(Value*)vrt_aa_in_binop_*(aa, key);
// Value val = <default>;
auto sexp = buildStatementExp(/*#ref*/loc);
ir.Function rtFn;
if (aa.key.nodeType == ir.NodeType.PrimitiveType) {
rtFn = lp.aaInBinopPrimitive;
} else if (aa.key.nodeType == ir.NodeType.ArrayType) {
rtFn = lp.aaInBinopArray;
} else {
rtFn = lp.aaInBinopPtr;
}
builtin.children[1] = lowerAAKeyCast(/*#ref*/loc, lp, getModuleFromScope(/*#ref*/loc, current),
current, builtin.children[1], aa, lowerer);
auto ptr = buildVariableSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, aa.value), ir.Variable.Storage.Function,
"ptr");
auto val = buildVariableSmart(/*#ref*/loc, aa.value, ir.Variable.Storage.Function, "val");
ptr.assign = buildCall(/*#ref*/loc, rtFn, [builtin.children[0], builtin.children[1]]);
ptr.assign = buildCastSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, aa.value), ptr.assign);
val.assign = buildCastSmart(/*#ref*/loc, aa.value, builtin.children[2]);
sexp.statements ~= ptr;
sexp.statements ~= val;
// if (ptr !is null) { val = *ptr; }
auto assign = buildExpStat(/*#ref*/loc, buildAssign(/*#ref*/loc, buildExpReference(/*#ref*/loc, val, val.name),
buildDeref(/*#ref*/loc, buildExpReference(/*#ref*/loc, ptr, ptr.name))));
auto thenStat = buildBlockStat(/*#ref*/loc, null, current, assign);
auto cond = buildBinOp(/*#ref*/loc, ir.BinOp.Op.NotIs, buildExpReference(/*#ref*/loc, ptr, ptr.name),
buildConstantNull(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, aa.value)));
auto ifStat = buildIfStat(/*#ref*/loc, cond, thenStat);
sexp.statements ~= ifStat;
sexp.exp = buildExpReference(/*#ref*/loc, val, val.name);
exp = sexp;
break;
case AARemove:
if (builtin.children.length != 2) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
auto aa = cast(ir.AAType)realType(getExpType(builtin.children[0]));
if (aa is null) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
ir.Function rtfn;
builtin.children[1] = lowerAAKeyCast(/*#ref*/loc, lp, getModuleFromScope(/*#ref*/loc, current),
current, builtin.children[1], aa, lowerer);
if (aa.key.nodeType == ir.NodeType.PrimitiveType) {
rtfn = lp.aaDeletePrimitive;
} else if (aa.key.nodeType == ir.NodeType.ArrayType) {
rtfn = lp.aaDeleteArray;
} else {
rtfn = lp.aaDeletePtr;
}
exp = buildCall(/*#ref*/exp.loc, rtfn, builtin.children);
break;
case AAIn:
if (builtin.children.length != 2) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
auto aa = cast(ir.AAType)realType(getExpType(builtin.children[0]));
if (aa is null) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
bool keyIsArray = isArray(realType(aa.key));
ir.Function rtfn;
builtin.children[1] = lowerAAKeyCast(/*#ref*/loc, lp, getModuleFromScope(/*#ref*/loc, current),
current, builtin.children[1], aa, lowerer);
if (aa.key.nodeType == ir.NodeType.PrimitiveType) {
rtfn = lp.aaInBinopPrimitive;
} else if (aa.key.nodeType == ir.NodeType.ArrayType) {
rtfn = lp.aaInBinopArray;
} else {
rtfn = lp.aaInBinopPtr;
}
exp = buildCall(/*#ref*/exp.loc, rtfn, builtin.children);
exp = buildCast(/*#ref*/loc, builtin.type, exp);
break;
case AADup:
if (builtin.children.length != 1) {
throw panic(/*#ref*/exp.loc, "malformed BuiltinExp.");
}
exp = buildCall(/*#ref*/loc, lp.aaDup, builtin.children);
exp = buildCastSmart(/*#ref*/loc, builtin.type, exp);
break;
case Classinfo:
panicAssert(exp, builtin.children.length == 1);
auto iface = cast(ir._Interface)realType(getExpType(builtin.children[0]));
auto ti = buildPtrSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, buildArrayType(/*#ref*/loc, copyTypeSmart(/*#ref*/loc, lp.tiClassInfo))));
auto sexp = buildStatementExp(/*#ref*/loc);
ir.Exp ptr = buildCastToVoidPtr(/*#ref*/loc, builtin.children[0]);
if (iface !is null) {
/* We need the class vtable. Each interface instance holds the
* amount it's set forward from the beginning of the class one,
* as the first entry in the interface layout table,
* so we just do `**cast(size_t**)cast(void*)iface` to get at it.
* Then we subtract that value from the pointer.
*/
auto offset = buildDeref(/*#ref*/loc, buildDeref(/*#ref*/loc,
buildCastSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, buildSizeT(/*#ref*/loc, lp.target))), copyExp(/*#ref*/loc, ptr))));
ptr = buildSub(/*#ref*/loc, ptr, offset);
}
auto tinfos = buildDeref(/*#ref*/loc, buildDeref(/*#ref*/loc, buildCastSmart(/*#ref*/loc, ti, ptr)));
auto tvar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp,
buildArrayType(/*#ref*/loc,
copyTypeSmart(/*#ref*/loc, lp.tiClassInfo)), tinfos);
ir.Exp tlen = buildArrayLength(/*#ref*/loc, lp.target, buildExpReference(/*#ref*/loc, tvar, tvar.name));
tlen = buildSub(/*#ref*/loc, tlen, buildConstantSizeT(/*#ref*/loc, lp.target, 1));
sexp.exp = buildIndex(/*#ref*/loc, buildExpReference(/*#ref*/loc, tvar, tvar.name), tlen);
exp = buildCastSmart(/*#ref*/loc, lp.tiClassInfo, sexp);
break;
case PODCtor:
panicAssert(exp, builtin.children.length == 1);
panicAssert(exp, builtin.functions.length == 1);
lowerStructUnionConstructor(lp, current, /*#ref*/exp, builtin);
break;
case VaStart:
panicAssert(exp, builtin.children.length == 2);
builtin.children[1] = buildArrayPtr(/*#ref*/loc, buildVoid(/*#ref*/loc), builtin.children[1]);
exp = buildAssign(/*#ref*/loc, buildDeref(/*#ref*/loc, buildAddrOf(builtin.children[0])), builtin.children[1]);
break;
case VaEnd:
panicAssert(exp, builtin.children.length == 1);
exp = buildAssign(/*#ref*/loc, buildDeref(/*#ref*/loc, buildAddrOf(builtin.children[0])), buildConstantNull(/*#ref*/loc, buildVoidPtr(/*#ref*/loc)));
break;
case VaArg:
panicAssert(exp, builtin.children.length == 1);
auto vaexp = cast(ir.VaArgExp)builtin.children[0];
panicAssert(exp, vaexp !is null);
exp = lowerVaArg(/*#ref*/vaexp.loc, lp, vaexp);
break;
case UFCS:
case Invalid:
panicAssert(exp, false);
}
}
ir.StatementExp lowerVaArg(ref in Location loc, LanguagePass lp, ir.VaArgExp vaexp)
{
auto sexp = new ir.StatementExp();
sexp.loc = loc;
auto ptrToPtr = buildVariableSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, buildVoidPtr(/*#ref*/loc)), ir.Variable.Storage.Function, "ptrToPtr");
ptrToPtr.assign = buildAddrOf(/*#ref*/loc, vaexp.arg);
sexp.statements ~= ptrToPtr;
auto cpy = buildVariableSmart(/*#ref*/loc, buildVoidPtr(/*#ref*/loc), ir.Variable.Storage.Function, "cpy");
cpy.assign = buildDeref(/*#ref*/loc, ptrToPtr);
sexp.statements ~= cpy;
auto vlderef = buildDeref(/*#ref*/loc, ptrToPtr);
auto tid = buildTypeidSmart(/*#ref*/loc, vaexp.type);
auto sz = getSizeOf(/*#ref*/loc, lp, vaexp.type);
auto assign = buildAddAssign(/*#ref*/loc, vlderef, sz);
buildExpStat(/*#ref*/loc, sexp, assign);
auto ptr = buildPtrSmart(/*#ref*/loc, vaexp.type);
auto _cast = buildCastSmart(/*#ref*/loc, ptr, buildExpReference(/*#ref*/loc, cpy));
auto deref = buildDeref(/*#ref*/loc, _cast);
sexp.exp = deref;
return sexp;
}
/*!
* Lower an ExpReference, if needed.
*
* This rewrites them to lookup through the nested struct, if needed.
*
* Params:
* functionStack: A list of functions. Most recent at $-1, its parent at $-2, and so on.
* exp: A reference to the relevant expression.
* eref: The ExpReference to potentially lower.
*/
void lowerExpReference(ir.Function[] functionStack, ref ir.Exp exp, ir.ExpReference eref,
ir.Function func)
{
bool isnested;
foreach (pf; functionStack) {
foreach (nf; pf.nestedFunctions) {
if (func is nf) {
isnested = true;
}
}
if (isnested) {
break;
}
}
if (!isnested) {
return;
}
auto np = functionStack[$-1].nestedVariable;
exp = buildCreateDelegate(/*#ref*/exp.loc, buildExpReference(/*#ref*/np.loc, np, np.name), eref);
}
/*!
* Lower a Postfix, if needed.
*
* This handles index operations, and interface pointers.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* parentFunc: The parent function where this postfix is held, or null.
* postfix: The Postfix to potentially lower.
*/
void lowerPostfix(LanguagePass lp, ir.Scope current, ir.Module thisModule,
ref ir.Exp exp, ir.Function parentFunc, ir.Postfix postfix,
LlvmLowerer lowerer)
{
switch(postfix.op) {
case ir.Postfix.Op.Index:
lowerIndex(lp, current, thisModule, /*#ref*/exp, postfix, lowerer);
break;
default:
break;
}
ir._Interface iface;
if (isInterfacePointer(lp, postfix, current, /*#out*/iface)) {
assert(iface !is null);
auto cpostfix = cast(ir.Postfix) postfix.child; // TODO: Calling returned interfaces directly.
if (cpostfix is null || cpostfix.memberFunction is null) {
throw makeExpected(/*#ref*/exp.loc, "interface");
}
auto func = cast(ir.Function) cpostfix.memberFunction.decl;
if (func is null) {
throw makeExpected(/*#ref*/exp.loc, "method");
}
auto loc = exp.loc;
auto agg = cast(ir._Interface)realType(getExpType(cpostfix.child));
panicAssert(postfix, agg !is null);
auto store = lookupInGivenScopeOnly(lp, agg.layoutStruct.myScope, /*#ref*/loc, "__offset");
auto fstore = lookupInGivenScopeOnly(lp, agg.layoutStruct.myScope, /*#ref*/loc, mangle(null, func));
panicAssert(postfix, store !is null);
panicAssert(postfix, fstore !is null);
auto var = cast(ir.Variable)store.node;
auto fvar = cast(ir.Variable)fstore.node;
/* Manually lower the function type.
* We do this here because interfaces don't get called like a method,
* so we need to make sure everybody agrees on what it is that they're
* calling. (See test interface.13 and 14).
*/
fvar.type = copyType(func.type);
auto ftype = cast(ir.FunctionType)fvar.type;
ftype.params = buildVoidPtr(/*#ref*/loc) ~ ftype.params;
ftype.isArgRef = false ~ ftype.isArgRef;
ftype.isArgOut = false ~ ftype.isArgOut;
ftype.hiddenParameter = false;
panicAssert(postfix, var !is null);
panicAssert(postfix, fvar !is null);
auto handle = buildCastToVoidPtr(/*#ref*/loc, buildSub(/*#ref*/loc, buildCastSmart(/*#ref*/loc,
buildPtrSmart(/*#ref*/loc, buildUbyte(/*#ref*/loc)),
copyExp(cpostfix.child)),
buildAccessExp(/*#ref*/loc, buildDeref(/*#ref*/loc,
copyExp(cpostfix.child)), var)));
exp = buildCall(/*#ref*/loc, buildAccessExp(/*#ref*/loc, buildDeref(/*#ref*/loc, cpostfix.child),
fvar), handle ~ postfix.arguments);
}
lowerVarargCall(lp, current, postfix, parentFunc, /*#ref*/exp);
}
/*!
* Lower a call to a varargs function.
*/
void lowerVarargCall(LanguagePass lp, ir.Scope current, ir.Postfix postfix, ir.Function func, ref ir.Exp exp)
{
if (postfix.op != ir.Postfix.Op.Call) {
return;
}
assert(func !is null);
auto asFunctionType = cast(ir.CallableType)realType(getExpType(postfix.child));
if (asFunctionType is null || !asFunctionType.hasVarArgs) {
return;
}
if (asFunctionType.linkage == ir.Linkage.C) {
/* Clang casts floats to doubles when passing them to variadic functions.
* I'm not sure *why*, but sure enough if we don't we lose data, so...
*/
foreach (ref argexp; postfix.arguments[asFunctionType.params.length .. $]) {
auto ptype = getExpType(argexp);
if (isF32(ptype)) {
auto loc = argexp.loc;
argexp = buildCastSmart(/*#ref*/loc, buildDouble(/*#ref*/loc), argexp);
}
}
}
if (asFunctionType.linkage != ir.Linkage.Volt) {
return;
}
auto loc = postfix.loc;
auto callNumArgs = postfix.arguments.length;
auto funcNumArgs = asFunctionType.params.length;
if (callNumArgs < funcNumArgs) {
throw makeWrongNumberOfArguments(postfix, func, callNumArgs, funcNumArgs);
}
auto passSlice = postfix.arguments[0 .. funcNumArgs];
auto varArgsSlice = postfix.arguments[funcNumArgs .. $];
auto tinfoClass = lp.tiTypeInfo;
auto tr = buildTypeReference(/*#ref*/postfix.loc, tinfoClass, tinfoClass.name);
tr.loc = postfix.loc;
auto sexp = buildStatementExp(/*#ref*/loc);
auto numVarArgs = varArgsSlice.length;
ir.Exp idsSlice, argsSlice;
if (numVarArgs > 0) {
auto idsType = buildStaticArrayTypeSmart(/*#ref*/loc, varArgsSlice.length, tr);
auto argsType = buildStaticArrayTypeSmart(/*#ref*/loc, 0, buildVoid(/*#ref*/loc));
auto ids = buildVariableAnonSmartAtTop(lp.errSink, /*#ref*/loc, func.parsedBody, idsType, null);
auto args = buildVariableAnonSmartAtTop(lp.errSink, /*#ref*/loc, func.parsedBody, argsType, null);
int[] sizes;
size_t totalSize;
ir.Type[] types;
foreach (i, _exp; varArgsSlice) {
auto etype = getExpType(_exp);
auto mod = getModuleFromScope(/*#ref*/loc, current);
if (mod.magicFlagD &&
realType(etype).nodeType == ir.NodeType.Struct) {
warning(/*#ref*/_exp.loc, "passing struct to var-arg function.");
}
auto ididx = buildIndex(/*#ref*/loc, buildExpReference(/*#ref*/loc, ids, ids.name), buildConstantSizeT(/*#ref*/loc, lp.target, i));
buildExpStat(/*#ref*/loc, sexp, buildAssign(/*#ref*/loc, ididx, buildTypeidSmart(/*#ref*/loc, lp.tiTypeInfo, etype)));
// *(cast(T*)arr.ptr + totalSize) = exp;
auto argl = buildDeref(/*#ref*/loc, buildCastSmart(/*#ref*/loc, buildPtrSmart(/*#ref*/loc, etype),
buildAdd(/*#ref*/loc, buildArrayPtr(/*#ref*/loc, buildVoid(/*#ref*/loc),
buildExpReference(/*#ref*/loc, args, args.name)), buildConstantSizeT(/*#ref*/loc, lp.target, totalSize))));
buildExpStat(/*#ref*/loc, sexp, buildAssign(/*#ref*/loc, argl, _exp));
totalSize += size(lp.target, etype);
}
(cast(ir.StaticArrayType)args.type).length = totalSize;
idsSlice = buildSlice(/*#ref*/loc, buildExpReference(/*#ref*/loc, ids, ids.name));
argsSlice = buildSlice(/*#ref*/loc, buildExpReference(/*#ref*/loc, args, args.name));
} else {
auto idsType = buildArrayType(/*#ref*/loc, tr);
auto argsType = buildArrayType(/*#ref*/loc, buildVoid(/*#ref*/loc));
idsSlice = buildArrayLiteralSmart(/*#ref*/loc, idsType);
argsSlice = buildArrayLiteralSmart(/*#ref*/loc, argsType);
}
postfix.arguments = passSlice ~ idsSlice ~ argsSlice;
sexp.exp = postfix;
exp = sexp;
}
void lowerGlobalAALiteral(LanguagePass lp, ir.Scope current, ir.Module mod, ir.Variable var)
{
auto loc = var.loc;
auto gctor = buildGlobalConstructor(lp.errSink, /*#ref*/loc, mod.children, current, "__ctor");
ir.BinOp assign = buildAssign(/*#ref*/loc, var, var.assign);
buildExpStat(/*#ref*/loc, gctor.parsedBody, assign);
var.assign = null;
buildReturnStat(/*#ref*/loc, gctor.parsedBody);
}
/*!
* Lower an AA literal.
*
* Params:
* lp: The LanguagePass.
* current: The Scope where this code takes place.
* thisModule: The Module that this code is taking place in.
* exp: A reference to the relevant expression.
* assocArray: The AA literal to lower.
*/
void lowerAA(LanguagePass lp, ir.Scope current, ir.Module thisModule, ref ir.Exp exp,
ir.AssocArray assocArray, LlvmLowerer lowerer)
{
auto loc = exp.loc;
auto aa = cast(ir.AAType)getExpType(exp);
assert(aa !is null);
auto statExp = buildStatementExp(/*#ref*/loc);
auto aaNewFn = lp.aaNew;
auto bs = cast(ir.BlockStatement)current.node;
if (bs is null) {
auto func = cast(ir.Function)current.node;
if (func !is null) {
bs = func.parsedBody;
}
}
panicAssert(exp, bs !is null);
auto var = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
copyTypeSmart(/*#ref*/loc, aa), buildCall(/*#ref*/loc, aaNewFn, [
cast(ir.Exp)buildTypeidSmart(/*#ref*/loc, lp.tiTypeInfo, aa.value),
cast(ir.Exp)buildTypeidSmart(/*#ref*/loc, lp.tiTypeInfo, aa.key)
], aaNewFn.name)
);
foreach (pair; assocArray.pairs) {
auto key = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
copyTypeSmart(/*#ref*/loc, aa.key), pair.key
);
auto value = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, bs, statExp,
copyTypeSmart(/*#ref*/loc, aa.value), pair.value
);
lowerAAInsert(/*#ref*/loc, lp, thisModule, current, statExp,
aa, var, buildExpReference(/*#ref*/loc, key), buildExpReference(/*#ref*/loc, value),
lowerer, false, false
);
}
statExp.exp = buildExpReference(/*#ref*/loc, var);
exp = statExp;
}
/*!
* Rewrite Struct(args) to call their constructors.
*/
void lowerStructUnionConstructor(LanguagePass lp, ir.Scope current, ref ir.Exp exp, ir.BuiltinExp builtin)
{
auto agg = cast(ir.PODAggregate)realType(builtin.type);
if (agg is null || agg.constructors.length == 0) {
return;
}
auto postfix = cast(ir.Postfix)builtin.children[0];
auto loc = exp.loc;
auto ctor = builtin.functions[0];
auto sexp = buildStatementExp(/*#ref*/loc);
auto svar = buildVariableAnonSmart(lp.errSink, /*#ref*/loc, current, sexp, agg, null);
auto args = buildCast(/*#ref*/loc, buildVoidPtr(/*#ref*/loc), buildAddrOf(/*#ref*/loc,
buildExpReference(/*#ref*/loc, svar, svar.name))) ~ postfix.arguments;
auto ctorCall = buildCall(/*#ref*/loc, ctor, args);
buildExpStat(/*#ref*/loc, sexp, ctorCall);
sexp.exp = buildExpReference(/*#ref*/loc, svar, svar.name);
exp = sexp;
}
ir.Exp zeroVariableIfNeeded(LanguagePass lp, ir.Variable var)
{
auto s = .size(lp.target, var.type);
if (s < 64) {
return null;
}
auto loc = var.loc;
auto llvmMemset = lp.target.isP64 ? lp.llvmMemset64 : lp.llvmMemset32;
auto memset = buildExpReference(/*#ref*/loc, llvmMemset, llvmMemset.name);
auto ptr = buildCastToVoidPtr(/*#ref*/loc, buildAddrOf(/*#ref*/loc, buildExpReference(/*#ref*/loc, var, var.name)));
auto zero = buildConstantUbyte(/*#ref*/loc, 0);
auto size = buildConstantSizeT(/*#ref*/loc, lp.target, s);
auto alignment = buildConstantInt(/*#ref*/loc, 0);
auto isVolatile = buildConstantBool(/*#ref*/loc, false);
return buildCall(/*#ref*/loc, memset, [ptr, zero, size, alignment, isVolatile]);
}
void zeroVariablesIfNeeded(LanguagePass lp, ir.BlockStatement bs)
{
for (size_t i = 0; i < bs.statements.length; ++i) {
auto var = cast(ir.Variable)bs.statements[i];
if (var is null || var.assign !is null || var.specialInitValue) {
continue;
}
auto exp = zeroVariableIfNeeded(lp, var);
if (exp is null) {
continue;
}
var.noInitialise = true;
bs.statements = bs.statements[0 .. i+1] ~ buildExpStat(/*#ref*/exp.loc, exp) ~ bs.statements[i+1 .. $];
i++;
}
}
/*!
* Calls the correct functions where they need to be called to lower a module.
*/
class LlvmLowerer : ScopeManager, Pass
{
public:
LanguagePass lp;
ir.Module thisModule;
bool V_P64;
public:
this(LanguagePass lp)
{
this.lp = lp;
this.V_P64 = lp.ver.isP64;
super(lp.errSink);
}
/*!
* Perform all lower operations on a given module.
*
* Params:
* m: The module to lower.
*/
override void transform(ir.Module m)
{
thisModule = m;
accept(m, this);
}
override void close()
{
}
override Status enter(ir.BlockStatement bs)
{
super.enter(bs);
panicAssert(bs, functionStack.length > 0);
for (size_t i = 0; i < bs.statements.length; ++i) {
auto as = cast(ir.AssertStatement)bs.statements[i];
if (as !is null && !as.isStatic) {
bs.statements[i] = lowerAssertIf(lp, current, as);
}
auto fes = cast(ir.ForeachStatement)bs.statements[i];
if (fes !is null) {
bs.statements[i] = lowerForeach(fes, lp, current);
}
}
insertBinOpAssignsForNestedVariableAssigns(lp, bs);
zeroVariablesIfNeeded(lp, bs);
return Continue;
}
override Status enter(ir.Function func)
{
ir.Function parent;
if (functionStack.length == 1) {
parent = functionStack.peek();
} else {
assert(functionStack.length == 0);
}
nestLowererFunction(lp, parent, func);
super.enter(func);
return Continue;
}
override Status leave(ir.ThrowStatement t)
{
lowerThrow(lp, t);
return Continue;
}
override Status enter(ref ir.Exp exp, ir.BinOp binOp)
{
switch(binOp.op) with(ir.BinOp.Op) {
case AddAssign:
case SubAssign:
case MulAssign:
case DivAssign:
case ModAssign:
case AndAssign:
case OrAssign:
case XorAssign:
case CatAssign:
case LSAssign: // <<=
case SRSAssign: // >>=
case RSAssign: // >>>=
case PowAssign:
case Assign:
auto asPostfix = cast(ir.Postfix)binOp.left;
if (asPostfix is null) {
return Continue;
}
auto leftType = getExpType(asPostfix.child);
if (leftType !is null &&
leftType.nodeType == ir.NodeType.AAType &&
asPostfix.op == ir.Postfix.Op.Index) {
acceptExp(/*#ref*/asPostfix.child, this);
acceptExp(/*#ref*/asPostfix.arguments[0], this);
acceptExp(/*#ref*/binOp.right, this);
if (binOp.op == ir.BinOp.Op.Assign) {
lowerAssignAA(lp, current, thisModule, /*#ref*/exp, binOp, asPostfix,
cast(ir.AAType)leftType, this);
} else {
lowerOpAssignAA(lp, current, thisModule, /*#ref*/exp, binOp, asPostfix,
cast(ir.AAType)leftType, this);
}
return ContinueParent;
}
break;
default:
break;
}
return Continue;
}
override Status enter(ir.Variable var)
{
if (functionStack.length == 0 && var.assign !is null &&
var.assign.nodeType == ir.NodeType.AssocArray) {
lowerGlobalAALiteral(lp, current, thisModule, var);
}
return Continue;
}
override Status leave(ref ir.Exp exp, ir.BinOp binOp)
{
/*
* We do this on the leave function so we know that
* any children have been lowered as well.
*/
switch(binOp.op) {
case ir.BinOp.Op.Assign:
lowerAssign(lp, thisModule, /*#ref*/exp, binOp);
break;
case ir.BinOp.Op.Cat:
lowerCat(lp, thisModule, /*#ref*/exp, binOp);
break;
case ir.BinOp.Op.CatAssign:
lowerCatAssign(lp, thisModule, /*#ref*/exp, binOp);
break;
case ir.BinOp.Op.NotEqual:
case ir.BinOp.Op.Equal:
lowerEqual(lp, thisModule, /*#ref*/exp, binOp);
break;
default:
break;
}
return Continue;
}
override Status enter(ref ir.Exp exp, ir.BuiltinExp builtin)
{
lowerBuiltin(lp, current, /*#ref*/exp, builtin, this);
return Continue;
}
override Status leave(ref ir.Exp exp, ir.ArrayLiteral al)
{
if (al.exps.length > 0 && functionStack.length > 0) {
lowerArrayLiteral(lp, current, /*#ref*/exp, al);
}
return Continue;
}
override Status leave(ref ir.Exp exp, ir.AssocArray assocArray)
{
lowerAA(lp, current, thisModule, /*#ref*/exp, assocArray, this);
return Continue;
}
override Status leave(ref ir.Exp exp, ir.Unary uexp)
{
lowerInterfaceCast(/*#ref*/exp.loc, lp, current, uexp, /*#ref*/exp);
if (functionStack.length > 0) {
lowerArrayCast(/*#ref*/exp.loc, lp, current, uexp, /*#ref*/exp);
}
return Continue;
}
override Status leave(ref ir.Exp exp, ir.Postfix postfix)
{
auto oldExp = exp;
lowerPostfix(lp, current, thisModule, /*#ref*/exp,
functionStack.length == 0 ? null : functionStack.peek(), postfix, this);
return Continue;
}
override Status leave(ref ir.Exp exp, ir.PropertyExp prop)
{
lowerProperty(lp, /*#ref*/exp, prop);
auto pfix = cast(ir.Postfix)exp;
if (pfix !is null) {
lowerPostfix(lp, current, thisModule, /*#ref*/exp,
functionStack.length == 0 ? null : functionStack.peek(), pfix, this);
}
return Continue;
}
override Status leave(ref ir.Exp exp, ir.ComposableString cs)
{
ir.Function currentFunc = functionStack.length == 0 ? null : functionStack.peek();
lowerComposableString(lp, current, currentFunc, /*#ref*/exp, cs, this);
return Continue;
}
override Status enter(ref ir.Exp exp, ir.StructLiteral literal)
{
if (functionStack.length == 0) {
// Global struct literals can use LLVM's native handling.
return Continue;
}
lowerStructLiteral(lp, current, /*#ref*/exp, literal);
return Continue;
}
override Status leave(ref ir.Exp exp, ir.AccessExp ae)
{
// This lists the cases where we need to rewrite (reversed).
auto child = cast(ir.Postfix) ae.child;
if (child is null || child.op != ir.Postfix.Op.Call) {
return Continue;
}
auto type = realType(getExpType(ae.child));
if (type.nodeType != ir.NodeType.Union &&
type.nodeType != ir.NodeType.Struct) {
return Continue;
}
lowerStructLookupViaFunctionCall(lp, current, /*#ref*/exp, ae, type);
return Continue;
}
override Status visit(ref ir.Exp exp, ir.ExpReference eref)
{
ir.Function currentFunc = functionStack.length == 0 ? null : functionStack.peek();
bool replaced = replaceNested(lp, /*#ref*/exp, eref, currentFunc);
if (replaced) {
return Continue;
}
auto func = cast(ir.Function) eref.decl;
if (func is null) {
return Continue;
}
if (functionStack.length == 0 || functionStack.peek().nestedVariable is null) {
return Continue;
}
lowerExpReference(functionStack.borrowUnsafe(), /*#ref*/exp, eref, func);
return Continue;
}
override Status enter(ref ir.Exp exp, ir.StringImport simport)
{
lowerStringImport(lp.driver, /*#ref*/exp, simport);
return Continue;
}
}
|
D
|
/**
* 微信摇一摇周边-设备管理-申请设备ID
*
*
*/
module hunt.wechat.bean.shakearound.device.applyid;
public import hunt.wechat.bean.shakearound.device.applyid.DeviceApplyId;
public import hunt.wechat.bean.shakearound.device.applyid.DeviceApplyIdResult;
public import hunt.wechat.bean.shakearound.device.applyid.DeviceApplyIdResultData;
|
D
|
/mnt/c/Users/knzk/OneDrive/4E/experiment/12_/min_dist_method/target/debug/deps/min_dist_method-6f43b6d8e541b2f6.rmeta: src/main.rs
/mnt/c/Users/knzk/OneDrive/4E/experiment/12_/min_dist_method/target/debug/deps/min_dist_method-6f43b6d8e541b2f6.d: src/main.rs
src/main.rs:
|
D
|
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/Data+Hex.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NestedData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NotFound.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/File.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/MediaType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CoreError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/BasicKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/Data+Hex~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NestedData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NotFound.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/File.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/MediaType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CoreError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/BasicKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/Data+Hex~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NestedData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NotFound.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/File.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/MediaType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CoreError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/BasicKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/Data+Hex~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NestedData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Thread+Async.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/NotFound.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Reflectable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/File.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/MediaType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/OptionalType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Process+Execute.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/HeaderValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/FutureEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CoreError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/String+Utilities.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/DataCoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/Data+Hex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/core/Sources/Core/BasicKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE
298.399994 61.7000008 5.9000001 0 58 62 -19.6000004 116.099998 141 3.29999995 8 0.962780352 sediments, sandstones, siltstones
310.200012 40.5999985 4.69999981 120.900002 56 59 -33.2000008 151.100006 241 8.60000038 8.60000038 0.976048249 extrusives
306.399994 74.1999969 4.30000019 0 52 55 -31.8999996 151.300003 8785 5.9000001 5.9000001 0.979871906 extrusives, basalts
333.200012 64.6999969 6.5999999 0 52 55 -31.8999996 151.300003 8786 10.3000002 11.6999998 0.953868769 extrusives, basalts
219.300003 -4.19999981 9.39999962 22.3999996 56 65 -10 121 7800 4.9000001 9.60000038 0.799748903 extrusives, basalts, andesites
-65.400002 61.2999992 1.39999998 297 50 70 -31.6000004 145.600006 9339 2.20000005 2.20000005 0.822826958 sediments, saprolite
264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 0.402252223 extrusives, intrusives
346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 0.525327413 sediments
333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 0.525327413 sediments, tillite
317 57 5 200 35 100 -30.5 139.300003 1165 9 10 0.580672042 sediments, redbeds
329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 0.232368412 sediments, sandstone, tillite
223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 0.451146086 extrusives
320 63 9 15.5 34 65 -38 145.5 1854 16 16 0.643441557 extrusives
314 70 6 132 48 50 -33.2999992 151.199997 1844 9 10 0.711558173 intrusives, basalt
317 63 14 16 23 56 -32.5 151 1840 20 20 0.429513194 extrusives, basalts
302.700012 66.8000031 6.80000019 35 34 65 -38 145.5 1819 10.8000002 12.1000004 0.676980209 extrusives
305 73 17 29 23 56 -42 147 1821 25 29 0.369121588 extrusives, basalts
305.600006 70.5 3.5999999 48.5 52 54 -32 151.399994 1892 5.30000019 5.30000019 0.985805384 extrusives
274 66 27.6000004 8.60000038 25 65 -41.2999992 145.899994 1873 39.7999992 46.9000015 0.267001791 intrusives, granite
321 64 6 27.5 25 65 -35.5999985 137.5 1874 10 11 0.636558173 sediments
269 40 30.996521 0 50 300 -32.5999985 151.5 1868 0 0 0.0851177871 extrusives, andesites
294 75 11 7 25 65 -41.0999985 146.100006 1871 16.2999992 18.8999996 0.557114083 sediments, sandstone
315 66 10.5 18 25 65 -41 145.5 1872 18.2000008 19.6000004 0.566352269 extrusives, sediments
298 58.7999992 2.4000001 0 35 65 -27 141.5 1972 3.79999995 3.79999995 0.726974119 sediments, weathered
314 66 5.5999999 161 48 50 -33.2999992 151.199997 1969 8.5 9.80000019 0.716341973 intrusives, basalt
297.200012 59.2000008 6 0 50 70 -30.5 151.5 1964 9.10000038 9.89999962 0.786558173 sediments, weathered
310.899994 68.5 5.19999981 0 40 60 -35 150 1927 5.19999981 5.19999981 0.745840415 extrusives, basalts
271 63 2.9000001 352 50 80 -34 151 1595 3.5 4.5 0.707408999 intrusives
278 66 2.0999999 333 48 50 -33.2999992 151.199997 1596 2.5999999 3.29999995 0.745123932 intrusives, basalt
318 37 6.80000019 41 56 59 -33.2000008 151.100006 1597 13.1999998 13.3999996 0.951173758 intrusives
272 66 4.80000019 191 60 100 -33.7000008 151.100006 1592 5.80000019 7.4000001 0.512544315 intrusives
|
D
|
/*
Copyright (c) 2011-2021 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/**
* Quaternions
*
* Copyright: Timur Gafarov 2011-2021.
* License: $(LINK2 boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Timur Gafarov
*/
module dlib.math.quaternion;
import std.math;
import std.traits;
import dlib.math.vector;
import dlib.math.matrix;
import dlib.math.utils;
/**
* Quaternion representation
*/
struct Quaternion(T)
{
Vector!(T,4) vectorof;
alias vectorof this;
this(T x, T y, T z, T w)
{
vectorof = Vector!(T,4)(x, y, z, w);
}
this(T[4] arr)
{
vectorof.arrayof = arr;
}
this(Vector!(T,4) v)
{
vectorof = v;
}
this(Vector!(T,3) v, T neww)
{
vectorof = Vector!(T,4)(v.x, v.y, v.z, neww);
}
/**
* Identity quaternion
*/
static Quaternion!(T) identity()
{
return Quaternion!(T)(T(0), T(0), T(0), T(1));
}
/**
* Quaternion!(T) + Quaternion!(T)
*/
Quaternion!(T) opBinary(string op)(Quaternion!(T) q) if (op == "+")
{
return Quaternion!(T)(x + q.x, y + q.y, z + q.z, w + q.w);
}
/**
* Quaternion!(T) += Quaternion!(T)
*/
Quaternion!(T) opOpAssign(string op)(Quaternion!(T) q) if (op == "+")
{
this = this + q;
return this;
}
/**
* Quaternion!(T) - Quaternion!(T)
*/
Quaternion!(T) opBinary(string op)(Quaternion!(T) q) if (op == "-")
{
return Quaternion!(T)(x - q.x, y - q.y, z - q.z, w - q.w);
}
/**
* Quaternion!(T) -= Quaternion!(T)
*/
Quaternion!(T) opOpAssign(string op)(Quaternion!(T) q) if (op == "-")
{
this = this - q;
return this;
}
/**
* Quaternion!(T) * Quaternion!(T)
*/
Quaternion!(T) opBinary(string op)(Quaternion!(T) q) if (op == "*")
{
return Quaternion!(T)
(
(x * q.w) + (w * q.x) + (y * q.z) - (z * q.y),
(y * q.w) + (w * q.y) + (z * q.x) - (x * q.z),
(z * q.w) + (w * q.z) + (x * q.y) - (y * q.x),
(w * q.w) - (x * q.x) - (y * q.y) - (z * q.z)
);
}
/**
* Quaternion!(T) *= Quaternion!(T)
*/
Quaternion!(T) opOpAssign(string op)(Quaternion!(T) q) if (op == "*")
{
this = this * q;
return this;
}
/**
* Quaternion!(T) * T
*/
Quaternion!(T) opBinary(string op)(T k) if (op == "*")
{
return Quaternion!(T)(x * k, y * k, z * k, w * k);
}
/**
* Quaternion!(T) *= T
*/
Quaternion!(T) opOpAssign(string op)(T k) if (op == "*")
{
x *= k;
y *= k;
z *= k;
w *= k;
return this;
}
/**
* T * Quaternion!(T)
*/
Quaternion!(T) opBinaryRight(string op) (T k) if (op == "*")
{
return Quaternion!(T)(x * k, y * k, z * k, w * k);
}
/**
* Quaternion!(T) / T
*/
Quaternion!(T) opBinary(string op)(T k) if (op == "/")
{
T oneOverK = 1.0 / k;
return Quaternion!(T)
(
x * oneOverK,
y * oneOverK,
z * oneOverK,
w * oneOverK
);
}
/**
* Quaternion!(T) /= T
*/
Quaternion!(T) opOpAssign(string op)(T k) if (op == "/")
{
T oneOverK = 1.0 / k;
x *= oneOverK;
y *= oneOverK;
z *= oneOverK;
w *= oneOverK;
return this;
}
/**
* Quaternion!(T) * Vector!(T,3)
*/
Quaternion!(T) opBinary(string op)(Vector!(T,3) v) if (op == "*")
{
return Quaternion!(T)
(
(w * v.x) + (y * v.z) - (z * v.y),
(w * v.y) + (z * v.x) - (x * v.z),
(w * v.z) + (x * v.y) - (y * v.x),
- (x * v.x) - (y * v.y) - (z * v.z)
);
}
/**
* Quaternion!(T) *= Vector!(T,3)
*/
Quaternion!(T) opOpAssign(string op)(Vector!(T,3) v) if (op == "*")
{
this = this * v;
return this;
}
/**
* Conjugate
* A quaternion with the opposite rotation
*/
Quaternion!(T) conjugate()
{
return Quaternion!(T)(-x, -y, -z, w);
}
alias conj = conjugate;
/**
* Compute the W component of a unit length quaternion
*/
void computeW()
{
T t = T(1.0) - (x * x) - (y * y) - (z * z);
if (t < 0.0)
w = 0.0;
else
w = -(t.sqrt);
}
/**
* Rotate a point by quaternion
*/
Vector!(T,3) rotate(Vector!(T,3) v)
do
{
Quaternion!(T) qf = this * v * this.conj;
return Vector!(T,3)(qf.x, qf.y, qf.z);
}
Vector!(T,3) opBinaryRight(string op) (Vector!(T,3) v) if (op == "*")
{
Quaternion!(T) qf = this * v * this.conj;
return Vector!(T,3)(qf.x, qf.y, qf.z);
}
static if (isNumeric!(T))
{
/**
* Normalized version
*/
Quaternion!(T) normalized()
{
Quaternion!(T) q = this;
q.normalize();
return q;
}
/**
* Convert to 4x4 matrix
*/
Matrix!(T,4) toMatrix4x4()
do
{
auto mat = Matrix!(T,4).identity;
mat[0] = 1.0 - 2.0 * (y * y + z * z);
mat[1] = 2.0 * (x * y + z * w);
mat[2] = 2.0 * (x * z - y * w);
mat[3] = 0.0;
mat[4] = 2.0 * (x * y - z * w);
mat[5] = 1.0 - 2.0 * (x * x + z * z);
mat[6] = 2.0 * (z * y + x * w);
mat[7] = 0.0;
mat[8] = 2.0 * (x * z + y * w);
mat[9] = 2.0 * (y * z - x * w);
mat[10] = 1.0 - 2.0 * (x * x + y * y);
mat[11] = 0.0;
mat[12] = 0.0;
mat[13] = 0.0;
mat[14] = 0.0;
mat[15] = 1.0;
return mat;
}
/**
* Convert to 3x3 matrix
*/
Matrix!(T,3) toMatrix3x3()
do
{
auto mat = Matrix!(T,3).identity;
mat[0] = 1.0 - 2.0 * (y * y + z * z);
mat[1] = 2.0 * (x * y + z * w);
mat[2] = 2.0 * (x * z - y * w);
mat[3] = 2.0 * (x * y - z * w);
mat[4] = 1.0 - 2.0 * (x * x + z * z);
mat[5] = 2.0 * (z * y + x * w);
mat[6] = 2.0 * (x * z + y * w);
mat[7] = 2.0 * (y * z - x * w);
mat[8] = 1.0 - 2.0 * (x * x + y * y);
return mat;
}
/**
* Setup the quaternion to perform a rotation,
* given the angular displacement in matrix form
*/
static Quaternion!(T) fromMatrix(Matrix!(T,4) m)
do
{
Quaternion!(T) q;
T trace = m.a11 + m.a22 + m.a33 + 1.0;
if (trace > 0.0001)
{
T s = 0.5 / sqrt(trace);
q.w = 0.25 / s;
q.x = (m.a23 - m.a32) * s;
q.y = (m.a31 - m.a13) * s;
q.z = (m.a12 - m.a21) * s;
}
else
{
if ((m.a11 > m.a22) && (m.a11 > m.a33))
{
T s = 0.5 / sqrt(1.0 + m.a11 - m.a22 - m.a33);
q.x = 0.25 / s;
q.y = (m.a21 + m.a12) * s;
q.z = (m.a31 + m.a13) * s;
q.w = (m.a32 - m.a23) * s;
}
else if (m.a22 > m.a33)
{
T s = 0.5 / sqrt(1.0 + m.a22 - m.a11 - m.a33);
q.x = (m.a21 + m.a12) * s;
q.y = 0.25 / s;
q.z = (m.a32 + m.a23) * s;
q.w = (m.a31 - m.a13) * s;
}
else
{
T s = 0.5 / sqrt(1.0 + m.a33 - m.a11 - m.a22);
q.x = (m.a31 + m.a13) * s;
q.y = (m.a32 + m.a23) * s;
q.z = 0.25 / s;
q.w = (m.a21 - m.a12) * s;
}
}
return q;
}
/**
* Setup the quaternion to perform a rotation,
* given the orientation in XYZ-Euler angles format (in radians)
*/
static Quaternion!(T) fromEulerAngles(Vector!(T,3) e)
do
{
Quaternion!(T) q;
T sr = sin(e.x * 0.5);
T cr = cos(e.x * 0.5);
T sp = sin(e.y * 0.5);
T cp = cos(e.y * 0.5);
T sy = sin(e.z * 0.5);
T cy = cos(e.z * 0.5);
q.w = (cy * cp * cr) + (sy * sp * sr);
q.x = -(sy * sp * cr) + (cy * cp * sr);
q.y = (cy * sp * cr) + (sy * cp * sr);
q.z = -(cy * sp * sr) + (sy * cp * cr);
return q;
}
/**
* Setup the Euler angles, given a rotation Quaternion.
* Returned x,y,z are in radians
*/
Vector!(T,3) toEulerAngles()
do
{
Vector!(T,3) e;
e.y = asin(2.0 * ((x * z) + (w * y)));
T cy = cos(e.y);
T oneOverCosY = 1.0 / cy;
if (fabs(cy) > 0.001)
{
e.x = atan2(2.0 * ((w * x) - (y * z)) * oneOverCosY,
(1.0 - 2.0 * (x*x + y*y)) * oneOverCosY);
e.z = atan2(2.0 * ((w * z) - (x * y)) * oneOverCosY,
(1.0 - 2.0 * (y*y + z*z)) * oneOverCosY);
}
else
{
e.x = 0.0;
e.z = atan2(2.0 * ((x * y) + (w * z)),
1.0 - 2.0 * (x*x + z*z));
}
return e;
}
/**
* Return the rotation angle (in radians)
*/
T rotationAngle()
do
{
return 2.0 * acos(w);
}
/**
* Return the rotation axis
*/
Vector!(T,3) rotationAxis()
do
{
T s = sqrt(1.0 - (w * w));
if (s <= 0.0f)
return Vector!(T,3)(x, y, z);
else
return Vector!(T,3)(x / s, y / s, z / s);
}
/**
* Quaternion as an angular velocity
*/
Vector!(T,3) generator()
do
{
T s = sqrt(1.0 - (w * w));
Vector!(T,3) axis;
if (s <= 0.0)
axis = Vector!(T,3)(x, y, z);
else
axis = Vector!(T,3)(x * s, y * s, z * s);
T angle = 2.0 * atan2(s, w);
return axis * angle;
}
}
}
/**
* Setup a quaternion to rotate about world axis.
* Theta must be in radians
*/
Quaternion!(T) rotationQuaternion(T)(uint rotaxis, T theta)
{
Quaternion!(T) res = Quaternion!(T).identity;
T thetaOver2 = theta * 0.5;
switch (rotaxis)
{
case Axis.x:
res.w = cos(thetaOver2);
res.x = sin(thetaOver2);
res.y = 0.0;
res.z = 0.0;
break;
case Axis.y:
res.w = cos(thetaOver2);
res.x = 0.0;
res.y = sin(thetaOver2);
res.z = 0.0;
break;
case Axis.z:
res.w = cos(thetaOver2);
res.x = 0.0;
res.y = 0.0;
res.z = sin(thetaOver2);
break;
default:
assert(0);
}
return res;
}
/**
* Setup a quaternion to rotate about specified axis.
* Theta must be in radians
*/
Quaternion!(T) rotationQuaternion(T)(Vector!(T,3) rotaxis, T theta)
{
Quaternion!(T) res;
T thetaOver2 = theta * 0.5;
T sinThetaOver2 = sin(thetaOver2);
res.w = cos(thetaOver2);
res.x = rotaxis.x * sinThetaOver2;
res.y = rotaxis.y * sinThetaOver2;
res.z = rotaxis.z * sinThetaOver2;
return res;
}
/**
* Setup a quaternion to represent rotation
* between two unit-length vectors
*/
Quaternion!(T) rotationBetween(T)(Vector!(T,3) a, Vector!(T,3) b)
{
Quaternion!(T) q;
float d = dot(a, b);
float angle = acos(d);
Vector!(T,3) axis;
if (d < -0.9999)
{
Vector!(T,3) c;
if (a.y != 0.0 || a.z != 0.0)
c = Vector!(T,3)(1, 0, 0);
else
c = Vector!(T,3)(0, 1, 0);
axis = cross(a, c);
axis.normalize();
q = rotationQuaternion(axis, angle);
}
else if (d > 0.9999)
{
q = Quaternion!(T).identity;
}
else
{
axis = cross(a, b);
axis.normalize();
q = rotationQuaternion(axis, angle);
}
return q;
}
/**
* Quaternion logarithm
*/
Quaternion!(T) log(T)(Quaternion!(T) q)
{
Quaternion!(T) res;
res.w = 0.0;
if (fabs(q.w) < 1.0)
{
T theta = acos(q.w);
T sin_theta = sin(theta);
if (fabs(sin_theta) > 0.00001)
{
T thetaOverSinTheta = theta / sin_theta;
res.x = q.x * thetaOverSinTheta;
res.y = q.y * thetaOverSinTheta;
res.z = q.z * thetaOverSinTheta;
return res;
}
}
res.x = q.x;
res.y = q.y;
res.z = q.z;
return res;
}
/**
* Quaternion exponential
*/
Quaternion!(T) exp(T) (Quaternion!(T) q)
{
T theta = sqrt(dot(q, q));
T sin_theta = sin(theta);
Quaternion!(T) res;
res.w = cos(theta);
if (fabs(sin_theta) > 0.00001)
{
T sinThetaOverTheta = sin_theta / theta;
res.x = q.x * sinThetaOverTheta;
res.y = q.y * sinThetaOverTheta;
res.z = q.z * sinThetaOverTheta;
}
else
{
res.x = q.x;
res.y = q.y;
res.z = q.z;
}
return res;
}
/**
* Quaternion exponentiation
*/
Quaternion!(T) pow(T) (Quaternion!(T) q, T exponent)
{
if (fabs(q.w) > 0.9999)
return q;
T alpha = acos(q.w);
T newAlpha = alpha * exponent;
Vector!(T,3) n = Vector!(T,3)(q.x, q.y, q.z);
n *= sin(newAlpha) / sin(alpha);
return new Quaternion!(T)(n, cos(newAlpha));
}
/**
* Spherical linear interpolation
*/
Quaternion!(T) slerp(T)(
Quaternion!(T) q0,
Quaternion!(T) q1,
T t)
{
if (t <= 0.0) return q0;
if (t >= 1.0) return q1;
T cosOmega = dot(q0, q1);
T q1w = q1.w;
T q1x = q1.x;
T q1y = q1.y;
T q1z = q1.z;
if (cosOmega < 0.0)
{
q1w = -q1w;
q1x = -q1x;
q1y = -q1y;
q1z = -q1z;
cosOmega = -cosOmega;
}
assert (cosOmega < 1.1);
T k0, k1;
if (cosOmega > 0.9999)
{
k0 = 1.0 - t;
k1 = t;
}
else
{
T sinOmega = sqrt(1.0 - (cosOmega * cosOmega));
T omega = atan2(sinOmega, cosOmega);
T oneOverSinOmega = 1.0 / sinOmega;
k0 = sin((1.0 - t) * omega) * oneOverSinOmega;
k1 = sin(t * omega) * oneOverSinOmega;
}
Quaternion!(T) res = Quaternion!(T)
(
(k0 * q0.x) + (k1 * q1x),
(k0 * q0.y) + (k1 * q1y),
(k0 * q0.z) + (k1 * q1z),
(k0 * q0.w) + (k1 * q1w)
);
return res;
}
/**
* Spherical cubic interpolation
*/
Quaternion!(T) squad(T)(
Quaternion!(T) q0,
Quaternion!(T) qa,
Quaternion!(T) qb,
Quaternion!(T) q1,
T t)
{
T slerp_t = 2.0 * t * (1.0 - t);
Quaternion!(T) slerp_q0 = slerp(q0, q1, t);
Quaternion!(T) slerp_q1 = slerp(qa, qb, t);
return slerp(slerp_q0, slerp_q1, slerp_t);
}
/**
* Compute intermediate quaternions for building spline segments
*/
Quaternion!(T) intermediate(T)(
Quaternion!(T) qprev,
Quaternion!(T) qcurr,
Quaternion!(T) qnext,
ref Quaternion!(T) qa,
ref Quaternion!(T) qb)
in
{
assert (dot(qprev, qprev) <= 1.0001);
assert (dot(qcurr, qcurr) <= 1.0001);
}
do
{
Quaternion!(T) inv_prev = qprev.conj;
Quaternion!(T) inv_curr = qcurr.conj;
Quaternion!(T) p0 = inv_prev * qcurr;
Quaternion!(T) p1 = inv_curr * qnext;
Quaternion!(T) arg = (log(p0) - log(p1)) * 0.25;
qa = qcurr * exp( arg);
qb = qcurr * exp(-arg);
}
/*
* Predefined quaternion type aliases
*/
/// Alias for single precision Quaternion
alias Quaternionf = Quaternion!(float);
/// Alias for double precision Quaternion
alias Quaterniond = Quaternion!(double);
|
D
|
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Fluent.build/Preparation/Database+Preparation.swift.o : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Database.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Driver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Entity/Entity.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Filters.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/MemoryDriver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Database+Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Migration.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/PreparationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Action.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Comparison.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Filter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Join.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Limit.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Scope.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Children.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Parent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/RelationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Siblings.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Database+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Creator.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Field.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Modifier.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Fluent.build/Database+Preparation~partial.swiftmodule : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Database.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Driver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Entity/Entity.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Filters.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/MemoryDriver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Database+Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Migration.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/PreparationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Action.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Comparison.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Filter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Join.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Limit.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Scope.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Children.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Parent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/RelationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Siblings.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Database+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Creator.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Field.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Modifier.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Fluent.build/Database+Preparation~partial.swiftdoc : /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Database.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Database/Driver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Entity/Entity.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Filters.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/Memory+Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Memory/MemoryDriver.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Database+Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Migration.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/Preparation.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Preparation/PreparationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Action.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Comparison.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Filter.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Group.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Join.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Limit.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Scope.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Query/Sort.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Children.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Parent.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/RelationError.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Relations/Siblings.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Database+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Creator.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Field.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema+Modifier.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Schema/Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Query.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL+Schema.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQL.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/SQL/SQLSerializer.swift /Users/okasho/serverProject/tryswift/helloworld/swift/Packages/Fluent-1.4.1/Sources/Fluent/Utilities/Fluent+Node.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/helloworld/swift/.build/debug/Polymorphic.swiftmodule
|
D
|
// https://issues.dlang.org/show_bug.cgi?id=16685
struct Id { ushort value; }
enum Id x = Id(5);
struct S(ushort A) {}
alias CannotCreateFromValue = S!(x.value);
|
D
|
module graphic.cutbit;
import std.algorithm; // max(-x, 0) in drawDirectlyToScreen()
import std.string; // format
public import basics.rect;
import basics.alleg5;
import basics.help; // positiveMod
import basics.matrix; // which frames exist?
import graphic.color;
import graphic.torbit;
import graphic.textout; // write error message instead of drawing bitmap
import file.filename;
import file.language;
import file.log; // log bad filename when trying to load a bitmap
class Cutbit {
private:
Albit bitmap;
int _xl;
int _yl;
int _xfs; // number of x-frames existing: xf in the interval [0, _xfs[
int _yfs; // number of y-frames existing
Matrix!bool _existingFrames;
public:
this(Cutbit cb)
{
if (! cb) return;
_xl = cb._xl;
_yl = cb._yl;
_xfs = cb._xfs;
_yfs = cb._yfs;
_existingFrames = new Matrix!bool (cb._existingFrames);
if (cb.bitmap) {
bitmap = albitCreate(al_get_bitmap_width (cb.bitmap),
al_get_bitmap_height(cb.bitmap));
auto target = TargetBitmap(bitmap);
al_draw_bitmap(cast (Albit) cb.bitmap, 0, 0, 0);
assert(bitmap);
}
}
// Takes ownership of the argument bitmap!
this(Albit bit, const bool cut = true)
{
bitmap = bit;
if (! bitmap) return;
if (cut) cutBitmap();
else {
_xl = al_get_bitmap_width (bitmap);
_yl = al_get_bitmap_height(bitmap);
_xfs = 1;
_yfs = 1;
_existingFrames = new Matrix!bool(1, 1);
_existingFrames.set(0, 0, true);
}
}
this(const Filename fn, const bool cut = true)
{
// Try loading the file. If not found, don't crash, but log.
bitmap = al_load_bitmap(fn.stringzForReading);
if (bitmap)
al_convert_mask_to_alpha(bitmap, color.pink);
this(bitmap, cut);
}
~this() { dispose(); }
void dispose()
{
if (bitmap) {
al_destroy_bitmap(bitmap);
bitmap = null;
}
}
bool opEquals(const Cutbit rhs) const { return bitmap == rhs.bitmap; }
@property bool valid() const { return bitmap != null; }
@property Albit albit() const { return cast (Albit) bitmap; }
// get size of a single frame, not necessarily size of entire bitmap
@property int xl() const { return _xl; }
@property int yl() const { return _yl; }
@property Point len() const { return Point(_xl, _yl); }
@property int xfs() const { return _xfs; }
@property int yfs() const { return _yfs; }
// These two are slow, consider frameExists() instead
// or lock the Cutbit's underlying Allegro bitmap yourself.
Alcol get_pixel(in Point pixel) const { return get_pixel(0, 0, pixel); }
Alcol get_pixel(int fx, int fy, in Point p) const
{
// frame doesn't exist, or pixel doesn't exist in the frame
if (fx < 0 || fy < 0 || fx >= _xfs || fy >= _yfs
|| p.x < 0 || p.y < 0 || p.x >= _xl || p.y >= _yl) {
return color.bad;
}
// otherwise, return the found color
else if (_xfs == 1 && _yfs == 1)
return al_get_pixel(cast (Albit) bitmap, p.x, p.y);
else return al_get_pixel(cast (Albit) bitmap, fx * (_xl+1) + 1 + p.x,
fy * (_yl+1) + 1 + p.y);
}
// Checks whether the given frame contains interesting image data,
// instead of being marked as nonexistant by being filled with the
// already-detected frame/grid color.
// This is very fast, it uses the cached data in RAM. It's much better
// to consult this instead of querying for pixels later inside frames.
bool frameExists(in int fx, in int fy) const
{
if (fx < 0 || fx >= _xfs
|| fy < 0 || fy >= _yfs) return false;
else return _existingFrames.get(fx, fy);
}
// Intended for free-form drawing without effect on land.
// Interactive objects and the flying pickaxe are drawn with this.
// (rot) (either int or double) means how many ccw quarter turns.
// (scal) can be set to 0 or 1 when one doesn't wish to rescale. 0 is fast
void draw(
const Point targetCorner = Point(0, 0),
const int xf = 0,
const int yf = 0,
const bool mirr = false,
const double rot = 0,
const double scal = 0) const
{
if (bitmap && xf >= 0 && yf >= 0 && xf < _xfs && yf < _yfs) {
Albit sprite = create_sub_bitmap_for_frame(xf, yf);
scope (exit)
al_destroy_bitmap(sprite);
sprite.drawToTargetTorbit(targetCorner, mirr, rot, scal);
}
// no frame inside the cutbit has been specified, or the cutbit
// has a null bitmap
else {
drawMissingFrameError(targetCorner, xf, yf);
}
}
// This should only be used by the mouse cursor, which draws even on top
// of the gui torbit. Rotation, mirroring, and scaling is not offered.
void drawToCurrentAlbitNotTorbit(in Point targetCorner,
in int xf = 0, in int yf = 0) const
{
if (xf < 0 || xf >= _xfs
|| yf < 0 || yf >= _yfs) return;
// usually, select only the correct frame. If we'd draw off the screen
// to the left or top, instead do extra cutting by passing > 0 to the
// latter two args.
Albit sprite = create_sub_bitmap_for_frame(xf, yf,
max(-targetCorner.x, 0), max(-targetCorner.y, 0));
scope (exit)
al_destroy_bitmap(sprite);
al_draw_bitmap(sprite, max(0, targetCorner.x),
max(0, targetCorner.y), 0);
}
private:
void drawMissingFrameError(in Point toCorner, in int fx, in int fy) const
{
string str = "File N/A";
Alcol col = color.cbBadBitmap;
if (bitmap) {
str = format("(%d,%d)", fx, fy);
col = color.cbBadFrame;
}
drawText(djvuS, str, toCorner.x, toCorner.y, col);
}
// this is used by the first draw(), and by drawDirectlyToScreen()
Albit create_sub_bitmap_for_frame(
in int xf, in int yf,
in int xec = 0, // extra cutting from top or left
in int yec = 0) const
in {
assert (xf >= 0 && xf < _xfs);
assert (yf >= 0 && yf < _yfs);
assert (xec >= 0 && xec < _xl); // _xl, _yl are either all the bitmap, or
assert (yec >= 0 && yec < _xl); // the size of a single frame without grid
}
body {
// Create a sub-bitmap based on the wanted frames. If (Cutbit this)
// doesn't have frames, don't compute +1 for the outermost frame.
if (_xfs == 1 && _yfs == 1)
return al_create_sub_bitmap(cast (Albit) bitmap,
xec, yec, _xl - xec, _yl - yec);
else
return al_create_sub_bitmap(cast (Albit) bitmap,
1 + xf * (_xl+1) + xec,
1 + yf * (_yl+1) + yec,
_xl - xec, _yl - yec);
}
void cutBitmap()
{
auto lock = LockReadOnly(bitmap);
immutable int xMax = al_get_bitmap_width (bitmap);
immutable int yMax = al_get_bitmap_height(bitmap);
// Called when the constructor was invoked with bool cut == true.
// To cut a bitmap into frames, check the top left 2x2 block. The three
// pixels of it touching the edge shall be of one color, and the inner
// pixel must be of a different color, to count as a frame grid.
Alcol c = al_get_pixel(bitmap, 0, 0);
if (xMax > 1 && yMax > 1
&& al_get_pixel(bitmap, 0, 1) == c
&& al_get_pixel(bitmap, 1, 0) == c
&& al_get_pixel(bitmap, 1, 1) != c) {
// find the end of the first frame in each direction
for (_xl = 2; _xl < xMax; ++_xl) {
if (al_get_pixel(bitmap, _xl, 1) == c) {
--_xl;
break;
}
}
for (_yl = 2; _yl < yMax; ++_yl) {
if (al_get_pixel(bitmap, 1, _yl) == c) {
--_yl;
break;
}
}
// don't cut the bitmap if at most 1-by-1 frame is possible
if (_xl * 2 > xMax && _yl * 2 > yMax) {
_xl = xMax;
_yl = yMax;
_xfs = 1;
_yfs = 1;
}
// ...otherwise compute the number of frames in each direction
else {
for (_xfs = 0; (_xfs+1)*(_xl+1) < xMax; ++_xfs) {}
for (_yfs = 0; (_yfs+1)*(_yl+1) < yMax; ++_yfs) {}
}
}
// no frame apparent in the top left 2x2 block of pixels
else {
_xl = xMax;
_yl = yMax;
_xfs = 1;
_yfs = 1;
}
// done cutting, now generate matrix. The bitmap is still locked.
_existingFrames = new Matrix!bool(_xfs, _yfs);
if (_xfs == 1 && _yfs == 1) {
_existingFrames.set(0, 0, true);
}
else {
Point corner = Point(0, 0);
for (int yf = 0; yf < _yfs; ++yf)
for (int xf = 0; xf < _xfs; ++xf) {
immutable has_frame_color = (get_pixel(xf, yf, corner) == c);
_existingFrames.set(xf, yf, ! has_frame_color);
}
}
// done making the matrix
}
// end void cutBitmap()
}
|
D
|
module xf.gfx.api.gl3.cg.FunctionPtrs;
private {
import xf.gfx.api.gl3.cg.Consts;
import xf.gfx.api.gl3.GLTypes;
}
extern (C):
CGenum function(CGenum lockingPolicy) fp_cgSetLockingPolicy;
CGenum function() fp_cgGetLockingPolicy;
CGenum function(CGenum casePolicy) fp_cgSetSemanticCasePolicy;
CGenum function() fp_cgGetSemanticCasePolicy;
/*** Context functions ***/
CGcontext function() fp_cgCreateContext;
void function(CGcontext ctx) fp_cgDestroyContext;
CGbool function(CGcontext ctx) fp_cgIsContext;
char * function(CGcontext ctx) fp_cgGetLastListing;
void function(CGhandle handle, char *listing) fp_cgSetLastListing;
void function(CGcontext ctx, CGenum flag) fp_cgSetAutoCompile;
CGenum function(CGcontext ctx) fp_cgGetAutoCompile;
void function(CGcontext ctx, CGenum parameterSettingMode) fp_cgSetParameterSettingMode;
CGenum function(CGcontext ctx) fp_cgGetParameterSettingMode;
/*** Program functions ***/
CGprogram function(CGcontext ctx, CGenum program_type, char *program, CGprofile profile, char *entry, char **args) fp_cgCreateProgram;
CGprogram function(CGcontext ctx, CGenum program_type, char *program_file, CGprofile profile, char *entry, char **args) fp_cgCreateProgramFromFile;
CGprogram function(CGprogram program) fp_cgCopyProgram;
void function(CGprogram program) fp_cgDestroyProgram;
CGprogram function(CGcontext ctx) fp_cgGetFirstProgram;
CGprogram function(CGprogram current) fp_cgGetNextProgram;
CGcontext function(CGprogram prog) fp_cgGetProgramContext;
CGbool function(CGprogram program) fp_cgIsProgram;
void function(CGprogram program) fp_cgCompileProgram;
CGbool function(CGprogram program) fp_cgIsProgramCompiled;
char * function(CGprogram prog, CGenum pname) fp_cgGetProgramString;
CGprofile function(CGprogram prog) fp_cgGetProgramProfile;
char * * function(CGprogram prog) fp_cgGetProgramOptions;
void function(CGprogram prog, CGprofile profile) fp_cgSetProgramProfile;
CGenum function(CGprogram program) fp_cgGetProgramInput;
CGenum function(CGprogram program) fp_cgGetProgramOutput;
void function(CGprogram) fp_cgSetPassProgramParameters;
void function(CGprogram program) fp_cgUpdateProgramParameters;
/*** Parameter functions ***/
CGparameter function(CGcontext ctx, CGtype type) fp_cgCreateParameter;
CGparameter function(CGcontext ctx, CGtype type, int length) fp_cgCreateParameterArray;
CGparameter function(CGcontext ctx, CGtype type, int dim, int *lengths) fp_cgCreateParameterMultiDimArray;
void function(CGparameter param) fp_cgDestroyParameter;
void function(CGparameter from, CGparameter to) fp_cgConnectParameter;
void function(CGparameter param) fp_cgDisconnectParameter;
CGparameter function(CGparameter param) fp_cgGetConnectedParameter;
int function(CGparameter param) fp_cgGetNumConnectedToParameters;
CGparameter function(CGparameter param, int index) fp_cgGetConnectedToParameter;
CGparameter function(CGprogram prog, char *name) fp_cgGetNamedParameter;
CGparameter function(CGprogram prog, CGenum name_space, char *name) fp_cgGetNamedProgramParameter;
CGparameter function(CGprogram prog, CGenum name_space) fp_cgGetFirstParameter;
CGparameter function(CGparameter current) fp_cgGetNextParameter;
CGparameter function(CGprogram prog, CGenum name_space) fp_cgGetFirstLeafParameter;
CGparameter function(CGparameter current) fp_cgGetNextLeafParameter;
CGparameter function(CGparameter param) fp_cgGetFirstStructParameter;
CGparameter function(CGparameter param, char *name) fp_cgGetNamedStructParameter;
CGparameter function(CGparameter param) fp_cgGetFirstDependentParameter;
CGparameter function(CGparameter aparam, int index) fp_cgGetArrayParameter;
int function(CGparameter param) fp_cgGetArrayDimension;
CGtype function(CGparameter param) fp_cgGetArrayType;
int function(CGparameter param, int dimension) fp_cgGetArraySize;
int function(CGparameter param) fp_cgGetArrayTotalSize;
void function(CGparameter param, int size) fp_cgSetArraySize;
void function(CGparameter param, int *sizes) fp_cgSetMultiDimArraySize;
CGprogram function(CGparameter param) fp_cgGetParameterProgram;
CGcontext function(CGparameter param) fp_cgGetParameterContext;
CGbool function(CGparameter param) fp_cgIsParameter;
char * function(CGparameter param) fp_cgGetParameterName;
CGtype function(CGparameter param) fp_cgGetParameterType;
CGtype function(CGparameter param) fp_cgGetParameterBaseType;
CGparameterclass function(CGparameter param) fp_cgGetParameterClass;
char * function(CGparameterclass parameterclass) fp_cgGetParameterClassString;
int function(CGparameter param) fp_cgGetParameterRows;
int function(CGparameter param) fp_cgGetParameterColumns;
CGtype function(CGparameter param) fp_cgGetParameterNamedType;
char * function(CGparameter param) fp_cgGetParameterSemantic;
CGresource function(CGparameter param) fp_cgGetParameterResource;
CGresource function(CGparameter param) fp_cgGetParameterBaseResource;
uint function(CGparameter param) fp_cgGetParameterResourceIndex;
CGenum function(CGparameter param) fp_cgGetParameterVariability;
CGenum function(CGparameter param) fp_cgGetParameterDirection;
CGbool function(CGparameter param) fp_cgIsParameterReferenced;
CGbool function(CGparameter param, CGhandle handle) fp_cgIsParameterUsed;
double * function(CGparameter param, CGenum value_type, int *nvalues) fp_cgGetParameterValues;
void function(CGparameter param, int n, double *vals) fp_cgSetParameterValuedr;
void function(CGparameter param, int n, double *vals) fp_cgSetParameterValuedc;
void function(CGparameter param, int n, float *vals) fp_cgSetParameterValuefr;
void function(CGparameter param, int n, float *vals) fp_cgSetParameterValuefc;
void function(CGparameter param, int n, int *vals) fp_cgSetParameterValueir;
void function(CGparameter param, int n, int *vals) fp_cgSetParameterValueic;
int function(CGparameter param, int n, double *vals) fp_cgGetParameterValuedr;
int function(CGparameter param, int n, double *vals) fp_cgGetParameterValuedc;
int function(CGparameter param, int n, float *vals) fp_cgGetParameterValuefr;
int function(CGparameter param, int n, float *vals) fp_cgGetParameterValuefc;
int function(CGparameter param, int n, int *vals) fp_cgGetParameterValueir;
int function(CGparameter param, int n, int *vals) fp_cgGetParameterValueic;
char * function(CGparameter param) fp_cgGetStringParameterValue;
void function(CGparameter param, char *str) fp_cgSetStringParameterValue;
int function(CGparameter param) fp_cgGetParameterOrdinalNumber;
CGbool function(CGparameter param) fp_cgIsParameterGlobal;
int function(CGparameter param) fp_cgGetParameterIndex;
void function(CGparameter param, CGenum vary) fp_cgSetParameterVariability;
void function(CGparameter param, char *semantic) fp_cgSetParameterSemantic;
void function(CGparameter param, float x) fp_cgSetParameter1f;
void function(CGparameter param, float x, float y) fp_cgSetParameter2f;
void function(CGparameter param, float x, float y, float z) fp_cgSetParameter3f;
void function(CGparameter param, float x, float y, float z, float w) fp_cgSetParameter4f;
void function(CGparameter param, double x) fp_cgSetParameter1d;
void function(CGparameter param, double x, double y) fp_cgSetParameter2d;
void function(CGparameter param, double x, double y, double z) fp_cgSetParameter3d;
void function(CGparameter param, double x, double y, double z, double w) fp_cgSetParameter4d;
void function(CGparameter param, int x) fp_cgSetParameter1i;
void function(CGparameter param, int x, int y) fp_cgSetParameter2i;
void function(CGparameter param, int x, int y, int z) fp_cgSetParameter3i;
void function(CGparameter param, int x, int y, int z, int w) fp_cgSetParameter4i;
void function(CGparameter param, int *v) fp_cgSetParameter1iv;
void function(CGparameter param, int *v) fp_cgSetParameter2iv;
void function(CGparameter param, int *v) fp_cgSetParameter3iv;
void function(CGparameter param, int *v) fp_cgSetParameter4iv;
void function(CGparameter param, float *v) fp_cgSetParameter1fv;
void function(CGparameter param, float *v) fp_cgSetParameter2fv;
void function(CGparameter param, float *v) fp_cgSetParameter3fv;
void function(CGparameter param, float *v) fp_cgSetParameter4fv;
void function(CGparameter param, double *v) fp_cgSetParameter1dv;
void function(CGparameter param, double *v) fp_cgSetParameter2dv;
void function(CGparameter param, double *v) fp_cgSetParameter3dv;
void function(CGparameter param, double *v) fp_cgSetParameter4dv;
void function(CGparameter param, int *matrix) fp_cgSetMatrixParameterir;
void function(CGparameter param, double *matrix) fp_cgSetMatrixParameterdr;
void function(CGparameter param, float *matrix) fp_cgSetMatrixParameterfr;
void function(CGparameter param, int *matrix) fp_cgSetMatrixParameteric;
void function(CGparameter param, double *matrix) fp_cgSetMatrixParameterdc;
void function(CGparameter param, float *matrix) fp_cgSetMatrixParameterfc;
void function(CGparameter param, int *matrix) fp_cgGetMatrixParameterir;
void function(CGparameter param, double *matrix) fp_cgGetMatrixParameterdr;
void function(CGparameter param, float *matrix) fp_cgGetMatrixParameterfr;
void function(CGparameter param, int *matrix) fp_cgGetMatrixParameteric;
void function(CGparameter param, double *matrix) fp_cgGetMatrixParameterdc;
void function(CGparameter param, float *matrix) fp_cgGetMatrixParameterfc;
CGparameter function(CGparameter param, char *name) fp_cgGetNamedSubParameter;
/*** Type Functions ***/
char * function(CGtype type) fp_cgGetTypeString;
CGtype function(char *type_string) fp_cgGetType;
CGtype function(CGhandle handle, char *name) fp_cgGetNamedUserType;
int function(CGhandle handle) fp_cgGetNumUserTypes;
CGtype function(CGhandle handle, int index) fp_cgGetUserType;
int function(CGtype type) fp_cgGetNumParentTypes;
CGtype function(CGtype type, int index) fp_cgGetParentType;
CGbool function(CGtype parent, CGtype child) fp_cgIsParentType;
CGbool function(CGtype type) fp_cgIsInterfaceType;
/*** Resource Functions ***/
char * function(CGresource resource) fp_cgGetResourceString;
CGresource function(char *resource_string) fp_cgGetResource;
/*** Enum Functions ***/
char * function(CGenum en) fp_cgGetEnumString;
CGenum function(char *enum_string) fp_cgGetEnum;
/*** Profile Functions ***/
char * function(CGprofile profile) fp_cgGetProfileString;
CGprofile function(char *profile_string) fp_cgGetProfile;
/*** Error Functions ***/
CGerror function() fp_cgGetError;
CGerror function() fp_cgGetFirstError;
char * function(CGerror error) fp_cgGetErrorString;
char * function(CGerror *error) fp_cgGetLastErrorString;
void function(CGerrorCallbackFunc func) fp_cgSetErrorCallback;
CGerrorCallbackFunc function() fp_cgGetErrorCallback;
void function(CGerrorHandlerFunc func, void *data) fp_cgSetErrorHandler;
CGerrorHandlerFunc function(void **data) fp_cgGetErrorHandler;
/*** Misc Functions ***/
char * function(CGenum sname) fp_cgGetString;
/*** CgFX Functions ***/
CGeffect function(CGcontext, char *code, char **args) fp_cgCreateEffect;
CGeffect function(CGcontext, char *filename, char **args) fp_cgCreateEffectFromFile;
CGeffect function(CGeffect effect) fp_cgCopyEffect;
void function(CGeffect) fp_cgDestroyEffect;
CGcontext function(CGeffect) fp_cgGetEffectContext;
CGbool function(CGeffect effect) fp_cgIsEffect;
CGeffect function(CGcontext) fp_cgGetFirstEffect;
CGeffect function(CGeffect) fp_cgGetNextEffect;
CGprogram function(CGeffect effect, CGprofile profile, char *entry, char **args) fp_cgCreateProgramFromEffect;
CGtechnique function(CGeffect) fp_cgGetFirstTechnique;
CGtechnique function(CGtechnique) fp_cgGetNextTechnique;
CGtechnique function(CGeffect, char *name) fp_cgGetNamedTechnique;
char * function(CGtechnique) fp_cgGetTechniqueName;
CGbool function(CGtechnique) fp_cgIsTechnique;
CGbool function(CGtechnique) fp_cgValidateTechnique;
CGbool function(CGtechnique) fp_cgIsTechniqueValidated;
CGeffect function(CGtechnique) fp_cgGetTechniqueEffect;
CGpass function(CGtechnique) fp_cgGetFirstPass;
CGpass function(CGtechnique, char *name) fp_cgGetNamedPass;
CGpass function(CGpass) fp_cgGetNextPass;
CGbool function(CGpass) fp_cgIsPass;
char * function(CGpass) fp_cgGetPassName;
CGtechnique function(CGpass) fp_cgGetPassTechnique;
void function(CGpass) fp_cgSetPassState;
void function(CGpass) fp_cgResetPassState;
CGstateassignment function(CGpass) fp_cgGetFirstStateAssignment;
CGstateassignment function(CGpass, char *name) fp_cgGetNamedStateAssignment;
CGstateassignment function(CGstateassignment) fp_cgGetNextStateAssignment;
CGbool function(CGstateassignment) fp_cgIsStateAssignment;
CGbool function(CGstateassignment) fp_cgCallStateSetCallback;
CGbool function(CGstateassignment) fp_cgCallStateValidateCallback;
CGbool function(CGstateassignment) fp_cgCallStateResetCallback;
CGpass function(CGstateassignment) fp_cgGetStateAssignmentPass;
CGparameter function(CGstateassignment) fp_cgGetSamplerStateAssignmentParameter;
float * function(CGstateassignment, int *nVals) fp_cgGetFloatStateAssignmentValues;
int * function(CGstateassignment, int *nVals) fp_cgGetIntStateAssignmentValues;
CGbool * function(CGstateassignment, int *nVals) fp_cgGetBoolStateAssignmentValues;
char * function(CGstateassignment) fp_cgGetStringStateAssignmentValue;
CGprogram function(CGstateassignment) fp_cgGetProgramStateAssignmentValue;
CGparameter function(CGstateassignment) fp_cgGetTextureStateAssignmentValue;
CGparameter function(CGstateassignment) fp_cgGetSamplerStateAssignmentValue;
int function(CGstateassignment) fp_cgGetStateAssignmentIndex;
int function(CGstateassignment) fp_cgGetNumDependentStateAssignmentParameters;
CGparameter function(CGstateassignment, int index) fp_cgGetDependentStateAssignmentParameter;
CGparameter function(CGstateassignment) fp_cgGetConnectedStateAssignmentParameter;
CGstate function(CGstateassignment) fp_cgGetStateAssignmentState;
CGstate function(CGstateassignment) fp_cgGetSamplerStateAssignmentState;
CGstate function(CGcontext, char *name, CGtype) fp_cgCreateState;
CGstate function(CGcontext, char *name, CGtype, int nelems) fp_cgCreateArrayState;
void function(CGstate, CGstatecallback set, CGstatecallback reset, CGstatecallback validate) fp_cgSetStateCallbacks;
CGstatecallback function(CGstate) fp_cgGetStateSetCallback;
CGstatecallback function(CGstate) fp_cgGetStateResetCallback;
CGstatecallback function(CGstate) fp_cgGetStateValidateCallback;
CGcontext function(CGstate) fp_cgGetStateContext;
CGtype function(CGstate) fp_cgGetStateType;
char * function(CGstate) fp_cgGetStateName;
CGstate function(CGcontext, char *name) fp_cgGetNamedState;
CGstate function(CGcontext) fp_cgGetFirstState;
CGstate function(CGstate) fp_cgGetNextState;
CGbool function(CGstate) fp_cgIsState;
void function(CGstate, char *name, int value) fp_cgAddStateEnumerant;
CGstate function(CGcontext, char *name, CGtype) fp_cgCreateSamplerState;
CGstate function(CGcontext, char *name, CGtype, int nelems) fp_cgCreateArraySamplerState;
CGstate function(CGcontext, char *name) fp_cgGetNamedSamplerState;
CGstate function(CGcontext) fp_cgGetFirstSamplerState;
CGstateassignment function(CGparameter) fp_cgGetFirstSamplerStateAssignment;
CGstateassignment function(CGparameter, char *) fp_cgGetNamedSamplerStateAssignment;
void function(CGparameter) fp_cgSetSamplerState;
CGparameter function(CGeffect, char *) fp_cgGetNamedEffectParameter;
CGparameter function(CGeffect) fp_cgGetFirstLeafEffectParameter;
CGparameter function(CGeffect) fp_cgGetFirstEffectParameter;
CGparameter function(CGeffect, char *) fp_cgGetEffectParameterBySemantic;
CGannotation function(CGtechnique) fp_cgGetFirstTechniqueAnnotation;
CGannotation function(CGpass) fp_cgGetFirstPassAnnotation;
CGannotation function(CGparameter) fp_cgGetFirstParameterAnnotation;
CGannotation function(CGprogram) fp_cgGetFirstProgramAnnotation;
CGannotation function(CGeffect) fp_cgGetFirstEffectAnnotation;
CGannotation function(CGannotation) fp_cgGetNextAnnotation;
CGannotation function(CGtechnique, char *) fp_cgGetNamedTechniqueAnnotation;
CGannotation function(CGpass, char *) fp_cgGetNamedPassAnnotation;
CGannotation function(CGparameter, char *) fp_cgGetNamedParameterAnnotation;
CGannotation function(CGprogram, char *) fp_cgGetNamedProgramAnnotation;
CGannotation function(CGeffect, char *) fp_cgGetNamedEffectAnnotation;
CGbool function(CGannotation) fp_cgIsAnnotation;
char * function(CGannotation) fp_cgGetAnnotationName;
CGtype function(CGannotation) fp_cgGetAnnotationType;
float * function(CGannotation, int *nvalues) fp_cgGetFloatAnnotationValues;
int * function(CGannotation, int *nvalues) fp_cgGetIntAnnotationValues;
char * function(CGannotation) fp_cgGetStringAnnotationValue;
char * * function(CGannotation, int *nvalues) fp_cgGetStringAnnotationValues;
CGbool * function(CGannotation, int *nvalues) fp_cgGetBoolAnnotationValues;
int * function(CGannotation, int *nvalues) fp_cgGetBooleanAnnotationValues;
int function(CGannotation) fp_cgGetNumDependentAnnotationParameters;
CGparameter function(CGannotation, int index) fp_cgGetDependentAnnotationParameter;
void function(CGprogram, float *, int ncomps, int nx, int ny, int nz) fp_cgEvaluateProgram;
/*** Cg 1.5 Additions ***/
CGbool function(CGeffect, char *name) fp_cgSetEffectName;
char * function(CGeffect) fp_cgGetEffectName;
CGeffect function(CGcontext, char *name) fp_cgGetNamedEffect;
CGparameter function(CGeffect, char *name, CGtype) fp_cgCreateEffectParameter;
CGtechnique function(CGeffect, char *name) fp_cgCreateTechnique;
CGparameter function(CGeffect, char *name, CGtype type, int length) fp_cgCreateEffectParameterArray;
CGparameter function(CGeffect, char *name, CGtype type, int dim, int *lengths) fp_cgCreateEffectParameterMultiDimArray;
CGpass function(CGtechnique, char *name) fp_cgCreatePass;
CGstateassignment function(CGpass, CGstate) fp_cgCreateStateAssignment;
CGstateassignment function(CGpass, CGstate, int index) fp_cgCreateStateAssignmentIndex;
CGstateassignment function(CGparameter, CGstate) fp_cgCreateSamplerStateAssignment;
CGbool function(CGstateassignment, float) fp_cgSetFloatStateAssignment;
CGbool function(CGstateassignment, int) fp_cgSetIntStateAssignment;
CGbool function(CGstateassignment, CGbool) fp_cgSetBoolStateAssignment;
CGbool function(CGstateassignment, char *) fp_cgSetStringStateAssignment;
CGbool function(CGstateassignment, CGprogram) fp_cgSetProgramStateAssignment;
CGbool function(CGstateassignment, CGparameter) fp_cgSetSamplerStateAssignment;
CGbool function(CGstateassignment, CGparameter) fp_cgSetTextureStateAssignment;
CGbool function(CGstateassignment, float *vals) fp_cgSetFloatArrayStateAssignment;
CGbool function(CGstateassignment, int *vals) fp_cgSetIntArrayStateAssignment;
CGbool function(CGstateassignment, CGbool *vals) fp_cgSetBoolArrayStateAssignment;
CGannotation function(CGtechnique, char *name, CGtype) fp_cgCreateTechniqueAnnotation;
CGannotation function(CGpass, char *name, CGtype) fp_cgCreatePassAnnotation;
CGannotation function(CGparameter, char *name, CGtype) fp_cgCreateParameterAnnotation;
CGannotation function(CGprogram, char *name, CGtype) fp_cgCreateProgramAnnotation;
CGannotation function(CGeffect, char *name, CGtype) fp_cgCreateEffectAnnotation;
CGbool function(CGannotation, int value) fp_cgSetIntAnnotation;
CGbool function(CGannotation, float value) fp_cgSetFloatAnnotation;
CGbool function(CGannotation, CGbool value) fp_cgSetBoolAnnotation;
CGbool function(CGannotation, char *value) fp_cgSetStringAnnotation;
char * function(CGstate, int value) fp_cgGetStateEnumerantName;
int function(CGstate, char *name) fp_cgGetStateEnumerantValue;
CGeffect function(CGparameter param) fp_cgGetParameterEffect;
CGparameterclass function(CGtype type) fp_cgGetTypeClass;
CGtype function(CGtype type) fp_cgGetTypeBase;
CGbool function(CGtype type, int *nrows, int *ncols) fp_cgGetTypeSizes;
void function(CGtype type, int *nrows, int *ncols) fp_cgGetMatrixSize;
int function( CGprogram program ) fp_cgGetNumProgramDomains;
CGprogram function ( CGprogram program, int index ) fp_cgGetProgramDomainProgram;
CGdomain function( CGprofile profile ) fp_cgGetProfileDomain;
CGprogram function( int n, CGprogram *exeList ) fp_cgCombinePrograms;
CGprogram function( CGprogram exe1, CGprogram exe2 ) fp_cgCombinePrograms2;
CGprogram function( CGprogram exe1, CGprogram exe2, CGprogram exe3 ) fp_cgCombinePrograms3;
CGprofile function(CGprogram program, int index) fp_cgGetProgramDomainProfile;
/*** CGobj Functions ***/
CGobj function( CGcontext context, CGenum program_type, char *source, CGprofile profile, char **args ) fp_cgCreateObj;
CGobj function( CGcontext context, CGenum program_type, char *source_file, CGprofile profile, char **args ) fp_cgCreateObjFromFile;
void function( CGobj obj ) fp_cgDestroyObj;
int function(CGparameter) fp_cgGetParameterResourceSize;
CGtype function(CGparameter) fp_cgGetParameterResourceType;
int function(CGparameter) fp_cgGetParameterBufferIndex;
int function(CGparameter) fp_cgGetParameterBufferOffset;
CGbuffer function(CGcontext, int size, void *data, CGbufferusage bufferUsage) fp_cgCreateBuffer;
void function(CGbuffer, int size, void *data) fp_cgSetBufferData;
void function(CGbuffer, int offset, int size, void *data) fp_cgSetBufferSubData;
void function(CGprogram program, int bufferIndex, CGbuffer buffer) fp_cgSetProgramBuffer;
void * function(CGbuffer buffer, CGbufferaccess access) fp_cgMapBuffer;
void function(CGbuffer buffer) fp_cgUnmapBuffer;
void function(CGbuffer buffer) fp_cgDestroyBuffer;
CGbuffer function(CGprogram, int bufferIndex) fp_cgGetProgramBuffer;
int function(CGbuffer) fp_cgGetBufferSize;
int function(CGprofile profile) fp_cgGetProgramBufferMaxSize;
int function(CGprofile profile) fp_cgGetProgramBufferMaxIndex;
/******************************************************************************
*** Profile Functions
*****************************************************************************/
CGbool function(CGprofile profile) fp_cgGLIsProfileSupported;
void function(CGprofile profile) fp_cgGLEnableProfile;
void function(CGprofile profile) fp_cgGLDisableProfile;
CGprofile function(CGGLenum profile_type) fp_cgGLGetLatestProfile;
void function(CGprofile profile) fp_cgGLSetOptimalOptions;
char** function(CGprofile profile) fp_cgGLGetOptimalOptions;
/******************************************************************************
*** Program Managment Functions
*****************************************************************************/
void function(CGprogram program) fp_cgGLLoadProgram;
CGbool function(CGprogram program) fp_cgGLIsProgramLoaded;
void function(CGprogram program) fp_cgGLBindProgram;
void function(CGprofile profile) fp_cgGLUnbindProgram;
GLuint function(CGprogram program) fp_cgGLGetProgramID;
/******************************************************************************
*** Parameter Managment Functions
*****************************************************************************/
void function(CGparameter param, float x) fp_cgGLSetParameter1f;
void function(CGparameter param, float x, float y) fp_cgGLSetParameter2f;
void function(CGparameter param, float x, float y, float z) fp_cgGLSetParameter3f;
void function(CGparameter param, float x, float y, float z, float w) fp_cgGLSetParameter4f;
void function(CGparameter param, float *v) fp_cgGLSetParameter1fv;
void function(CGparameter param, float *v) fp_cgGLSetParameter2fv;
void function(CGparameter param, float *v) fp_cgGLSetParameter3fv;
void function(CGparameter param, float *v) fp_cgGLSetParameter4fv;
void function(CGparameter param, double x) fp_cgGLSetParameter1d;
void function(CGparameter param, double x, double y) fp_cgGLSetParameter2d;
void function(CGparameter param, double x, double y, double z) fp_cgGLSetParameter3d;
void function(CGparameter param, double x, double y, double z, double w) fp_cgGLSetParameter4d;
void function(CGparameter param, double *v) fp_cgGLSetParameter1dv;
void function(CGparameter param, double *v) fp_cgGLSetParameter2dv;
void function(CGparameter param, double *v) fp_cgGLSetParameter3dv;
void function(CGparameter param, double *v) fp_cgGLSetParameter4dv;
void function(CGparameter param, float *v) fp_cgGLGetParameter1f;
void function(CGparameter param, float *v) fp_cgGLGetParameter2f;
void function(CGparameter param, float *v) fp_cgGLGetParameter3f;
void function(CGparameter param, float *v) fp_cgGLGetParameter4f;
void function(CGparameter param, double *v) fp_cgGLGetParameter1d;
void function(CGparameter param, double *v) fp_cgGLGetParameter2d;
void function(CGparameter param, double *v) fp_cgGLGetParameter3d;
void function(CGparameter param, double *v) fp_cgGLGetParameter4d;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLSetParameterArray1f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLSetParameterArray2f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLSetParameterArray3f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLSetParameterArray4f;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLSetParameterArray1d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLSetParameterArray2d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLSetParameterArray3d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLSetParameterArray4d;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLGetParameterArray1f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLGetParameterArray2f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLGetParameterArray3f;
void function(CGparameter param, int offset, int nelements, float *v) fp_cgGLGetParameterArray4f;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLGetParameterArray1d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLGetParameterArray2d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLGetParameterArray3d;
void function(CGparameter param, int offset, int nelements, double *v) fp_cgGLGetParameterArray4d;
void function(CGparameter param, GLint fsize, GLenum type, GLsizei stride, GLvoid *pointer) fp_cgGLSetParameterPointer;
void function(CGparameter param) fp_cgGLEnableClientState;
void function(CGparameter param) fp_cgGLDisableClientState;
/******************************************************************************
*** Matrix Parameter Managment Functions
*****************************************************************************/
void function(CGparameter param, double *matrix) fp_cgGLSetMatrixParameterdr;
void function(CGparameter param, float *matrix) fp_cgGLSetMatrixParameterfr;
void function(CGparameter param, double *matrix) fp_cgGLSetMatrixParameterdc;
void function(CGparameter param, float *matrix) fp_cgGLSetMatrixParameterfc;
void function(CGparameter param, double *matrix) fp_cgGLGetMatrixParameterdr;
void function(CGparameter param, float *matrix) fp_cgGLGetMatrixParameterfr;
void function(CGparameter param, double *matrix) fp_cgGLGetMatrixParameterdc;
void function(CGparameter param, float *matrix) fp_cgGLGetMatrixParameterfc;
void function(CGparameter param, CGGLenum matrix, CGGLenum transform) fp_cgGLSetStateMatrixParameter;
void function(CGparameter param, int offset, int nelements, float *matrices) fp_cgGLSetMatrixParameterArrayfc;
void function(CGparameter param, int offset, int nelements, float *matrices) fp_cgGLSetMatrixParameterArrayfr;
void function(CGparameter param, int offset, int nelements, double *matrices) fp_cgGLSetMatrixParameterArraydc;
void function(CGparameter param, int offset, int nelements, double *matrices) fp_cgGLSetMatrixParameterArraydr;
void function(CGparameter param, int offset, int nelements, float *matrices) fp_cgGLGetMatrixParameterArrayfc;
void function(CGparameter param, int offset, int nelements, float *matrices) fp_cgGLGetMatrixParameterArrayfr;
void function(CGparameter param, int offset, int nelements, double *matrices) fp_cgGLGetMatrixParameterArraydc;
void function(CGparameter param, int offset, int nelements, double *matrices) fp_cgGLGetMatrixParameterArraydr;
/******************************************************************************
*** Texture Parameter Managment Functions
*****************************************************************************/
void function(CGparameter param, GLuint texobj) fp_cgGLSetTextureParameter;
GLuint function(CGparameter param) fp_cgGLGetTextureParameter;
void function(CGparameter param) fp_cgGLEnableTextureParameter;
void function(CGparameter param) fp_cgGLDisableTextureParameter;
GLenum function(CGparameter param) fp_cgGLGetTextureEnum;
void function(CGcontext ctx, CGbool flag) fp_cgGLSetManageTextureParameters;
CGbool function(CGcontext ctx) fp_cgGLGetManageTextureParameters;
void function(CGparameter param, GLuint texobj) fp_cgGLSetupSampler;
void function(CGcontext) fp_cgGLRegisterStates;
void function( CGprogram program ) fp_cgGLEnableProgramProfiles;
void function( CGprogram program ) fp_cgGLDisableProgramProfiles;
/******************************************************************************
*** Misc Functions
*****************************************************************************/
void function( CGbool debug_ ) fp_cgGLSetDebugMode;
/******************************************************************************
*** Buffer Functions
*****************************************************************************/
CGbuffer function(CGcontext context, int size, void *data, GLenum bufferUsage) fp_cgGLCreateBuffer;
GLuint function(CGbuffer buffer) fp_cgGLGetBufferObject;
|
D
|
var int Hakon_ItemsGiven_Chapter_1;
var int Hakon_ItemsGiven_Chapter_2;
var int Hakon_ItemsGiven_Chapter_3;
var int Hakon_ItemsGiven_Chapter_4;
var int Hakon_ItemsGiven_Chapter_5;
FUNC VOID B_GiveTradeInv_Hakon (var C_NPC slf)
{
if ((Kapitel >= 1)
&& (Hakon_ItemsGiven_Chapter_1 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 100);
// ------ Waffen ------
CreateInvItems (slf, ItMw_ShortSword3, 1);
CreateInvItems (slf, ItMw_ShortSword4 , 1);
CreateInvItems (slf, ItMw_Richtstab, 1);
CreateInvItems (slf, ItMw_Schwert3, 1);
CreateInvItems (slf, ItMw_Streitkolben, 1);
CreateInvItems (slf, ItMw_Schiffsaxt, 1);
CreateInvItems (slf, ItMiSwordraw, 5);
CreateInvItems (slf, ItMw_Schlachtaxt, 1);
CreateInvItems (slf, ItMw_marvinschwert, 3);
// ------ Ringe / Amulette ------
CreateInvItems (slf, ItBE_Addon_Leather_01, 1);
CreateInvItems (slf, ItBE_Addon_MIL_01 , 1);
CreateInvItems (slf, ItAm_Prot_Edge_01 , 1);
Hakon_ItemsGiven_Chapter_1 = TRUE;
};
if ((Kapitel >= 2)
&& (Hakon_ItemsGiven_Chapter_2 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 100);
CreateInvItems (slf, ItMiSwordraw, 5);
Hakon_ItemsGiven_Chapter_2 = TRUE;
};
if ((Kapitel >= 3)
&& (Hakon_ItemsGiven_Chapter_3 == FALSE))
{
CreateInvItems (slf, ItMw_Steinbrecher , 1);
CreateInvItems (slf, ItMw_Doppelaxt, 2);
CreateInvItems (slf, ItMw_Streitkolben, 1);
CreateInvItems (slf, ItMw_Orkschlaechter , 2);
CreateInvItems (slf, ItMi_Gold, 100);
CreateInvItems (slf, ItMiSwordraw, 5);
CreateInvItems (slf, ItBe_Addon_Prot_Point, 1);
Hakon_ItemsGiven_Chapter_3 = TRUE;
};
if ((Kapitel >= 4)
&& (Hakon_ItemsGiven_Chapter_4 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 150);
CreateInvItems (slf, ItMiSwordraw, 5);
CreateInvItems (slf, ItBe_Addon_Prot_EDGE, 1);
CreateInvItems (slf, ItBe_Addon_Prot_TOTAL, 1);
Hakon_ItemsGiven_Chapter_4 = TRUE;
};
if ((Kapitel >= 5)
&& (Hakon_ItemsGiven_Chapter_5 == FALSE))
{
CreateInvItems (slf, ItMi_Gold, 200);
CreateInvItems (slf, ItMiSwordraw, 5);
Hakon_ItemsGiven_Chapter_5 = TRUE;
};
};
|
D
|
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_oleauto.d)
*/
module core.sys.windows.oleauto;
version (Windows):
@system:
pragma(lib, "oleaut32");
import core.sys.windows.oaidl;
private import core.sys.windows.basetyps, core.sys.windows.unknwn, core.sys.windows.windef, core.sys.windows.wtypes;
private import core.sys.windows.winbase; // for SYSTEMTIME
align(8):
enum STDOLE_MAJORVERNUM = 1;
enum STDOLE_MINORVERNUM = 0;
enum STDOLE_LCID = 0;
enum VARIANT_NOVALUEPROP = 0x01;
enum VARIANT_ALPHABOOL = 0x02;
enum VARIANT_NOUSEOVERRIDE = 0x04;
enum VARIANT_LOCALBOOL = 0x08;
enum VAR_TIMEVALUEONLY = 0x0001;
enum VAR_DATEVALUEONLY = 0x0002;
enum VAR_VALIDDATE = 0x0004;
enum VAR_CALENDAR_HIJRI = 0x0008;
enum VAR_LOCALBOOL = 0x0010;
enum VAR_FORMAT_NOSUBSTITUTE = 0x0020;
enum VAR_FOURDIGITYEARS = 0x0040;
enum VAR_CALENDAR_THAI = 0x0080;
enum VAR_CALENDAR_GREGORIAN = 0x0100;
enum MEMBERID_NIL = DISPID_UNKNOWN;
enum ID_DEFAULTINST = -2;
enum DISPATCH_METHOD = 1;
enum DISPATCH_PROPERTYGET = 2;
enum DISPATCH_PROPERTYPUT = 4;
enum DISPATCH_PROPERTYPUTREF = 8;
//ULONG LHashValOfName(LCID l, OLECHAR* n) { return LHashValOfNameSys(SYSKIND.SYS_WIN32, l, n); }
// DAC: These aren't in the 2003 SDK.
//MACRO #define WHashValOfLHashVal(h) ((unsigned short)(0x0000ffff&(h)))
//MACRO #define IsHashValCompatible(h1, h2) ((BOOL)((0x00ff0000&(h1))==(0x00ff0000&(h2))))
enum {
ACTIVEOBJECT_STRONG = 0,
ACTIVEOBJECT_WEAK = 1
}
// DAC: These seem to be irrelevant for D.
//#define V_UNION(X, Y) ((X)->Y)
//#define V_VT(X) ((X)->vt)
//#define V_BOOL(X) V_UNION(X, boolVal)
//#define V_ISBYREF(X) (V_VT(X)&VT_BYREF)
//#define V_ISARRAY(X) (V_VT(X)&VT_ARRAY)
//#define V_ISVECTOR(X) (V_VT(X)&VT_VECTOR)
//#define V_NONE(X) V_I2(X)
//#define V_UI1(X) V_UNION(X, bVal)
//#define V_UI1REF(X) V_UNION(X, pbVal)
//#define V_I2(X) V_UNION(X, iVal)
//#define V_UI2(X) V_UNION(X, uiVal)
//#define V_I2REF(X) V_UNION(X, piVal)
//#define V_I4(X) V_UNION(X, lVal)
//#define V_UI4(X) V_UNION(X, ulVal)
//#define V_I4REF(X) V_UNION(X, plVal)
//#define V_UI4REF(X) V_UNION(X, pulVal)
//#define V_I8(X) V_UNION(X, llVal)
//#define V_UI8(X) V_UNION(X, ullVal)
//#define V_I8REF(X) V_UNION(X, pllVal)
//#define V_UI8REF(X) V_UNION(X, pullVal)
//#define V_R4(X) V_UNION(X, fltVal)
//#define V_R4REF(X) V_UNION(X, pfltVal)
//#define V_R8(X) V_UNION(X, dblVal)
//#define V_R8REF(X) V_UNION(X, pdblVal)
//#define V_CY(X) V_UNION(X, cyVal)
//#define V_CYREF(X) V_UNION(X, pcyVal)
//#define V_DATE(X) V_UNION(X, date)
//#define V_DATEREF(X) V_UNION(X, pdate)
//#define V_BSTR(X) V_UNION(X, bstrVal)
//#define V_BSTRREF(X) V_UNION(X, pbstrVal)
//#define V_DISPATCH(X) V_UNION(X, pdispVal)
//#define V_DISPATCHREF(X) V_UNION(X, ppdispVal)
//#define V_ERROR(X) V_UNION(X, scode)
//#define V_ERRORREF(X) V_UNION(X, pscode)
//#define V_BOOLREF(X) V_UNION(X, pboolVal)
//#define V_UNKNOWN(X) V_UNION(X, punkVal)
//#define V_UNKNOWNREF(X) V_UNION(X, ppunkVal)
//#define V_VARIANTREF(X) V_UNION(X, pvarVal)
//#define V_LPSTR(X) V_UNION(X, pszVal)
//#define V_LPSTRREF(X) V_UNION(X, ppszVal)
//#define V_LPWSTR(X) V_UNION(X, pwszVal)
//#define V_LPWSTRREF(X) V_UNION(X, ppwszVal)
//#define V_FILETIME(X) V_UNION(X, filetime)
//#define V_FILETIMEREF(X) V_UNION(X, pfiletime)
//#define V_BLOB(X) V_UNION(X, blob)
//#define V_UUID(X) V_UNION(X, puuid)
//#define V_CLSID(X) V_UNION(X, puuid)
//#define V_ARRAY(X) V_UNION(X, parray)
//#define V_ARRAYREF(X) V_UNION(X, pparray)
//#define V_BYREF(X) V_UNION(X, byref)
//#define V_DECIMAL(X) ((X)->decVal)
//#define V_DECIMALREF(X) V_UNION(X, pdecVal)
//#define V_I1(X) V_UNION(X, cVal)
//#ifdef _WIN64
//#define V_INT_PTR(X) V_I8(X)
//#define V_UINT_PTR(X) V_UI8(X)
//#define V_INT_PTRREF(X) V_I8REF(X)
//#define V_UINT_PTRREF(X) V_UI8REF(X)
//#else
//#define V_INT_PTR(X) V_I4(X)
//#define V_UINT_PTR(X) V_UI4(X)
//#define V_INT_PTRREF(X) V_I4REF(X)
//#define V_UINT_PTRREF(X) V_UI4REF(X)
//#endif
enum {
VARCMP_LT = 0,
VARCMP_EQ,
VARCMP_GT,
VARCMP_NULL // = 3
}
enum LOCALE_USE_NLS = 0x10000000;
enum VARIANT_NOUSEROVERRIDE = 0x04;
enum VARIANT_CALENDAR_HIJRI = 0x08;
enum VARIANT_CALENDAR_THAI = 0x20;
enum VARIANT_CALENDAR_GREGORIAN = 0x40;
enum VARIANT_USE_NLS = 0x80;
enum NUMPRS_LEADING_WHITE = 0x00001;
enum NUMPRS_TRAILING_WHITE = 0x00002;
enum NUMPRS_LEADING_PLUS = 0x00004;
enum NUMPRS_TRAILING_PLUS = 0x00008;
enum NUMPRS_LEADING_MINUS = 0x00010;
enum NUMPRS_TRAILING_MINUS = 0x00020;
enum NUMPRS_HEX_OCT = 0x00040;
enum NUMPRS_PARENS = 0x00080;
enum NUMPRS_DECIMAL = 0x00100;
enum NUMPRS_THOUSANDS = 0x00200;
enum NUMPRS_CURRENCY = 0x00400;
enum NUMPRS_EXPONENT = 0x00800;
enum NUMPRS_USE_ALL = 0x01000;
enum NUMPRS_STD = 0x01FFF;
enum NUMPRS_NEG = 0x10000;
enum NUMPRS_INEXACT = 0x20000;
enum VTBIT_I1 = 1 << VARENUM.VT_I1;
enum VTBIT_UI1 = 1 << VARENUM.VT_UI1;
enum VTBIT_I2 = 1 << VARENUM.VT_I2;
enum VTBIT_UI2 = 1 << VARENUM.VT_UI2;
enum VTBIT_I4 = 1 << VARENUM.VT_I4;
enum VTBIT_UI4 = 1 << VARENUM.VT_UI4;
enum VTBIT_I8 = 1 << VARENUM.VT_I8;
enum VTBIT_UI8 = 1 << VARENUM.VT_UI8;
enum VTBIT_R4 = 1 << VARENUM.VT_R4;
enum VTBIT_R8 = 1 << VARENUM.VT_R8;
enum VTBIT_CY = 1 << VARENUM.VT_CY;
enum VTBIT_DECIMAL = 1 << VARENUM.VT_DECIMAL;
enum REGKIND{
REGKIND_DEFAULT,
REGKIND_REGISTER,
REGKIND_NONE
}
struct PARAMDATA{
OLECHAR* szName;
VARTYPE vt;
}
alias PARAMDATA* LPPARAMDATA;
struct METHODDATA{
OLECHAR* szName;
PARAMDATA* ppdata;
DISPID dispid;
UINT iMeth;
CALLCONV cc;
UINT cArgs;
WORD wFlags;
VARTYPE vtReturn;
}
alias METHODDATA* LPMETHODDATA;
struct INTERFACEDATA{
METHODDATA* pmethdata;
UINT cMembers;
}
alias INTERFACEDATA* LPINTERFACEDATA;
struct UDATE {
SYSTEMTIME st;
USHORT wDayOfYear;
}
struct NUMPARSE {
int cDig;
uint dwInFlags;
uint dwOutFlags;
int cchUsed;
int nBaseShift;
int nPwr10;
}
// DAC: In MinGW, these were declared but not defined in oaidl.
// The SDK docs suggest they belong in this file instead.
deprecated { // not actually deprecated, but they aren't converted yet.
// (will need to reinstate CreateTypeLib as well)
interface ICreateTypeInfo {};
interface ICreateTypeInfo2 {};
interface ICreateTypeLib {};
interface ICreateTypeLib2 {};
alias ICreateTypeInfo LPCREATETYPEINFO;
alias ICreateTypeInfo2 LPCREATETYPEINFO2;
alias ICreateTypeLib LPCREATETYPELIB;
alias ICreateTypeLib2 LPCREATETYPELIB2;
}
extern (Windows) {
BSTR SysAllocString(const(OLECHAR)*);
int SysReAllocString(BSTR*, const(OLECHAR)*);
BSTR SysAllocStringLen(const(OLECHAR)*, uint);
int SysReAllocStringLen(BSTR*, const(OLECHAR)*, uint);
void SysFreeString(BSTR);
uint SysStringLen(BSTR);
uint SysStringByteLen(BSTR);
BSTR SysAllocStringByteLen(const(char)*, uint);
int DosDateTimeToVariantTime(ushort, ushort, double*);
int VariantTimeToDosDateTime(double, ushort*, ushort*);
int VariantTimeToSystemTime(double, LPSYSTEMTIME);
int SystemTimeToVariantTime(LPSYSTEMTIME, double*);
HRESULT VarDateFromUdate(UDATE*, ULONG, DATE*);
HRESULT VarDateFromUdateEx(UDATE*, LCID, ULONG, DATE*);
HRESULT VarUdateFromDate(DATE, ULONG, UDATE*);
HRESULT SafeArrayAllocDescriptor(uint, SAFEARRAY**);
HRESULT SafeArrayAllocData(SAFEARRAY*);
SAFEARRAY* SafeArrayCreate(VARTYPE, uint, SAFEARRAYBOUND*);
HRESULT SafeArrayDestroyDescriptor(SAFEARRAY*);
HRESULT SafeArrayDestroyData(SAFEARRAY*);
HRESULT SafeArrayDestroy(SAFEARRAY*);
HRESULT SafeArrayRedim(SAFEARRAY*, SAFEARRAYBOUND*);
uint SafeArrayGetDim(SAFEARRAY*);
uint SafeArrayGetElemsize(SAFEARRAY*);
HRESULT SafeArrayGetUBound(SAFEARRAY*, uint, int*);
HRESULT SafeArrayGetLBound(SAFEARRAY*, uint, int*);
HRESULT SafeArrayLock(SAFEARRAY*);
HRESULT SafeArrayUnlock(SAFEARRAY*);
HRESULT SafeArrayAccessData(SAFEARRAY*, void**);
HRESULT SafeArrayUnaccessData(SAFEARRAY*);
HRESULT SafeArrayGetElement(SAFEARRAY*, int*, void*);
HRESULT SafeArrayPutElement(SAFEARRAY*, int*, void*);
HRESULT SafeArrayCopy(SAFEARRAY*, SAFEARRAY**);
HRESULT SafeArrayPtrOfIndex(SAFEARRAY*, int*, void**);
SAFEARRAY* SafeArrayCreateVector(VARTYPE, LONG, ULONG);
SAFEARRAY* SafeArrayCreateVectorEx(VARTYPE, LONG, ULONG, LPVOID);
HRESULT SafeArrayAllocDescriptorEx(VARTYPE, UINT, SAFEARRAY**);
HRESULT SafeArrayGetVartype(SAFEARRAY*, VARTYPE*);
HRESULT SafeArraySetRecordInfo(SAFEARRAY*, IRecordInfo);
HRESULT SafeArrayGetRecordInfo(SAFEARRAY*, IRecordInfo*);
HRESULT SafeArraySetIID(SAFEARRAY*, REFGUID);
HRESULT SafeArrayGetIID(SAFEARRAY*, GUID*);
void VariantInit(VARIANTARG*);
HRESULT VariantClear(VARIANTARG*);
HRESULT VariantCopy(VARIANTARG*, VARIANTARG*);
HRESULT VariantCopyInd(VARIANT*, VARIANTARG*);
HRESULT VariantChangeType(VARIANTARG*, VARIANTARG*, ushort, VARTYPE);
HRESULT VariantChangeTypeEx(VARIANTARG*, VARIANTARG*, LCID, ushort, VARTYPE);
HRESULT VarUI1FromI2(short, ubyte*);
HRESULT VarUI1FromI4(int, ubyte*);
HRESULT VarUI1FromR4(float, ubyte*);
HRESULT VarUI1FromR8(double, ubyte*);
HRESULT VarUI1FromCy(CY, ubyte*);
HRESULT VarUI1FromDate(DATE, ubyte*);
HRESULT VarUI1FromStr(OLECHAR*, LCID, uint, ubyte*);
HRESULT VarUI1FromDisp(LPDISPATCH, LCID, ubyte*);
HRESULT VarUI1FromBool(VARIANT_BOOL, ubyte*);
HRESULT VarI2FromUI1(ubyte, short*);
HRESULT VarI2FromI4(int, short*);
HRESULT VarI2FromR4(float, short*);
HRESULT VarI2FromR8(double, short*);
HRESULT VarI2FromCy(CY cyIn, short*);
HRESULT VarI2FromDate(DATE, short*);
HRESULT VarI2FromStr(OLECHAR*, LCID, uint, short*);
HRESULT VarI2FromDisp(LPDISPATCH, LCID, short*);
HRESULT VarI2FromBool(VARIANT_BOOL, short*);
HRESULT VarI4FromUI1(ubyte, int*);
HRESULT VarI4FromI2(short, int*);
HRESULT VarI4FromR4(float, int*);
HRESULT VarI4FromR8(double, int*);
HRESULT VarI4FromCy(CY, int*);
HRESULT VarI4FromDate(DATE, int*);
HRESULT VarI4FromStr(OLECHAR*, LCID, uint, int*);
HRESULT VarI4FromDisp(LPDISPATCH, LCID, int*);
HRESULT VarI4FromBool(VARIANT_BOOL, int*);
HRESULT VarR4FromUI1(ubyte, float*);
HRESULT VarR4FromI2(short, float*);
HRESULT VarR4FromI4(int, float*);
HRESULT VarR4FromR8(double, float*);
HRESULT VarR4FromCy(CY, float*);
HRESULT VarR4FromDate(DATE, float*);
HRESULT VarR4FromStr(OLECHAR*, LCID, uint, float*);
HRESULT VarR4FromDisp(LPDISPATCH, LCID, float*);
HRESULT VarR4FromBool(VARIANT_BOOL, float*);
HRESULT VarR8FromUI1(ubyte, double*);
HRESULT VarR8FromI2(short, double*);
HRESULT VarR8FromI4(int, double*);
HRESULT VarR8FromR4(float, double*);
HRESULT VarR8FromCy(CY, double*);
HRESULT VarR8FromDate(DATE, double*);
HRESULT VarR8FromStr(OLECHAR*, LCID, uint, double*);
HRESULT VarR8FromDisp(LPDISPATCH, LCID, double*);
HRESULT VarR8FromBool(VARIANT_BOOL, double*);
HRESULT VarR8FromDec(DECIMAL*, double*);
HRESULT VarDateFromUI1(ubyte, DATE*);
HRESULT VarDateFromI2(short, DATE*);
HRESULT VarDateFromI4(int, DATE*);
HRESULT VarDateFromR4(float, DATE*);
HRESULT VarDateFromR8(double, DATE*);
HRESULT VarDateFromCy(CY, DATE*);
HRESULT VarDateFromStr(OLECHAR*, LCID, uint, DATE*);
HRESULT VarDateFromDisp(LPDISPATCH, LCID, DATE*);
HRESULT VarDateFromBool(VARIANT_BOOL, DATE*);
HRESULT VarCyFromUI1(ubyte, CY*);
HRESULT VarCyFromI2(short, CY*);
HRESULT VarCyFromI4(int, CY*);
HRESULT VarCyFromR4(float, CY*);
HRESULT VarCyFromR8(double, CY*);
HRESULT VarCyFromDate(DATE, CY*);
HRESULT VarCyFromStr(OLECHAR*, LCID, uint, CY*);
HRESULT VarCyFromDisp(LPDISPATCH, LCID, CY*);
HRESULT VarCyFromBool(VARIANT_BOOL, CY*);
HRESULT VarBstrFromUI1(ubyte, LCID, uint, BSTR*);
HRESULT VarBstrFromI2(short, LCID, uint, BSTR*);
HRESULT VarBstrFromI4(int, LCID, uint, BSTR*);
HRESULT VarBstrFromR4(float, LCID, uint, BSTR*);
HRESULT VarBstrFromR8(double, LCID, uint, BSTR*);
HRESULT VarBstrFromCy(CY, LCID, uint, BSTR*);
HRESULT VarBstrFromDate(DATE, LCID, uint, BSTR*);
HRESULT VarBstrFromDisp(LPDISPATCH, LCID, uint, BSTR*);
HRESULT VarBstrFromBool(VARIANT_BOOL, LCID, uint, BSTR*);
HRESULT VarBoolFromUI1(ubyte, VARIANT_BOOL*);
HRESULT VarBoolFromI2(short, VARIANT_BOOL*);
HRESULT VarBoolFromI4(int, VARIANT_BOOL*);
HRESULT VarBoolFromR4(float, VARIANT_BOOL*);
HRESULT VarBoolFromR8(double, VARIANT_BOOL*);
HRESULT VarBoolFromDate(DATE, VARIANT_BOOL*);
HRESULT VarBoolFromCy(CY, VARIANT_BOOL*);
HRESULT VarBoolFromStr(OLECHAR*, LCID, uint, VARIANT_BOOL*);
HRESULT VarBoolFromDisp(LPDISPATCH, LCID, VARIANT_BOOL*);
HRESULT VarDecFromR8(double, DECIMAL*);
ULONG LHashValOfNameSysA(SYSKIND, LCID, const(char)*);
ULONG LHashValOfNameSys(SYSKIND, LCID, const(OLECHAR)*);
HRESULT LoadTypeLib(const(OLECHAR)*, LPTYPELIB*);
HRESULT LoadTypeLibEx(LPCOLESTR, REGKIND, LPTYPELIB*);
HRESULT LoadRegTypeLib(REFGUID, WORD, WORD, LCID, LPTYPELIB*);
HRESULT QueryPathOfRegTypeLib(REFGUID, ushort, ushort, LCID, LPBSTR);
HRESULT RegisterTypeLib(LPTYPELIB, OLECHAR*, OLECHAR*);
HRESULT UnRegisterTypeLib(REFGUID, WORD, WORD, LCID, SYSKIND);
// not actually deprecated, but depends on unconverted ICreateTypeLib
deprecated HRESULT CreateTypeLib(SYSKIND, const(OLECHAR)*, LPCREATETYPELIB*);
HRESULT DispGetParam(DISPPARAMS*, UINT, VARTYPE, VARIANT*, UINT*);
HRESULT DispGetIDsOfNames(LPTYPEINFO, OLECHAR**, UINT, DISPID*);
HRESULT DispInvoke(void*, LPTYPEINFO, DISPID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);
HRESULT CreateDispTypeInfo(INTERFACEDATA*, LCID, LPTYPEINFO*);
HRESULT CreateStdDispatch(IUnknown, void*, LPTYPEINFO, IUnknown*);
HRESULT RegisterActiveObject(IUnknown, REFCLSID, DWORD, DWORD*);
HRESULT RevokeActiveObject(DWORD, void*);
HRESULT GetActiveObject(REFCLSID, void*, IUnknown*);
HRESULT SetErrorInfo(uint, LPERRORINFO);
HRESULT GetErrorInfo(uint, LPERRORINFO*);
HRESULT CreateErrorInfo(LPCREATEERRORINFO*);
uint OaBuildVersion();
HRESULT VectorFromBstr (BSTR, SAFEARRAY**);
HRESULT BstrFromVector (SAFEARRAY*, BSTR*);
HRESULT VarParseNumFromStr(OLECHAR*, LCID, ULONG, NUMPARSE*, BYTE*);
HRESULT VarNumFromParseNum(NUMPARSE*, BYTE*, ULONG, VARIANT*);
HRESULT VarAdd(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarSub(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarMul(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarDiv(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarUI1FromI2(SHORT, BYTE*);
HRESULT VarUI1FromI4(LONG, BYTE*);
HRESULT VarUI1FromI8(LONG64, BYTE*);
HRESULT VarUI1FromR4(FLOAT, BYTE*);
HRESULT VarUI1FromR8(DOUBLE, BYTE*);
HRESULT VarUI1FromDate(DATE, BYTE*);
HRESULT VarUI1FromBool(VARIANT_BOOL, BYTE*);
HRESULT VarUI1FromI1(byte, BYTE*);
HRESULT VarUI1FromUI2(USHORT, BYTE*);
HRESULT VarUI1FromUI4(ULONG, BYTE*);
HRESULT VarUI1FromUI8(ULONG64, BYTE*);
HRESULT VarUI1FromStr(OLECHAR*, LCID, ULONG, BYTE*);
HRESULT VarUI1FromCy(CY, BYTE*);
HRESULT VarUI1FromDec(DECIMAL*, BYTE*);
HRESULT VarUI1FromDisp(IDispatch, LCID, BYTE*);
HRESULT VarI2FromUI1(BYTE, SHORT*);
HRESULT VarI2FromI4(LONG, SHORT*);
HRESULT VarI2FromI8(LONG64, SHORT*);
HRESULT VarI2FromR4(FLOAT, SHORT*);
HRESULT VarI2FromR8(DOUBLE, SHORT*);
HRESULT VarI2FromDate(DATE, SHORT*);
HRESULT VarI2FromBool(VARIANT_BOOL, SHORT*);
HRESULT VarI2FromI1(byte, SHORT*);
HRESULT VarI2FromUI2(USHORT, SHORT*);
HRESULT VarI2FromUI4(ULONG, SHORT*);
HRESULT VarI2FromUI8(ULONG64, SHORT*);
HRESULT VarI2FromStr(OLECHAR*, LCID, ULONG, SHORT*);
HRESULT VarI2FromCy(CY, SHORT*);
HRESULT VarI2FromDec(DECIMAL*, SHORT*);
HRESULT VarI2FromDisp(IDispatch, LCID, SHORT*);
HRESULT VarI4FromUI1(BYTE, LONG*);
HRESULT VarI4FromI2(SHORT, LONG*);
HRESULT VarI4FromI8(LONG64, LONG*);
HRESULT VarI4FromR4(FLOAT, LONG*);
HRESULT VarI4FromR8(DOUBLE, LONG*);
HRESULT VarI4FromDate(DATE, LONG*);
HRESULT VarI4FromBool(VARIANT_BOOL, LONG*);
HRESULT VarI4FromI1(byte, LONG*);
HRESULT VarI4FromUI2(USHORT, LONG*);
HRESULT VarI4FromUI4(ULONG, LONG*);
HRESULT VarI4FromUI8(ULONG64, LONG*);
HRESULT VarI4FromStr(OLECHAR*, LCID, ULONG, LONG*);
HRESULT VarI4FromCy(CY, LONG*);
HRESULT VarI4FromDec(DECIMAL*, LONG*);
HRESULT VarI4FromDisp(IDispatch, LCID, LONG*);
HRESULT VarI8FromUI1(BYTE, LONG64*);
HRESULT VarI8FromI2(SHORT, LONG64*);
HRESULT VarI8FromI4(LONG, LONG64*);
HRESULT VarI8FromR4(FLOAT, LONG64*);
HRESULT VarI8FromR8(DOUBLE, LONG64*);
HRESULT VarI8FromDate(DATE, LONG64*);
HRESULT VarI8FromStr(OLECHAR*, LCID, ULONG, LONG64*);
HRESULT VarI8FromBool(VARIANT_BOOL, LONG64*);
HRESULT VarI8FromI1(byte, LONG64*);
HRESULT VarI8FromUI2(USHORT, LONG64*);
HRESULT VarI8FromUI4(ULONG, LONG64*);
HRESULT VarI8FromUI8(ULONG64, LONG64*);
HRESULT VarI8FromDec(DECIMAL* pdecIn, LONG64*);
HRESULT VarI8FromInt(INT intIn, LONG64*);
HRESULT VarI8FromCy(CY, LONG64*);
HRESULT VarI8FromDisp(IDispatch, LCID, LONG64*);
HRESULT VarR4FromUI1(BYTE, FLOAT*);
HRESULT VarR4FromI2(SHORT, FLOAT*);
HRESULT VarR4FromI4(LONG, FLOAT*);
HRESULT VarR4FromI8(LONG64, FLOAT*);
HRESULT VarR4FromR8(DOUBLE, FLOAT*);
HRESULT VarR4FromDate(DATE, FLOAT*);
HRESULT VarR4FromBool(VARIANT_BOOL, FLOAT*);
HRESULT VarR4FromI1(byte, FLOAT*);
HRESULT VarR4FromUI2(USHORT, FLOAT*);
HRESULT VarR4FromUI4(ULONG, FLOAT*);
HRESULT VarR4FromUI8(ULONG64, FLOAT*);
HRESULT VarR4FromStr(OLECHAR*, LCID, ULONG, FLOAT*);
HRESULT VarR4FromCy(CY, FLOAT*);
HRESULT VarR4FromDec(DECIMAL*, FLOAT*);
HRESULT VarR4FromDisp(IDispatch, LCID, FLOAT*);
HRESULT VarR8FromUI1(BYTE, double*);
HRESULT VarR8FromI2(SHORT, double*);
HRESULT VarR8FromI4(LONG, double*);
HRESULT VarR8FromI8(LONG64, double*);
HRESULT VarR8FromR4(FLOAT, double*);
HRESULT VarR8FromDate(DATE, double*);
HRESULT VarR8FromBool(VARIANT_BOOL, double*);
HRESULT VarR8FromI1(byte, double*);
HRESULT VarR8FromUI2(USHORT, double*);
HRESULT VarR8FromUI4(ULONG, double*);
HRESULT VarR8FromUI8(ULONG64, double*);
HRESULT VarR8FromStr(OLECHAR*, LCID, ULONG, double*);
HRESULT VarR8FromCy(CY, double*);
HRESULT VarR8FromDec(DECIMAL*, double*);
HRESULT VarR8FromDisp(IDispatch, LCID, double*);
HRESULT VarDateFromUI1(BYTE, DATE*);
HRESULT VarDateFromI2(SHORT, DATE*);
HRESULT VarDateFromI4(LONG, DATE*);
HRESULT VarDateFromI8(LONG64, DATE*);
HRESULT VarDateFromR4(FLOAT, DATE*);
HRESULT VarDateFromR8(DOUBLE, DATE*);
HRESULT VarDateFromStr(OLECHAR*, LCID, ULONG, DATE*);
HRESULT VarDateFromI1(byte, DATE*);
HRESULT VarDateFromUI2(USHORT, DATE*);
HRESULT VarDateFromUI4(ULONG, DATE*);
HRESULT VarDateFromUI8(ULONG64, DATE*);
HRESULT VarDateFromBool(VARIANT_BOOL, DATE*);
HRESULT VarDateFromCy(CY, DATE*);
HRESULT VarDateFromDec(DECIMAL*, DATE*);
HRESULT VarDateFromDisp(IDispatch, LCID, DATE*);
HRESULT VarCyFromUI1(BYTE, CY*);
HRESULT VarCyFromI2(SHORT sIn, CY*);
HRESULT VarCyFromI4(LONG, CY*);
HRESULT VarCyFromI8(LONG64, CY*);
HRESULT VarCyFromR4(FLOAT, CY*);
HRESULT VarCyFromR8(DOUBLE, CY*);
HRESULT VarCyFromDate(DATE, CY*);
HRESULT VarCyFromStr(OLECHAR*, LCID, ULONG, CY*);
HRESULT VarCyFromBool(VARIANT_BOOL, CY*);
HRESULT VarCyFromI1(byte, CY*);
HRESULT VarCyFromUI2(USHORT, CY*);
HRESULT VarCyFromUI4(ULONG, CY*);
HRESULT VarCyFromUI8(ULONG64, CY*);
HRESULT VarCyFromDec(DECIMAL*, CY*);
HRESULT VarCyFromStr(OLECHAR*, LCID, ULONG, CY*);
HRESULT VarCyFromDisp(IDispatch, LCID, CY*);
HRESULT VarBstrFromUI1(BYTE, LCID, ULONG, BSTR*);
HRESULT VarBstrFromI2(SHORT, LCID, ULONG, BSTR*);
HRESULT VarBstrFromI4(LONG, LCID, ULONG, BSTR*);
HRESULT VarBstrFromI8(LONG64, LCID, ULONG, BSTR*);
HRESULT VarBstrFromR4(FLOAT, LCID, ULONG, BSTR*);
HRESULT VarBstrFromR8(DOUBLE, LCID, ULONG, BSTR*);
HRESULT VarBstrFromDate(DATE, LCID, ULONG, BSTR*);
HRESULT VarBstrFromBool(VARIANT_BOOL, LCID, ULONG, BSTR*);
HRESULT VarBstrFromI1(byte, LCID, ULONG, BSTR*);
HRESULT VarBstrFromUI2(USHORT, LCID, ULONG, BSTR*);
HRESULT VarBstrFromUI8(ULONG64, LCID, ULONG, BSTR*);
HRESULT VarBstrFromUI4(ULONG, LCID, ULONG, BSTR*);
HRESULT VarBstrFromCy(CY, LCID, ULONG, BSTR*);
HRESULT VarBstrFromDec(DECIMAL*, LCID, ULONG, BSTR*);
HRESULT VarBstrFromDisp(IDispatch, LCID, ULONG, BSTR*);
HRESULT VarBoolFromUI1(BYTE, VARIANT_BOOL*);
HRESULT VarBoolFromI2(SHORT, VARIANT_BOOL*);
HRESULT VarBoolFromI4(LONG, VARIANT_BOOL*);
HRESULT VarBoolFromI8(LONG64, VARIANT_BOOL*);
HRESULT VarBoolFromR4(FLOAT, VARIANT_BOOL*);
HRESULT VarBoolFromR8(DOUBLE, VARIANT_BOOL*);
HRESULT VarBoolFromDate(DATE, VARIANT_BOOL*);
HRESULT VarBoolFromStr(OLECHAR*, LCID, ULONG, VARIANT_BOOL*);
HRESULT VarBoolFromI1(byte, VARIANT_BOOL*);
HRESULT VarBoolFromUI2(USHORT, VARIANT_BOOL*);
HRESULT VarBoolFromUI4(ULONG, VARIANT_BOOL*);
HRESULT VarBoolFromUI8(ULONG64, VARIANT_BOOL*);
HRESULT VarBoolFromCy(CY, VARIANT_BOOL*);
HRESULT VarBoolFromDec(DECIMAL*, VARIANT_BOOL*);
HRESULT VarBoolFromDisp(IDispatch, LCID, VARIANT_BOOL*);
HRESULT VarI1FromUI1(BYTE, byte*);
HRESULT VarI1FromI2(SHORT, byte*);
HRESULT VarI1FromI4(LONG, byte*);
HRESULT VarI1FromI8(LONG64, byte*);
HRESULT VarI1FromR4(FLOAT, byte*);
HRESULT VarI1FromR8(DOUBLE, byte*);
HRESULT VarI1FromDate(DATE, byte*);
HRESULT VarI1FromStr(OLECHAR*, LCID, ULONG, byte*);
HRESULT VarI1FromBool(VARIANT_BOOL, byte*);
HRESULT VarI1FromUI2(USHORT, byte*);
HRESULT VarI1FromUI4(ULONG, byte*);
HRESULT VarI1FromUI8(ULONG64, byte*);
HRESULT VarI1FromCy(CY, byte*);
HRESULT VarI1FromDec(DECIMAL*, byte*);
HRESULT VarI1FromDisp(IDispatch, LCID, byte*);
HRESULT VarUI2FromUI1(BYTE, USHORT*);
HRESULT VarUI2FromI2(SHORT, USHORT*);
HRESULT VarUI2FromI4(LONG, USHORT*);
HRESULT VarUI2FromI8(LONG64, USHORT*);
HRESULT VarUI2FromR4(FLOAT, USHORT*);
HRESULT VarUI2FromR8(DOUBLE, USHORT*);
HRESULT VarUI2FromDate(DATE, USHORT*);
HRESULT VarUI2FromStr(OLECHAR*, LCID, ULONG, USHORT*);
HRESULT VarUI2FromBool(VARIANT_BOOL, USHORT*);
HRESULT VarUI2FromI1(byte, USHORT*);
HRESULT VarUI2FromUI4(ULONG, USHORT*);
HRESULT VarUI2FromUI8(ULONG64, USHORT*);
HRESULT VarUI2FromCy(CY, USHORT*);
HRESULT VarUI2FromDec(DECIMAL*, USHORT*);
HRESULT VarUI2FromDisp(IDispatch, LCID, USHORT*);
HRESULT VarUI4FromStr(OLECHAR*, LCID, ULONG, ULONG*);
HRESULT VarUI4FromUI1(BYTE, ULONG*);
HRESULT VarUI4FromI2(SHORT, ULONG*);
HRESULT VarUI4FromI4(LONG, ULONG*);
HRESULT VarUI4FromI8(LONG64, ULONG*);
HRESULT VarUI4FromR4(FLOAT, ULONG*);
HRESULT VarUI4FromR8(DOUBLE, ULONG*);
HRESULT VarUI4FromDate(DATE, ULONG*);
HRESULT VarUI4FromBool(VARIANT_BOOL, ULONG*);
HRESULT VarUI4FromI1(byte, ULONG*);
HRESULT VarUI4FromUI2(USHORT, ULONG*);
HRESULT VarUI4FromUI8(ULONG64, ULONG*);
HRESULT VarUI4FromCy(CY, ULONG*);
HRESULT VarUI4FromDec(DECIMAL*, ULONG*);
HRESULT VarUI4FromDisp(IDispatch, LCID, ULONG*);
HRESULT VarUI8FromUI1(BYTE, ULONG64*);
HRESULT VarUI8FromI2(SHORT, ULONG64*);
HRESULT VarUI8FromI4(LONG, ULONG64*);
HRESULT VarUI8FromI8(LONG64, ULONG64*);
HRESULT VarUI8FromR4(FLOAT, ULONG64*);
HRESULT VarUI8FromR8(DOUBLE, ULONG64*);
HRESULT VarUI8FromDate(DATE, ULONG64*);
HRESULT VarUI8FromStr(OLECHAR*, LCID, ULONG, ULONG64*);
HRESULT VarUI8FromBool(VARIANT_BOOL, ULONG64*);
HRESULT VarUI8FromI1(byte, ULONG64*);
HRESULT VarUI8FromUI2(USHORT, ULONG64*);
HRESULT VarUI8FromUI4(ULONG, ULONG64*);
HRESULT VarUI8FromDec(DECIMAL*, ULONG64*);
HRESULT VarUI8FromInt(INT, ULONG64*);
HRESULT VarUI8FromCy(CY, ULONG64*);
HRESULT VarUI8FromDisp(IDispatch, LCID, ULONG64*);
HRESULT VarDecFromUI1(BYTE, DECIMAL*);
HRESULT VarDecFromI2(SHORT, DECIMAL*);
HRESULT VarDecFromI4(LONG, DECIMAL*);
HRESULT VarDecFromI8(LONG64, DECIMAL*);
HRESULT VarDecFromR4(FLOAT, DECIMAL*);
HRESULT VarDecFromR8(DOUBLE, DECIMAL*);
HRESULT VarDecFromDate(DATE, DECIMAL*);
HRESULT VarDecFromStr(OLECHAR*, LCID, ULONG, DECIMAL*);
HRESULT VarDecFromBool(VARIANT_BOOL, DECIMAL*);
HRESULT VarDecFromI1(byte, DECIMAL*);
HRESULT VarDecFromUI2(USHORT, DECIMAL*);
HRESULT VarDecFromUI4(ULONG, DECIMAL*);
HRESULT VarDecFromUI8(ULONG64, DECIMAL*);
HRESULT VarDecFromCy(CY, DECIMAL*);
HRESULT VarDecFromDisp(IDispatch, LCID, DECIMAL*);
HRESULT VarDecNeg(const(DECIMAL)*, DECIMAL*);
HRESULT VarR4CmpR8(float, double);
HRESULT VarR8Pow(double, double, double*);
HRESULT VarR8Round(double, int, double*);
HRESULT VarDecAbs(const(DECIMAL)*, DECIMAL*);
HRESULT VarDecAdd(const(DECIMAL)*, const(DECIMAL)*, DECIMAL*);
HRESULT VarDecCmp(const(DECIMAL)*, const(DECIMAL)*);
HRESULT VarDecCmpR8(const(DECIMAL)*, DOUBLE);
HRESULT VarDecDiv(const(DECIMAL)*, const(DECIMAL)*, DECIMAL*);
HRESULT VarDecFix(const(DECIMAL)*, DECIMAL*);
HRESULT VarDecInt(const(DECIMAL)*, DECIMAL*);
HRESULT VarDecMul(const(DECIMAL)*, const(DECIMAL)*, DECIMAL*);
HRESULT VarDecRound(const(DECIMAL)*, int, DECIMAL*);
HRESULT VarDecSub(const(DECIMAL)*, const(DECIMAL)*, DECIMAL*);
HRESULT VarCyAbs(CY, CY*);
HRESULT VarCyAdd(CY, CY, CY*);
HRESULT VarCyCmp(CY, CY);
HRESULT VarCyCmpR8(CY, DOUBLE);
HRESULT VarCyFix(CY, CY*);
HRESULT VarCyInt(CY, CY*);
HRESULT VarCyMul(CY, CY, CY*);
HRESULT VarCyMulI4(CY, LONG, CY*);
HRESULT VarCyMulI8(CY, LONG64, CY*);
HRESULT VarCyNeg(CY, CY*);
HRESULT VarCyRound(CY, INT, CY*);
HRESULT VarCySub(CY, CY, CY*);
HRESULT VarAdd(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarAnd(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarCat(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarDiv(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarEqv(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarIdiv(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarImp(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarMod(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarMul(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarOr(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarPow(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarSub(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarXor(LPVARIANT, LPVARIANT, LPVARIANT);
HRESULT VarAbs(LPVARIANT, LPVARIANT);
HRESULT VarFix(LPVARIANT, LPVARIANT);
HRESULT VarInt(LPVARIANT, LPVARIANT);
HRESULT VarNeg(LPVARIANT, LPVARIANT);
HRESULT VarNot(LPVARIANT, LPVARIANT);
HRESULT VarRound(LPVARIANT, int, LPVARIANT);
HRESULT VarCmp(LPVARIANT, LPVARIANT, LCID, ULONG);
HRESULT VarBstrCmp(BSTR, BSTR, LCID, ULONG);
HRESULT VarBstrCat(BSTR, BSTR, BSTR*);
}
|
D
|
/**
* This module contains objects for defining and scoping dependency registrations.
*
* Part of the Poodinis Dependency Injection framework.
*
* Authors:
* Mike Bierlee, m.bierlee@lostmoment.com
* Copyright: 2014-2023 Mike Bierlee
* License:
* This software is licensed under the terms of the MIT license.
* The full terms of the license can be found in the LICENSE file.
*/
module poodinis.registration;
import poodinis.container : DependencyContainer;
import poodinis.factory : InstanceFactory, InstanceEventHandler,
InstanceCreationException, InstanceFactoryParameters, CreatesSingleton;
class Registration {
private TypeInfo _registeredType = null;
private TypeInfo_Class _instanceType = null;
private Registration linkedRegistration;
private shared(DependencyContainer) _originatingContainer;
private InstanceFactory _instanceFactory;
private void delegate() _preDestructor;
public @property registeredType() {
return _registeredType;
}
public @property instanceType() {
return _instanceType;
}
public @property originatingContainer() {
return _originatingContainer;
}
public @property instanceFactory() {
return _instanceFactory;
}
public @property preDestructor() {
return _preDestructor;
}
protected @property preDestructor(void delegate() preDestructor) {
_preDestructor = preDestructor;
}
this(TypeInfo registeredType, TypeInfo_Class instanceType,
InstanceFactory instanceFactory, shared(DependencyContainer) originatingContainer) {
this._registeredType = registeredType;
this._instanceType = instanceType;
this._originatingContainer = originatingContainer;
this._instanceFactory = instanceFactory;
}
public Object getInstance(InstantiationContext context = new InstantiationContext()) {
if (linkedRegistration !is null) {
return linkedRegistration.getInstance(context);
}
if (instanceFactory is null) {
throw new InstanceCreationException(
"No instance factory defined for registration of type " ~ registeredType.toString());
}
return instanceFactory.getInstance();
}
public Registration linkTo(Registration registration) {
this.linkedRegistration = registration;
return this;
}
Registration onConstructed(InstanceEventHandler handler) {
if (instanceFactory !is null)
instanceFactory.onConstructed(handler);
return this;
}
}
private InstanceFactoryParameters copyFactoryParameters(Registration registration) {
return registration.instanceFactory.factoryParameters;
}
private void setFactoryParameters(Registration registration, InstanceFactoryParameters newParameters) {
registration.instanceFactory.factoryParameters = newParameters;
}
/**
* Sets the registration's instance factory type the same as the registration's.
*
* This is not a registration scope. Typically used by Poodinis internally only.
*/
public Registration initializeFactoryType(Registration registration) {
auto params = registration.copyFactoryParameters();
params.instanceType = registration.instanceType;
registration.setFactoryParameters(params);
return registration;
}
/**
* Scopes registrations to return the same instance every time a given registration is resolved.
*
* Effectively makes the given registration a singleton.
*/
public Registration singleInstance(Registration registration) {
auto params = registration.copyFactoryParameters();
params.createsSingleton = CreatesSingleton.yes;
registration.setFactoryParameters(params);
return registration;
}
/**
* Scopes registrations to return a new instance every time the given registration is resolved.
*/
public Registration newInstance(Registration registration) {
auto params = registration.copyFactoryParameters();
params.createsSingleton = CreatesSingleton.no;
params.existingInstance = null;
registration.setFactoryParameters(params);
return registration;
}
/**
* Scopes registrations to return the given instance every time the given registration is resolved.
*/
public Registration existingInstance(Registration registration, Object instance) {
auto params = registration.copyFactoryParameters();
params.createsSingleton = CreatesSingleton.yes;
params.existingInstance = instance;
registration.setFactoryParameters(params);
return registration;
}
/**
* Scopes registrations to create new instances using the given initializer delegate.
*/
public Registration initializedBy(T)(Registration registration, T delegate() initializer)
if (is(T == class) || is(T == interface)) {
auto params = registration.copyFactoryParameters();
params.createsSingleton = CreatesSingleton.no;
params.factoryMethod = () => cast(Object) initializer();
registration.setFactoryParameters(params);
return registration;
}
/**
* Scopes registrations to create a new instance using the given initializer delegate. On subsequent resolves the same instance is returned.
*/
public Registration initializedOnceBy(T : Object)(Registration registration, T delegate() initializer) {
auto params = registration.copyFactoryParameters();
params.createsSingleton = CreatesSingleton.yes;
params.factoryMethod = () => cast(Object) initializer();
registration.setFactoryParameters(params);
return registration;
}
public string toConcreteTypeListString(Registration[] registrations) {
auto concreteTypeListString = "";
foreach (registration; registrations) {
if (concreteTypeListString.length > 0) {
concreteTypeListString ~= ", ";
}
concreteTypeListString ~= registration.instanceType.toString();
}
return concreteTypeListString;
}
class InstantiationContext {
}
|
D
|
write("1");
{
write("2");
scope(exit) write("3");
scope(exit) write("4");
write("5");
}
writeln();
|
D
|
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.build/Portal.swift.o : /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.build/Portal~partial.swiftmodule : /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/DanielChang/Documents/Vapor/Hello/.build/debug/Core.build/Portal~partial.swiftdoc : /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/String.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/DanielChang/Documents/Vapor/Hello/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/DanielChang/Documents/Vapor/Hello/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
|
D
|
/Users/laurennicoleroth/Development/iOS/Sorting/Build/Intermediates/Sorting.build/Debug-iphonesimulator/Sorting.build/Objects-normal/x86_64/AppDelegate.o : /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/AppDelegate.swift /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/laurennicoleroth/Development/iOS/Sorting/Build/Intermediates/Sorting.build/Debug-iphonesimulator/Sorting.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/AppDelegate.swift /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/laurennicoleroth/Development/iOS/Sorting/Build/Intermediates/Sorting.build/Debug-iphonesimulator/Sorting.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/AppDelegate.swift /Users/laurennicoleroth/Development/iOS/Sorting/Sorting/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
|
D
|
module dmagick.c.imageView;
import dmagick.c.exception;
import dmagick.c.geometry;
import dmagick.c.image;
import dmagick.c.magickType;
import dmagick.c.magickVersion;
import dmagick.c.pixel;
alias ptrdiff_t ssize_t;
extern(C)
{
struct ImageView {}
alias MagickBooleanType function(const(ImageView)*, const(ImageView)*, ImageView*, const ssize_t, const int, void*) DuplexTransferImageViewMethod;
alias MagickBooleanType function(const(ImageView)*, const ssize_t, const int, void*) GetImageViewMethod;
alias MagickBooleanType function(ImageView*, const ssize_t, const int, void*) SetImageViewMethod;
alias MagickBooleanType function(const(ImageView)*, ImageView*, const ssize_t, const int, void*) TransferImageViewMethod;
alias MagickBooleanType function(ImageView*, const ssize_t, const int, void*) UpdateImageViewMethod;
char* GetImageViewException(const(ImageView)*, ExceptionType*);
const(IndexPacket)* GetImageViewVirtualIndexes(const(ImageView)*);
const(PixelPacket)* GetImageViewVirtualPixels(const(ImageView)*);
Image* GetImageViewImage(const(ImageView)*);
ImageView* CloneImageView(const(ImageView)*);
ImageView* DestroyImageView(ImageView*);
ImageView* NewImageView(Image*);
ImageView* NewImageViewRegion(Image*, const ssize_t, const ssize_t, const size_t, const size_t);
IndexPacket* GetImageViewAuthenticIndexes(const(ImageView)*);
MagickBooleanType DuplexTransferImageViewIterator(ImageView*, ImageView*, ImageView*, DuplexTransferImageViewMethod, void*);
MagickBooleanType GetImageViewIterator(ImageView*, GetImageViewMethod, void*);
MagickBooleanType IsImageView(const(ImageView)*);
MagickBooleanType SetImageViewIterator(ImageView*, SetImageViewMethod, void*);
MagickBooleanType TransferImageViewIterator(ImageView*, ImageView*, TransferImageViewMethod, void*);
MagickBooleanType UpdateImageViewIterator(ImageView*, UpdateImageViewMethod, void*);
PixelPacket* GetImageViewAuthenticPixels(const(ImageView)*);
RectangleInfo GetImageViewExtent(const(ImageView)*);
void SetImageViewDescription(ImageView*, const(char)*);
static if ( MagickLibVersion >= 0x665 )
{
void SetImageViewThreads(ImageView*, const size_t);
}
}
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;
void main()
{
auto n = readln.chomp.to!int;
int[][] G;
G.length = n;
foreach (i; 0..n) {
auto ukv = readln.split.to!(int[]);
if (ukv[1] > 0) foreach (j; ukv[2..$]) G[i] ~= j-1;
}
auto ds = new int[](n);
auto fs = new int[](n);
int go(int i, int t) {
ds[i] = t;
foreach (j; G[i]) if (ds[j] == 0) t = go(j, t+1);
fs[i] = t+1;
return t+1;
}
int t = 1;
foreach (i; 0..n) if (ds[i] == 0) t = go(i, t) + 1;
foreach (i; 0..n) {
writefln("%d %d %d", i+1, ds[i], fs[i]);
}
}
|
D
|
instance DIA_Salandril_EXIT(C_Info)
{
npc = VLK_422_Salandril;
nr = 999;
condition = DIA_Salandril_EXIT_Condition;
information = DIA_Salandril_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Salandril_EXIT_Condition()
{
if(Kapitel < 3)
{
return TRUE;
};
};
func void DIA_Salandril_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Salandril_PICKPOCKET(C_Info)
{
npc = VLK_422_Salandril;
nr = 900;
condition = DIA_Salandril_PICKPOCKET_Condition;
information = DIA_Salandril_PICKPOCKET_Info;
permanent = TRUE;
description = "(It would be easy to steal his key)";
};
var int DIA_Salandril_PICKPOCKET_perm;
func int DIA_Salandril_PICKPOCKET_Condition()
{
if((Npc_GetTalentSkill(other,NPC_TALENT_PICKPOCKET) == 1) && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) && (DIA_Salandril_PICKPOCKET_perm == FALSE) && (other.attribute[ATR_DEXTERITY] >= (30 - Theftdiff)))
{
return TRUE;
};
};
func void DIA_Salandril_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Salandril_PICKPOCKET);
Info_AddChoice(DIA_Salandril_PICKPOCKET,Dialog_Back,DIA_Salandril_PICKPOCKET_BACK);
Info_AddChoice(DIA_Salandril_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Salandril_PICKPOCKET_DoIt);
};
func void DIA_Salandril_PICKPOCKET_DoIt()
{
if(other.attribute[ATR_DEXTERITY] >= 30)
{
CreateInvItems(self,ItKe_Salandril,1);
B_GiveInvItems(self,other,ItKe_Salandril,1);
self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE;
DIA_Salandril_PICKPOCKET_perm = TRUE;
B_GivePlayerXP(XP_Ambient);
Info_ClearChoices(DIA_Salandril_PICKPOCKET);
}
else
{
AI_StopProcessInfos(self);
B_Attack(self,other,AR_Theft,1);
};
};
func void DIA_Salandril_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Salandril_PICKPOCKET);
};
instance DIA_Salandril_Hallo(C_Info)
{
npc = VLK_422_Salandril;
nr = 2;
condition = DIA_Salandril_Hallo_Condition;
information = DIA_Salandril_Hallo_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Salandril_Hallo_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (MIS_OLDWORLD != LOG_SUCCESS))
{
return TRUE;
};
};
func void DIA_Salandril_Hallo_Info()
{
AI_Output(self,other,"DIA_Salandril_PERM_13_00"); //Welcome, traveler. Looking for a fine potion?
AI_Output(self,other,"DIA_Salandril_PERM_13_01"); //I have a large selection and reasonable prices. And my potions are much better than the stuff that Zuris sells.
Log_CreateTopic(TOPIC_CityTrader,LOG_NOTE);
B_LogEntry(TOPIC_CityTrader,"Salandril sells potions. His shop is in the upper quarter.");
};
instance DIA_Salandril_Trank(C_Info)
{
npc = VLK_422_Salandril;
nr = 2;
condition = DIA_Salandril_Trank_Condition;
information = DIA_Salandril_Trank_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Salandril_Trank_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (MIS_OLDWORLD == LOG_SUCCESS) && (Npc_KnowsInfo(other,DIA_Salandril_KLOSTER) == FALSE))
{
return TRUE;
};
};
func void DIA_Salandril_Trank_Info()
{
AI_Output(self,other,"DIA_Salandril_Trank_13_00"); //I've heard you were with the paladins in the Valley of Mines. I'm impressed.
AI_Output(self,other,"DIA_Salandril_Trank_13_01"); //You should take your time and browse my goods. Right now, I have a very special potion to offer.
CreateInvItems(self,ItPo_Perm_DEX,1);
};
instance DIA_Salandril_Trade(C_Info)
{
npc = VLK_422_Salandril;
nr = 9;
condition = DIA_Salandril_Trade_Condition;
information = DIA_Salandril_Trade_Info;
permanent = TRUE;
description = "Show me your wares.";
trade = TRUE;
};
func int DIA_Salandril_Trade_Condition()
{
if(Npc_KnowsInfo(other,DIA_Salandril_KLOSTER) == FALSE)
{
return TRUE;
};
};
func void DIA_Salandril_Trade_Info()
{
B_GiveTradeInv(self);
AI_Output(other,self,"DIA_Salandril_Trade_15_00"); //Show me your wares.
if(other.guild == GIL_KDF)
{
AI_Output(self,other,"DIA_Salandril_Trade_13_01"); //It's my pleasure, reverend brother.
if(MIS_Serpentes_MinenAnteil_KDF == LOG_Running)
{
SC_KnowsProspektorSalandril = TRUE;
};
};
if(other.guild == GIL_PAL)
{
AI_Output(self,other,"DIA_Salandril_Trade_13_02"); //It's my pleasure, noble warrior.
};
};
instance DIA_Salandril_KAP3_EXIT(C_Info)
{
npc = VLK_422_Salandril;
nr = 999;
condition = DIA_Salandril_KAP3_EXIT_Condition;
information = DIA_Salandril_KAP3_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Salandril_KAP3_EXIT_Condition()
{
if(Kapitel == 3)
{
return TRUE;
};
};
func void DIA_Salandril_KAP3_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Salandril_KLOSTER(C_Info)
{
npc = VLK_422_Salandril;
nr = 2;
condition = DIA_Salandril_KLOSTER_Condition;
information = DIA_Salandril_KLOSTER_Info;
description = "You go to the monastery now to be judged.";
};
func int DIA_Salandril_KLOSTER_Condition()
{
if((SC_KnowsProspektorSalandril == TRUE) || (MIS_Serpentes_BringSalandril_SLD == LOG_Running))
{
return TRUE;
};
};
func void DIA_Salandril_KLOSTER_Info()
{
AI_Output(other,self,"DIA_Salandril_KLOSTER_15_00"); //You go to the monastery now to be judged.
AI_Output(self,other,"DIA_Salandril_KLOSTER_13_01"); //What? Have you gone off your rocker? Like hell I will. Those miserable magicians don't have the slightest proof against me.
if((hero.guild == GIL_KDF) && (SC_KnowsProspektorSalandril == TRUE))
{
AI_Output(other,self,"DIA_Salandril_KLOSTER_15_02"); //And what about those fake ore mining shares you've huckstered all over the country? They bear your signature. You're guilty.
}
else
{
AI_Output(other,self,"DIA_Salandril_KLOSTER_15_03"); //I have my orders, and I'm going to carry them out. So either you go now, or I'll make you.
};
AI_Output(self,other,"DIA_Salandril_KLOSTER_13_04"); //What? I'll drag you through town by your collar like a filthy rag.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
instance DIA_Salandril_GehinsKloster(C_Info)
{
npc = VLK_422_Salandril;
nr = 2;
condition = DIA_Salandril_GehinsKloster_Condition;
information = DIA_Salandril_GehinsKloster_Info;
description = "So are you going to the monastery now, or should I give you another ...?";
};
func int DIA_Salandril_GehinsKloster_Condition()
{
if(((SC_KnowsProspektorSalandril == TRUE) || (MIS_Serpentes_BringSalandril_SLD == LOG_Running)) && (self.aivar[AIV_LastFightAgainstPlayer] == FIGHT_LOST) && Npc_KnowsInfo(other,DIA_Salandril_KLOSTER))
{
return TRUE;
};
};
func void DIA_Salandril_GehinsKloster_Info()
{
AI_Output(other,self,"DIA_Salandril_GehinsKloster_15_00"); //So are you going to the monastery now, or should I give you another ...?
AI_Output(self,other,"DIA_Salandril_GehinsKloster_13_01"); //You'll live to regret to this. Yes, damnit, I'll go to that monastery, but don't you think you'll get away with this.
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"KlosterUrteil");
MIS_Serpentes_BringSalandril_SLD = LOG_SUCCESS;
};
instance DIA_Salandril_Verschwinde(C_Info)
{
npc = VLK_422_Salandril;
nr = 2;
condition = DIA_Salandril_Verschwinde_Condition;
information = DIA_Salandril_Verschwinde_Info;
important = TRUE;
permanent = TRUE;
};
func int DIA_Salandril_Verschwinde_Condition()
{
if((MIS_Serpentes_BringSalandril_SLD == LOG_SUCCESS) && Npc_IsInState(self,ZS_Talk))
{
return TRUE;
};
};
func void DIA_Salandril_Verschwinde_Info()
{
B_Verschwinde_Stimme13();
AI_StopProcessInfos(self);
};
instance DIA_Salandril_KAP4_EXIT(C_Info)
{
npc = VLK_422_Salandril;
nr = 999;
condition = DIA_Salandril_KAP4_EXIT_Condition;
information = DIA_Salandril_KAP4_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Salandril_KAP4_EXIT_Condition()
{
if(Kapitel == 4)
{
return TRUE;
};
};
func void DIA_Salandril_KAP4_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Salandril_KAP5_EXIT(C_Info)
{
npc = VLK_422_Salandril;
nr = 999;
condition = DIA_Salandril_KAP5_EXIT_Condition;
information = DIA_Salandril_KAP5_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Salandril_KAP5_EXIT_Condition()
{
if(Kapitel == 5)
{
return TRUE;
};
};
func void DIA_Salandril_KAP5_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Salandril_KAP6_EXIT(C_Info)
{
npc = VLK_422_Salandril;
nr = 999;
condition = DIA_Salandril_KAP6_EXIT_Condition;
information = DIA_Salandril_KAP6_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Salandril_KAP6_EXIT_Condition()
{
if(Kapitel == 6)
{
return TRUE;
};
};
func void DIA_Salandril_KAP6_EXIT_Info()
{
AI_StopProcessInfos(self);
};
|
D
|
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010 by Rainer Schuetze, All Rights Reserved
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt
module sdk.port.base;
version = Win8;
version = sdk;
version(sdk) {} else version = vsi;
version(sdk) {
public import sdk.win32.windef;
public import sdk.win32.winnt;
public import sdk.win32.wtypes;
public import sdk.win32.ntstatus;
public import sdk.win32.winbase;
public import sdk.win32.winuser;
public import sdk.win32.winerror;
public import sdk.win32.wingdi;
public import core.vararg;
} else {
public import std.c.windows.windows;
public import std.c.windows.com;
public import sdk.win32.wtypes;
}
public import sdk.port.pp;
public import sdk.port.bitfields;
/*
union CY
{
struct {
uint Lo;
int Hi;
};
long int64;
}
*/
//alias long LONGLONG;
//alias ulong ULONGLONG;
version(sdk)
{
enum _WIN32_WINNT = 0x600;
alias char CHAR;
// alias short SHORT;
alias int LONG;
alias int HRESULT;
// needed by Windows SDK 8.0
// alias int INT;
// alias uint UINT;
struct GUID { uint Data1; ushort Data2; ushort Data3; ubyte[8] Data4; }
alias GUID *LPGUID;
alias GUID *LPCGUID;
alias GUID *REFGUID;
alias GUID IID;
alias GUID *LPIID;
alias GUID *REFIID;
alias GUID CLSID;
//alias GUID *LPCLSID;
alias GUID *REFCLSID;
alias GUID FMTID;
alias GUID *LPFMTID;
alias GUID *REFFMTID;
}
alias GUID *LPCLSID;
alias void * I_RPC_HANDLE;
alias long hyper;
alias wchar wchar_t;
alias ushort _VARIANT_BOOL;
alias DWORD OLE_COLOR;
alias bool boolean;
alias ulong uint64;
version(sdk) {}
else {
alias double DOUBLE;
// alias ushort _VARIANT_BOOL;
alias int INT_PTR;
alias uint ULONG_PTR;
alias uint DWORD_PTR;
alias int LONG_PTR;
alias ulong ULARGE_INTEGER;
alias long LARGE_INTEGER;
alias ulong ULONG64;
alias long LONG64;
alias ulong DWORD64;
alias ulong UINT64;
alias long INT64;
alias int INT32;
alias uint UINT32;
alias int LONG32;
alias uint ULONG32;
alias uint SIZE_T;
alias uint FMTID;
//alias uint LCID;
//alias uint DISPID;
version(D_Version2) {} else
{
alias uint UINT_PTR;
}
}
version(D_Version2) {} else
{
alias LONG SCODE;
}
enum uint UINT_MAX = uint.max;
alias LONG NTSTATUS;
struct _PROC_THREAD_ATTRIBUTE_LIST;
struct _EXCEPTION_REGISTRATION_RECORD;
struct _TP_CALLBACK_INSTANCE;
struct _TP_POOL;
struct _TP_WORK;
struct _TP_TIMER;
struct _TP_WAIT;
struct _TP_IO;
struct _TP_CLEANUP_GROUP;
struct _ACTIVATION_CONTEXT;
struct _TEB;
alias HANDLE HMETAFILEPICT;
alias LPRECT LPCRECT;
alias LPRECT LPCRECTL;
enum STACK_ALIGN = 4;
int ALIGN_UP_BY(uint sz, uint algn) { return (sz + algn - 1) & ~(algn-1); }
int V_INT_PTR(void* p) { return cast(int) p; }
uint V_UINT_PTR(void* p) { return cast(uint) p; }
// for winnt.d (7.1)
struct _PACKEDEVENTINFO;
struct _EVENTSFORLOGFILE;
// for winuser.d (7.1)
alias HANDLE HPOWERNOTIFY;
// for prsht.d
struct _PSP;
struct _PROPSHEETPAGEA;
struct _PROPSHEETPAGEW;
// for commctrl.d
struct _IMAGELIST {}
struct _TREEITEM;
struct _DSA;
struct _DPA;
interface IImageList {}
// 7.1
enum CCM_TRANSLATEACCELERATOR = (WM_USER+97);
version(sdk) {}
else {
struct _RECTL
{
LONG left;
LONG top;
LONG right;
LONG bottom;
}
alias _RECTL RECTL; alias _RECTL *PRECTL; alias _RECTL *LPRECTL;
struct tagSIZEL
{
LONG cx;
LONG cy;
}
alias tagSIZEL SIZEL; alias tagSIZEL *PSIZEL; alias tagSIZEL *LPSIZEL;
alias tagSIZEL SIZE;
struct _POINTL
{
LONG x;
LONG y;
}
alias _POINTL POINTL; alias _POINTL *PPOINTL;
struct _POINTS
{
SHORT x;
SHORT y;
}
alias _POINTS POINTS; alias _POINTS *PPOINTS;
struct LOGFONTW
{
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
WCHAR[32] lfFaceName;
}
alias LOGFONTW* PLOGFONTW, NPLOGFONTW, LPLOGFONTW;
} // !sdk
//enum OLE_E_LAST = 0x800400FF;
version(vsi)
{
enum WM_USER = 0x400;
// from winerror.h
enum SEVERITY_SUCCESS = 0;
enum SEVERITY_ERROR = 1;
}
HRESULT MAKE_HRESULT(uint sev, uint fac, uint code) { return cast(HRESULT) ((sev<<31) | (fac<<16) | code); }
SCODE MAKE_SCODE(uint sev, uint fac, uint code) { return cast(SCODE) ((sev<<31) | (fac<<16) | code); }
version(none)
{
// from adserr.h
enum FACILITY_WINDOWS = 8;
enum FACILITY_STORAGE = 3;
enum FACILITY_RPC = 1;
enum FACILITY_SSPI = 9;
enum FACILITY_WIN32 = 7;
enum FACILITY_CONTROL = 10;
enum FACILITY_NULL = 0;
enum FACILITY_ITF = 4;
enum FACILITY_DISPATCH = 2;
// from commctrl.h
enum TV_FIRST = 0x1100; // treeview messages
enum TVN_FIRST = (0U-400U); // treeview notifications
}
version(none)
{
extern(Windows) UINT RegisterClipboardFormatW(LPCWSTR lpszFormat);
UINT RegisterClipboardFormatW(wstring format)
{
format ~= "\0"w;
return RegisterClipboardFormatW(cast(LPCWSTR) format.ptr);
}
}
// alias /+[unique]+/ FLAGGED_WORD_BLOB * wireBSTR;
version(Win8) {} else
struct FLAGGED_WORD_BLOB
{
uint fFlags;
uint clSize;
/+[size_is(clSize)]+/ ushort[0] asData;
}
version(vsi)
{
enum prjBuildActionCustom = 3;
}
version(none)
{
enum {
CLR_NONE = 0xFFFFFFFF,
CLR_DEFAULT = 0xFF000000,
}
enum { IMAGE_BITMAP = 0, IMAGE_ICON = 1, IMAGE_CURSOR = 2, IMAGE_ENHMETAFILE = 3 };
enum {
LR_DEFAULTCOLOR = 0x00000000,
LR_MONOCHROME = 0x00000001,
LR_COLOR = 0x00000002,
LR_COPYRETURNORG = 0x00000004,
LR_COPYDELETEORG = 0x00000008,
LR_LOADFROMFILE = 0x00000010,
LR_LOADTRANSPARENT = 0x00000020,
LR_DEFAULTSIZE = 0x00000040,
LR_VGACOLOR = 0x00000080,
LR_LOADMAP3DCOLORS = 0x00001000,
LR_CREATEDIBSECTION = 0x00002000,
LR_COPYFROMRESOURCE = 0x00004000,
LR_SHARED = 0x00008000,
}
}
///////////////////////////////////////////////////////////////////////////////
// incomplete structs
///////////////////////////////////////////////////////////////////////////////
uint strtohex(string s)
{
uint hex = 0;
for(int i = 0; i < s.length; i++)
{
int dig;
if(s[i] >= '0' && s[i] <= '9')
dig = s[i] - '0';
else if(s[i] >= 'a' && s[i] <= 'f')
dig = s[i] - 'a' + 10;
else if(s[i] >= 'A' && s[i] <= 'F')
dig = s[i] - 'A' + 10;
else
assert(false, "invalid hex digit");
hex = (hex << 4) | dig;
}
return hex;
}
GUID uuid(string g)
{
// return GUID(0, 0, 0, [ 0, 0, 0, 0, 0, 0, 0, 0 ]);
if(g.length == 38)
{
assert(g[0] == '{' && g[$-1] == '}', "Incorrect format for GUID.");
g = g[1 .. $-1];
}
assert(g.length == 36);
assert(g[8] == '-' && g[13] == '-' && g[18] == '-' && g[23] == '-', "Incorrect format for GUID.");
uint Data1 = strtohex(g[0..8]);
ushort Data2 = cast(ushort)strtohex(g[9..13]);
ushort Data3 = cast(ushort)strtohex(g[14..18]);
ubyte b0 = cast(ubyte)strtohex(g[19..21]);
ubyte b1 = cast(ubyte)strtohex(g[21..23]);
ubyte b2 = cast(ubyte)strtohex(g[24..26]);
ubyte b3 = cast(ubyte)strtohex(g[26..28]);
ubyte b4 = cast(ubyte)strtohex(g[28..30]);
ubyte b5 = cast(ubyte)strtohex(g[30..32]);
ubyte b6 = cast(ubyte)strtohex(g[32..34]);
ubyte b7 = cast(ubyte)strtohex(g[34..36]);
return GUID(Data1, Data2, Data3, [ b0, b1, b2, b3, b4, b5, b6, b7 ]);
}
const GUID const_GUID_NULL = { 0, 0, 0, [ 0, 0, 0, 0, 0, 0, 0, 0 ] };
const GUID GUID_NULL;
const IID IID_IUnknown = uuid("00000000-0000-0000-C000-000000000046");
///////////////////////////////////////////////////////////////////////////////
// functions declared in headers, but not found in import libraries
///////////////////////////////////////////////////////////////////////////////
/+
InterlockedBitTestAndSet
InterlockedBitTestAndReset
InterlockedBitTestAndComplement
YieldProcessor
ReadPMC
ReadTimeStampCounter
DbgRaiseAssertionFailure
GetFiberData
GetCurrentFiber
NtCurrentTeb
+/
version(Win8) {
///////////////////////////////////////////////////////////////////////////////
// used as intrinsics in Windows SDK 8.0
extern(Windows) LONG InterlockedAdd (LONG /*volatile*/ *Destination, LONG Value);
alias InterlockedAdd _InterlockedAdd;
extern(Windows) LONG InterlockedAnd (LONG /*volatile*/ *Destination, LONG Value);
alias InterlockedAnd _InterlockedAnd;
extern(Windows) LONG InterlockedOr (LONG /*volatile*/ *Destination, LONG Value);
alias InterlockedOr _InterlockedOr;
extern(Windows) LONG InterlockedXor (LONG /*volatile*/ *Destination, LONG Value);
alias InterlockedXor _InterlockedXor;
version(Win64)
{
private import core.atomic;
LONG InterlockedIncrement (/*__inout*/ LONG /*volatile*/ *Addend)
{
return atomicOp!"+="(*cast(shared(LONG)*)Addend, 1);
}
LONG InterlockedDecrement (/*__inout*/ LONG /*volatile*/ *Addend)
{
return atomicOp!"+="(*cast(shared(LONG)*)Addend, -1);
}
LONG InterlockedExchange (/*__inout*/ LONG /*volatile*/ *Target, /*__in*/ LONG Value)
{
LONG old;
do
old = *Target;
while( !cas( cast(shared(LONG)*)Target, old, Value ) );
return old;
}
LONG InterlockedExchangeAdd (/*__inout*/ LONG /*volatile*/ *Target, /*__in*/ LONG Value)
{
LONG old;
do
old = *Target;
while( !cas( cast(shared(LONG)*)Target, old, old + Value ) );
return old;
}
LONG InterlockedCompareExchange (/*__inout*/ LONG /*volatile*/ *Destination, /*__in*/ LONG ExChange, /*__in*/ LONG Comperand)
{
if( cas( cast(shared(LONG)*)Destination, Comperand, ExChange ) )
return Comperand;
return Comperand - 1;
}
}
else
{
extern(Windows) LONG InterlockedIncrement (/*__inout*/ LONG /*volatile*/ *Addend);
extern(Windows) LONG InterlockedDecrement (/*__inout*/ LONG /*volatile*/ *Addend);
extern(Windows) LONG InterlockedExchange (/*__inout*/ LONG /*volatile*/ *Target, /*__in*/ LONG Value);
extern(Windows) LONG InterlockedExchangeAdd (/*__inout*/ LONG /*volatile*/ *Target, /*__in*/ LONG Value);
extern(Windows) LONG InterlockedCompareExchange (/*__inout*/ LONG /*volatile*/ *Destination, /*__in*/ LONG ExChange, /*__in*/ LONG Comperand);
}
extern(Windows)
LONGLONG /*__cdecl*/ InterlockedCompareExchange64 (
/*__inout*/ LONGLONG /*volatile*/ *Destination,
/*__in*/ LONGLONG ExChange,
/*__in*/ LONGLONG Comperand
);
alias void ReadULongPtrAcquire;
alias void ReadULongPtrNoFence;
alias void ReadULongPtrRaw;
alias void WriteULongPtrRelease;
alias void WriteULongPtrNoFence;
alias void WriteULongPtrRaw;
version(GNU) extern(C) DWORD __readfsdword (DWORD Offset) { assert(0); }
else extern(C) DWORD __readfsdword (DWORD Offset) { asm { naked; mov EAX,[ESP+4]; mov EAX, FS:[EAX]; } }
enum TRUE = 1;
public import sdk.win32.winbase;
//enum FALSE = 0;
alias void _CONTRACT_DESCRIPTION;
alias void _BEM_REFERENCE;
struct tagPROPVARIANT;
public import sdk.port.propidl;
}
|
D
|
prototype Mst_Default_Wisp(C_Npc)
{
name[0] = "Огонек";
guild = GIL_MEATBUG;
aivar[AIV_MM_REAL_ID] = ID_WISP;
level = 2;
flags = FALSE;
attribute[ATR_STRENGTH] = 10;
attribute[ATR_DEXTERITY] = 10;
attribute[ATR_HITPOINTS_MAX] = 20;
attribute[ATR_HITPOINTS] = 20;
attribute[ATR_MANA_MAX] = 2;
attribute[ATR_MANA] = 2;
protection[PROT_BLUNT] = IMMUNE;
protection[PROT_EDGE] = IMMUNE;
protection[PROT_POINT] = IMMUNE;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
damagetype = DAM_MAGIC;
fight_tactic = FAI_BLOODFLY;
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_MONSTER_ACTIVE_MAX;
aivar[AIV_MM_ThreatenBeforeAttack] = TRUE;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_SHORT;
aivar[AIV_MM_FollowInWater] = TRUE;
aivar[AIV_MM_Packhunter] = FALSE;
start_aistate = ZS_MM_AllScheduler;
aivar[AIV_MM_WuselStart] = OnlyRoutine;
};
func void B_SetVisuals_Wisp()
{
Mdl_SetVisual(self,"Irrlicht.mds");
Mdl_SetVisualBody(self,"Irrlicht_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
instance Wisp(Mst_Default_Wisp)
{
B_SetVisuals_Wisp();
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
CreateInvItems(self,ItMi_Nugget,1);
};
instance SoulKeeperWisp_01(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance SoulKeeperWisp_02(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance SoulKeeperWisp_03(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance SoulKeeperWisp_04(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance SoulKeeperWisp_05(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance SoulKeeperWisp_06(Mst_Default_Wisp)
{
name[0] = "Плененная душа";
protection[PROT_BLUNT] = 0;
protection[PROT_EDGE] = 0;
protection[PROT_POINT] = 0;
protection[PROT_FIRE] = 0;
protection[PROT_FLY] = 0;
protection[PROT_MAGIC] = 0;
B_SetVisuals_Wisp();
aivar[AIV_EnemyOverride] = TRUE;
Mdl_SetModelScale(self,0.9,0.9,0.9);
Npc_SetToFistMode(self);
};
instance Wisp_Detector(Mst_Default_Wisp)
{
level = 0;
voice = 18;
id = 820;
npcType = npctype_main;
B_SetVisuals_Wisp();
senses_range = 3000;
protection[PROT_BLUNT] = IMMUNE;
protection[PROT_EDGE] = IMMUNE;
protection[PROT_POINT] = IMMUNE;
protection[PROT_FIRE] = IMMUNE;
protection[PROT_FLY] = IMMUNE;
protection[PROT_MAGIC] = IMMUNE;
aivar[AIV_PARTYMEMBER] = TRUE;
B_SetAttitude(self,ATT_FRIENDLY);
Npc_SetToFistMode(self);
aivar[AIV_NoFightParker] = TRUE;
start_aistate = ZS_MM_Rtn_Summoned;
};
|
D
|
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/MimeReader.swift.o : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeType.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPResponse.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/Routing.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/StaticFileHandler.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPFilter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/TypedRoutes.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPRequest.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/MimeReader~partial.swiftmodule : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeType.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPResponse.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/Routing.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/StaticFileHandler.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPFilter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/TypedRoutes.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPRequest.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/MimeReader~partial.swiftdoc : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeType.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPResponse.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/Routing.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/StaticFileHandler.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPFilter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/TypedRoutes.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPRequest.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/MimeReader~partial.swiftsourceinfo : /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeType.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPResponse.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/Routing.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/MimeReader.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/StaticFileHandler.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPFilter.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/TypedRoutes.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPRequest.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/XPC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/os.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftinterface /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/os.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/11.3/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.swiftmodule /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../asn1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../tls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dtls1.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../e_os2.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl23.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509v3.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../md5.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pkcs7.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../sha.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rsa.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../obj_mac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../hmac.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ec.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../rand.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pqueue.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../conf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslconf.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../dh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ecdh.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../lhash.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../stack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../safestack.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../kssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/openssl.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../pem.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bn.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../bio.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../crypto.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../comp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../srtp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../evp.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../ossl_typ.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../buffer.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../err.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../symhacks.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../cms.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../objects.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../opensslv.h /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/../x509_vfy.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/dyld.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCRUD.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectMySQL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCURL.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/StORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/MySQLStORM.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTP.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLib.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectThread.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectCrypto.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectLogger.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectHTTPServer.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/PerfectNet.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/x86_64-apple-macosx/debug/SwiftMoment.build/module.modulemap /Users/mac/Documents/GitHub/PerfectServer/.build/checkouts/Perfect-COpenSSL/COpenSSL/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/*
* Hunt - A refined core library for D programming language.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net/
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.event.selector.Kqueue;
// dfmt off
version(HAVE_KQUEUE):
// dfmt on
import hunt.event.selector.Selector;
import hunt.event.timer.Kqueue;
import hunt.Exceptions;
import hunt.io.channel;
import hunt.logging.ConsoleLogger;
import hunt.util.Common;
import std.exception;
import std.socket;
import std.string;
import core.time;
import core.stdc.string;
import core.stdc.errno;
import core.sys.posix.sys.types; // for ssize_t, size_t
import core.sys.posix.signal;
import core.sys.posix.netinet.tcp;
import core.sys.posix.netinet.in_;
import core.sys.posix.unistd;
import core.sys.posix.time;
/**
*/
class AbstractSelector : Selector {
// kevent array size
enum int NUM_KEVENTS = 128;
private bool isDisposed = false;
private Kevent[NUM_KEVENTS] events;
private int _kqueueFD;
private EventChannel _eventChannel;
this(size_t number, size_t divider, size_t maxChannels = 1500) {
super(number, divider, maxChannels);
_kqueueFD = kqueue();
_eventChannel = new KqueueEventChannel(this);
register(_eventChannel);
}
~this() @nogc {
// dispose();
}
override void dispose() {
if (isDisposed)
return;
version (HUNT_IO_DEBUG)
tracef("disposing selector[fd=%d]...", _kqueueFD);
isDisposed = true;
_eventChannel.close();
int r = core.sys.posix.unistd.close(_kqueueFD);
if(r != 0) {
version(HUNT_DEBUG) warningf("error: %d", r);
}
super.dispose();
}
override void onStop() {
version (HUNT_DEBUG)
infof("Selector stopping. fd=%d", _kqueueFD);
if(!_eventChannel.isClosed()) {
_eventChannel.trigger();
// _eventChannel.onWrite();
}
}
override bool register(AbstractChannel channel) {
assert(channel !is null);
const int fd = channel.handle;
version (HUNT_DEBUG)
tracef("register channel: fd=%d, type=%s", fd, channel.type);
int err = -1;
if (channel.type == ChannelType.Timer) {
Kevent ev;
AbstractTimer timerChannel = cast(AbstractTimer) channel;
if (timerChannel is null)
return false;
size_t time = timerChannel.time < 20 ? 20 : timerChannel.time; // in millisecond
EV_SET(&ev, timerChannel.handle, EVFILT_TIMER,
EV_ADD | EV_ENABLE | EV_CLEAR, 0, time, cast(void*) channel);
err = kevent(_kqueueFD, &ev, 1, null, 0, null);
}
else {
if (fd < 0)
return false;
Kevent[2] ev = void;
short read = EV_ADD | EV_ENABLE;
short write = EV_ADD | EV_ENABLE;
if (channel.hasFlag(ChannelFlag.ETMode)) {
read |= EV_CLEAR;
write |= EV_CLEAR;
}
EV_SET(&(ev[0]), fd, EVFILT_READ, read, 0, 0, cast(void*) channel);
EV_SET(&(ev[1]), fd, EVFILT_WRITE, write, 0, 0, cast(void*) channel);
if (channel.hasFlag(ChannelFlag.Read) && channel.hasFlag(ChannelFlag.Write))
err = kevent(_kqueueFD, &(ev[0]), 2, null, 0, null);
else if (channel.hasFlag(ChannelFlag.Read))
err = kevent(_kqueueFD, &(ev[0]), 1, null, 0, null);
else if (channel.hasFlag(ChannelFlag.Write))
err = kevent(_kqueueFD, &(ev[1]), 1, null, 0, null);
}
if (err < 0) {
return false;
}
return true;
}
override bool deregister(AbstractChannel channel) {
assert(channel !is null);
const fd = channel.handle;
if (fd < 0)
return false;
int err = -1;
if (channel.type == ChannelType.Timer) {
Kevent ev;
AbstractTimer timerChannel = cast(AbstractTimer) channel;
if (timerChannel is null)
return false;
EV_SET(&ev, fd, EVFILT_TIMER, EV_DELETE, 0, 0, cast(void*) channel);
err = kevent(_kqueueFD, &ev, 1, null, 0, null);
}
else {
Kevent[2] ev = void;
EV_SET(&(ev[0]), fd, EVFILT_READ, EV_DELETE, 0, 0, cast(void*) channel);
EV_SET(&(ev[1]), fd, EVFILT_WRITE, EV_DELETE, 0, 0, cast(void*) channel);
if (channel.hasFlag(ChannelFlag.Read) && channel.hasFlag(ChannelFlag.Write))
err = kevent(_kqueueFD, &(ev[0]), 2, null, 0, null);
else if (channel.hasFlag(ChannelFlag.Read))
err = kevent(_kqueueFD, &(ev[0]), 1, null, 0, null);
else if (channel.hasFlag(ChannelFlag.Write))
err = kevent(_kqueueFD, &(ev[1]), 1, null, 0, null);
}
if (err < 0) {
return false;
}
// channel.currtLoop = null;
channel.clear();
return true;
}
protected override int doSelect(long timeout) {
timespec ts;
timespec *tsp;
// timeout is in milliseconds. Convert to struct timespec.
// timeout == -1 : wait forever : timespec timeout of NULL
// timeout == 0 : return immediately : timespec timeout of zero
if (timeout >= 0) {
// For some indeterminate reason kevent(2) has been found to fail with
// an EINVAL error for timeout values greater than or equal to
// 100000001000L. To avoid this problem, clamp the timeout arbitrarily
// to the maximum value of a 32-bit signed integer which is
// approximately 25 days in milliseconds.
const int timeoutMax = int.max;
if (timeout > timeoutMax) {
timeout = timeoutMax;
}
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000) * 1000000; //nanosec = 1 million millisec
tsp = &ts;
} else {
tsp = null;
}
// auto tspec = timespec(1, 1000 * 10);
int result = kevent(_kqueueFD, null, 0, events.ptr, events.length, tsp);
foreach (i; 0 .. result) {
AbstractChannel channel = cast(AbstractChannel)(events[i].udata);
ushort eventFlags = events[i].flags;
version (HUNT_DEBUG)
infof("handling event: events=%d, fd=%d", eventFlags, channel.handle);
if (eventFlags & EV_ERROR) {
warningf("channel[fd=%d] has a error.", channel.handle);
channel.close();
continue;
}
if (eventFlags & EV_EOF) {
version (HUNT_DEBUG) infof("channel[fd=%d] closed", channel.handle);
channel.close();
continue;
}
short filter = events[i].filter;
handeChannelEvent(channel, filter);
}
return result;
}
private void handeChannelEvent(AbstractChannel channel, uint filter) {
version (HUNT_DEBUG)
infof("handling event: events=%d, fd=%d", filter, channel.handle);
try {
if(filter == EVFILT_TIMER) {
channel.onRead();
} else if (filter == EVFILT_WRITE) {
channel.onWrite();
} else if (filter == EVFILT_READ) {
channel.onRead();
} else {
warningf("Unhandled channel fileter: %d", filter);
}
} catch(Exception e) {
errorf("error while handing channel: fd=%s, message=%s",
channel.handle, e.msg);
}
}
}
enum : short {
EVFILT_READ = -1,
EVFILT_WRITE = -2,
EVFILT_AIO = -3, /* attached to aio requests */
EVFILT_VNODE = -4, /* attached to vnodes */
EVFILT_PROC = -5, /* attached to struct proc */
EVFILT_SIGNAL = -6, /* attached to struct proc */
EVFILT_TIMER = -7, /* timers */
EVFILT_MACHPORT = -8, /* Mach portsets */
EVFILT_FS = -9, /* filesystem events */
EVFILT_USER = -10, /* User events */
EVFILT_VM = -12, /* virtual memory events */
EVFILT_SYSCOUNT = 11
}
extern (D) void EV_SET(Kevent* kevp, typeof(Kevent.tupleof) args) @nogc nothrow {
*kevp = Kevent(args);
}
struct Kevent {
uintptr_t ident; /* identifier for this event */
short filter; /* filter for event */
ushort flags;
uint fflags;
intptr_t data;
void* udata; /* opaque user data identifier */
}
enum {
/* actions */
EV_ADD = 0x0001, /* add event to kq (implies enable) */
EV_DELETE = 0x0002, /* delete event from kq */
EV_ENABLE = 0x0004, /* enable event */
EV_DISABLE = 0x0008, /* disable event (not reported) */
/* flags */
EV_ONESHOT = 0x0010, /* only report one occurrence */
EV_CLEAR = 0x0020, /* clear event state after reporting */
EV_RECEIPT = 0x0040, /* force EV_ERROR on success, data=0 */
EV_DISPATCH = 0x0080, /* disable event after reporting */
EV_SYSFLAGS = 0xF000, /* reserved by system */
EV_FLAG1 = 0x2000, /* filter-specific flag */
/* returned values */
EV_EOF = 0x8000, /* EOF detected */
EV_ERROR = 0x4000, /* error, data contains errno */
}
enum {
/*
* data/hint flags/masks for EVFILT_USER, shared with userspace
*
* On input, the top two bits of fflags specifies how the lower twenty four
* bits should be applied to the stored value of fflags.
*
* On output, the top two bits will always be set to NOTE_FFNOP and the
* remaining twenty four bits will contain the stored fflags value.
*/
NOTE_FFNOP = 0x00000000, /* ignore input fflags */
NOTE_FFAND = 0x40000000, /* AND fflags */
NOTE_FFOR = 0x80000000, /* OR fflags */
NOTE_FFCOPY = 0xc0000000, /* copy fflags */
NOTE_FFCTRLMASK = 0xc0000000, /* masks for operations */
NOTE_FFLAGSMASK = 0x00ffffff,
NOTE_TRIGGER = 0x01000000, /* Cause the event to be
triggered for output. */
/*
* data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
*/
NOTE_LOWAT = 0x0001, /* low water mark */
/*
* data/hint flags for EVFILT_VNODE, shared with userspace
*/
NOTE_DELETE = 0x0001, /* vnode was removed */
NOTE_WRITE = 0x0002, /* data contents changed */
NOTE_EXTEND = 0x0004, /* size increased */
NOTE_ATTRIB = 0x0008, /* attributes changed */
NOTE_LINK = 0x0010, /* link count changed */
NOTE_RENAME = 0x0020, /* vnode was renamed */
NOTE_REVOKE = 0x0040, /* vnode access was revoked */
/*
* data/hint flags for EVFILT_PROC, shared with userspace
*/
NOTE_EXIT = 0x80000000, /* process exited */
NOTE_FORK = 0x40000000, /* process forked */
NOTE_EXEC = 0x20000000, /* process exec'd */
NOTE_PCTRLMASK = 0xf0000000, /* mask for hint bits */
NOTE_PDATAMASK = 0x000fffff, /* mask for pid */
/* additional flags for EVFILT_PROC */
NOTE_TRACK = 0x00000001, /* follow across forks */
NOTE_TRACKERR = 0x00000002, /* could not track child */
NOTE_CHILD = 0x00000004, /* am a child process */
}
extern (C) {
int kqueue() @nogc nothrow;
int kevent(int kq, const Kevent* changelist, int nchanges,
Kevent* eventlist, int nevents, const timespec* timeout) @nogc nothrow;
}
static if (CompilerHelper.isLessThan(2078)) {
enum SO_REUSEPORT = 0x0200;
}
|
D
|
/Users/vstavenko/projects/koordinata/frontend/target/debug/build/num-rational-2b0bffe98737bac2/build_script_build-2b0bffe98737bac2: /Users/vstavenko/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.2.4/build.rs
/Users/vstavenko/projects/koordinata/frontend/target/debug/build/num-rational-2b0bffe98737bac2/build_script_build-2b0bffe98737bac2.d: /Users/vstavenko/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.2.4/build.rs
/Users/vstavenko/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.2.4/build.rs:
|
D
|
import std.math;
import std.stdio;
import std.utf;
import std.string;
import std.conv: to;
import std.algorithm;
class Buffer {
private string value = null;
private Buffer left;
private Buffer right;
string name = "";
string savedText;
ulong length;
int splitLength = 1000;
int joinLength = 500;
double rebalanceRatio = 1.2;
this() { }
this(string str, string name="") {
this.value = str;
this.length = str.length;
this.name = name;
this.savedText = str;
left = new Buffer();
right = new Buffer();
left.value = "";
right.value = "";
adjust();
}
void save(string filename=null) {
if (filename is null) {
filename = name;
}
if (filename != "") {
string bufSrc = this.toString();
File f = File(filename, "w");
f.write(bufSrc);
f.close();
savedText = bufSrc;
}
}
@property string[] lines() {
string str = this.toString();
if (str == "") {
return [""];
} else {
return str.split("\n");
}
}
void adjust() {
if (value !is null) {
if (length > splitLength) {
auto divide = cast(int) floor(length / 2.0);
left = new Buffer(value[0 .. divide]);
right = new Buffer(value[divide .. $]);
}
} else {
if (length > joinLength) {
value = left.toString() ~ right.toString();
}
}
}
override string toString() {
if (value !is null) {
return value;
} else {
return left.toString() ~ right.toString();
}
}
void remove(ulong start, ulong end) {
if (value !is null) {
value = value[0 .. start] ~ value[end .. $];
length = value.length;
} else {
auto leftStart = min(start, left.length);
auto leftEnd = min(end, left.length);
auto rightStart = max(0, min(start - left.length, right.length));
auto rightEnd = max(0, min(end - left.length, right.length));
if (leftStart < left.length) {
left.remove(leftStart, leftEnd);
}
if (rightEnd > 0) {
right.remove(rightStart, rightEnd);
}
length = left.length + right.length;
}
adjust();
}
void insert(ulong position, string value) {
if (this.value !is null) {
this.value = this.value[0 .. position] ~ value ~ this.value[position .. $];
length = this.value.length;
} else {
if (position < left.length) {
left.insert(position, value);
length = left.length + right.length;
} else {
right.insert(position - left.length, value);
}
}
adjust();
}
void rebuild() {
if (value is null) {
value = left.toString() ~ right.toString();
adjust();
}
}
void rebalance() {
if (value is null) {
if (left.length / right.length > rebalanceRatio || right.length / left.length > rebalanceRatio) {
rebuild();
} else {
left.rebalance();
right.rebalance();
}
}
}
string substring(ulong start, ulong end=length) {
if (value !is null) {
return value[start .. end];
} else {
auto leftStart = min(start, left.length);
auto leftEnd = min(end, left.length);
auto rightStart = max(0, min(start - left.length, right.length));
auto rightEnd = max(0, min(end - left.length, right.length));
if (leftStart != leftEnd) {
if (rightStart != rightEnd) {
return left.substring(leftStart, leftEnd) ~ right.substring(rightStart, rightEnd);
} else {
return left.substring(leftStart, leftEnd);
}
} else {
if (rightStart != rightEnd) {
return right.substring(rightStart, rightEnd);
} else {
return "";
}
}
}
}
char charAt(ulong pos) {
return to ! char(substring(pos, pos + 1));
}
}
|
D
|
instance DIA_Addon_Matt_EXIT(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 999;
condition = DIA_Addon_Matt_EXIT_Condition;
information = DIA_Addon_Matt_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Matt_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Matt_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Addon_Matt_PICKPOCKET(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 900;
condition = DIA_Addon_Matt_PICKPOCKET_Condition;
information = DIA_Addon_Matt_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_60;
};
func int DIA_Addon_Matt_PICKPOCKET_Condition()
{
return C_Beklauen(55,91);
};
func void DIA_Addon_Matt_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Addon_Matt_PICKPOCKET);
Info_AddChoice(DIA_Addon_Matt_PICKPOCKET,Dialog_Back,DIA_Addon_Matt_PICKPOCKET_BACK);
Info_AddChoice(DIA_Addon_Matt_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Addon_Matt_PICKPOCKET_DoIt);
};
func void DIA_Addon_Matt_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Addon_Matt_PICKPOCKET);
};
func void DIA_Addon_Matt_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Addon_Matt_PICKPOCKET);
};
instance DIA_Addon_Matt_Hello(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 1;
condition = DIA_Addon_Matt_Hello_Condition;
information = DIA_Addon_Matt_Hello_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Matt_Hello_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_TalkedToPlayer] == FALSE))
{
return TRUE;
};
};
func void DIA_Addon_Matt_Hello_Info()
{
AI_Output(self,other,"DIA_Addon_Matt_Hello_10_01"); //New here, are you? Great. We can use every man.
};
instance DIA_Addon_Matt_PERM(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 2;
condition = DIA_Addon_Matt_PERM_Condition;
information = DIA_Addon_Matt_PERM_Info;
permanent = TRUE;
description = "How are things?";
};
func int DIA_Addon_Matt_PERM_Condition()
{
return TRUE;
};
func void DIA_Addon_Matt_PERM_Info()
{
AI_Output(other,self,"DIA_Addon_Matt_Alright_15_01"); //How are things?
if(self.aivar[AIV_PARTYMEMBER] == TRUE)
{
if(self.attribute[ATR_HITPOINTS] < 100)
{
AI_Output(self,other,"DIA_Addon_Matt_Alright_10_02"); //What part of HEALING POTION didn't you understand?
}
else
{
AI_Output(self,other,"DIA_Addon_Matt_Alright_10_01"); //Everything's ship-shape - (cynically) Cap'n!
};
}
else if((GregIsBack == TRUE) && !Npc_IsDead(Greg))
{
AI_Output(self,other,"DIA_Addon_Matt_Job_10_01"); //Very funny. We no longer have a ship.
AI_Output(self,other,"DIA_Addon_Matt_Job_10_02"); //I'll just wait and see what Greg does next.
}
else
{
AI_Output(self,other,"DIA_Addon_Matt_Job_10_03"); //Right now, all's quiet in the camp. So I'm going to relax a little.
AI_Output(self,other,"DIA_Addon_Matt_Job_10_04"); //And if I were you, I'd do the same.
AI_Output(self,other,"DIA_Addon_Matt_Job_10_05"); //Since the bandits are here now, the situation may change faster than we like.
};
};
instance DIA_Addon_Matt_Bandits(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 3;
condition = DIA_Addon_Matt_Bandits_Condition;
information = DIA_Addon_Matt_Bandits_Info;
description = "What do you know about the bandits?";
};
func int DIA_Addon_Matt_Bandits_Condition()
{
return TRUE;
};
func void DIA_Addon_Matt_Bandits_Info()
{
AI_Output(other,self,"DIA_Addon_Matt_Bandits_15_03"); //What do you know about the bandits?
AI_Output(self,other,"DIA_Addon_Matt_Bandits_10_01"); //You mean, besides the fact that they're a deadly menace and outnumber us by far?
AI_Output(other,self,"DIA_Addon_Matt_Bandits_15_02"); //Yes.
AI_Output(self,other,"DIA_Addon_Matt_Bandits_10_02"); //They're rolling in gold.
AI_Output(self,other,"DIA_Addon_Matt_Bandits_10_03"); //Well, at least they WERE rolling in gold. They never paid for their last shipment.
AI_Output(self,other,"DIA_Addon_Matt_Bandits_10_04"); //But I doubt that that's because those bastards ran out of gold.
AI_Output(self,other,"DIA_Addon_Matt_Bandits_10_05"); //It's more likely that they've gotten way too big for their boots.
};
instance DIA_Addon_Matt_Francis(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 4;
condition = DIA_Addon_Matt_Francis_Condition;
information = DIA_Addon_Matt_Francis_Info;
description = "What do you know about Francis?";
};
func int DIA_Addon_Matt_Francis_Condition()
{
if(Francis_ausgeschissen == FALSE)
{
if(Npc_KnowsInfo(other,DIA_Addon_Skip_GregsHut) || (Francis.aivar[AIV_TalkedToPlayer] == TRUE))
{
return TRUE;
};
};
};
func void DIA_Addon_Matt_Francis_Info()
{
AI_Output(other,self,"DIA_Addon_Brandon_Matt_15_00"); //What do you know about Francis?
AI_Output(self,other,"DIA_Addon_Matt_Francis_10_01"); //You mean, besides the fact that he's lazy and incompetent?
AI_Output(other,self,"DIA_Addon_Brandon_Matt_15_02"); //Yes.
AI_Output(self,other,"DIA_Addon_Matt_Francis_10_03"); //Let me think. Hmm ... no. That's all that springs to mind.
};
instance DIA_Addon_Matt_Anheuern(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 11;
condition = DIA_Addon_Matt_Anheuern_Condition;
information = DIA_Addon_Matt_Anheuern_Info;
permanent = FALSE;
description = "Come with me.";
};
func int DIA_Addon_Matt_Anheuern_Condition()
{
if(MIS_Addon_Greg_ClearCanyon == LOG_Running)
{
return TRUE;
};
};
func void DIA_Addon_Matt_Anheuern_Info()
{
AI_Output(other,self,"DIA_Addon_Matt_FollowMe_15_00"); //Come with me.
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_10_01"); //I can't leave now, I'm just trying to relax.
AI_Output(other,self,"DIA_Addon_Matt_FollowMe_15_02"); //Orders from Greg.
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_10_03"); //(hastily) Ah, I see. That's different of course. I mean, of course I'm coming.
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_10_04"); //Where are we going?
Info_ClearChoices(DIA_Addon_Matt_Anheuern);
Info_AddChoice(DIA_Addon_Matt_Anheuern,"Just shut up and come along.",DIA_Addon_Matt_Anheuern_ShutUp);
Info_AddChoice(DIA_Addon_Matt_Anheuern,"We're supposed to clear the canyon.",DIA_Addon_Matt_Anheuern_ClearCanyon);
};
func void DIA_Addon_Matt_Anheuern_ShutUp()
{
AI_Output(other,self,"DIA_Addon_Matt_FollowMe_ShutUp_15_00"); //Just shut up and come along.
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_ShutUp_10_01"); //(surly) Aye aye - (sarcastically) Cap'n!
Info_ClearChoices(DIA_Addon_Matt_Anheuern);
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"FOLLOW");
self.aivar[AIV_PARTYMEMBER] = TRUE;
};
func void DIA_Addon_Matt_Anheuern_ClearCanyon()
{
AI_Output(other,self,"DIA_Addon_Matt_FollowMe_ClearCanyon_15_00"); //We're supposed to clear the canyon.
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_ClearCanyon_10_01"); //You're out of your mind. It's teeming with beasts. And those razors are not to be trifled with.
AI_Output(other,self,"DIA_Addon_Matt_FollowMe_ClearCanyon_15_02"); //I know. Are you coming now?
AI_Output(self,other,"DIA_Addon_Matt_FollowMe_ClearCanyon_10_03"); //(sighs) You'd better pack a few healing potions, we're going to need them.
Info_ClearChoices(DIA_Addon_Matt_Anheuern);
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"FOLLOW");
self.aivar[AIV_PARTYMEMBER] = TRUE;
};
instance DIA_Addon_Matt_ComeOn(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 12;
condition = DIA_Addon_Matt_ComeOn_Condition;
information = DIA_Addon_Matt_ComeOn_Info;
permanent = TRUE;
description = "Come with me.";
};
func int DIA_Addon_Matt_ComeOn_Condition()
{
if((self.aivar[AIV_PARTYMEMBER] == FALSE) && (MIS_Addon_Greg_ClearCanyon == LOG_Running) && Npc_KnowsInfo(other,DIA_Addon_Matt_Anheuern))
{
return TRUE;
};
};
func void DIA_Addon_Matt_ComeOn_Info()
{
AI_Output(other,self,"DIA_Addon_Matt_ComeOn_15_00"); //Come with me.
if(C_GregsPiratesTooFar() == TRUE)
{
B_Say(self,other,"$RUNAWAY");
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"DIA_Addon_Matt_ComeOn_10_01"); //Aye aye - (cynically) Cap'n!
AI_StopProcessInfos(self);
B_Addon_PiratesFollowAgain();
Npc_ExchangeRoutine(self,"FOLLOW");
self.aivar[AIV_PARTYMEMBER] = TRUE;
};
};
instance DIA_Addon_Matt_GoHome(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 13;
condition = DIA_Addon_Matt_GoHome_Condition;
information = DIA_Addon_Matt_GoHome_Info;
permanent = TRUE;
description = "I no longer need you.";
};
func int DIA_Addon_Matt_GoHome_Condition()
{
if(self.aivar[AIV_PARTYMEMBER] == TRUE)
{
return TRUE;
};
};
func void DIA_Addon_Matt_GoHome_Info()
{
AI_Output(other,self,"DIA_Addon_Matt_DontNeedYou_15_00"); //I no longer need you.
AI_Output(self,other,"DIA_Addon_Matt_GoHome_10_01"); //(moaning to himself) I need a decent swig of grog!
AI_StopProcessInfos(self);
self.aivar[AIV_PARTYMEMBER] = FALSE;
Npc_ExchangeRoutine(self,"START");
};
instance DIA_Addon_Matt_TooFar(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 14;
condition = DIA_Addon_Matt_TooFar_Condition;
information = DIA_Addon_Matt_TooFar_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Addon_Matt_TooFar_Condition()
{
if((self.aivar[AIV_PARTYMEMBER] == TRUE) && (C_GregsPiratesTooFar() == TRUE))
{
return TRUE;
};
};
func void DIA_Addon_Matt_TooFar_Info()
{
AI_Output(self,other,"DIA_Addon_Matt_TooFar_10_01"); //You can go it alone from here - (cynically) Cap'n.
if(C_HowManyPiratesInParty() >= 2)
{
AI_Output(self,other,"DIA_Addon_Matt_TooFar_10_03"); //The boys and I are headed back for camp!
}
else
{
AI_Output(self,other,"DIA_Addon_Matt_TooFar_10_02"); //I'm headed back to the camp!
};
B_Addon_PiratesGoHome();
AI_StopProcessInfos(self);
};
instance DIA_Addon_Matt_Healing(C_Info)
{
npc = PIR_1365_Addon_Matt;
nr = 15;
condition = DIA_Addon_Matt_Healing_Condition;
information = DIA_Addon_Matt_Healing_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Matt_Healing_Condition()
{
if((self.aivar[AIV_PARTYMEMBER] == TRUE) && (self.attribute[ATR_HITPOINTS] < (self.attribute[ATR_HITPOINTS_MAX] - 100)))
{
return TRUE;
};
};
func void DIA_Addon_Matt_Healing_Info()
{
AI_Output(self,other,"DIA_Addon_Matt_Healing_10_01"); //(cynically) Hello Cap'n! I could use a healing potion!
};
|
D
|
// Written in the D programming language.
/**
* This module is used to parse file names. All the operations work
* only on strings; they don't perform any input/output
* operations. This means that if a path contains a directory name
* with a dot, functions like $(D getExt()) will work with it just as
* if it was a file. To differentiate these cases, use the std.file
* module first (i.e. $(D std.file.isDir())).
*
* Macros:
* WIKI = Phobos/StdPath
*
* Copyright: Copyright Digital Mars 2000-.
* License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(WEB digitalmars.com, Walter Bright),
* Grzegorz Adam Hankiewicz, Thomas Kühne, Bill Baxter,
* $(WEB erdani.org, Andrei Alexandrescu)
* Source: $(PHOBOSSRC std/_path.d)
*/
module std.path;
//debug=path; // uncomment to turn on debugging printf's
//private import std.stdio;
import std.algorithm, std.array, std.conv, std.file, std.process, std.string,
std.traits;
import core.stdc.errno, core.stdc.stdlib;
version(Posix)
{
private import core.sys.posix.pwd;
private import core.exception : onOutOfMemoryError;
}
version(Windows)
{
/** String used to separate directory names in a path. Under
* Windows this is a backslash, under Linux a slash. */
enum string sep = "\\";
/** Alternate version of sep[] used in Windows (a slash). Under
* Linux this is empty. */
enum string altsep = "/";
/** Path separator string. A semi colon under Windows, a colon
* under Linux. */
enum string pathsep = ";";
/** String used to separate lines, \r\n under Windows and \n
* under Linux. */
enum string linesep = "\r\n"; /// String used to separate lines.
enum string curdir = "."; /// String representing the current directory.
enum string pardir = ".."; /// String representing the parent directory.
}
version(Posix)
{
/** String used to separate directory names in a path. Under
* Windows this is a backslash, under Linux a slash. */
enum string sep = "/";
/** Alternate version of sep[] used in Windows (a slash). Under
* Linux this is empty. */
enum string altsep = "";
/** Path separator string. A semi colon under Windows, a colon
* under Linux. */
enum string pathsep = ":";
/** String used to separate lines, \r\n under Windows and \n
* under Linux. */
enum string linesep = "\n";
enum string curdir = "."; /// String representing the current directory.
enum string pardir = ".."; /// String representing the parent directory.
}
/*****************************
* Compare file names.
* Returns:
* <table border=1 cellpadding=4 cellspacing=0>
* <tr> <td> < 0 <td> filename1 < filename2
* <tr> <td> = 0 <td> filename1 == filename2
* <tr> <td> > 0 <td> filename1 > filename2
* </table>
*/
version (Windows) alias std.string.icmp fcmp;
version (Posix) alias std.algorithm.cmp fcmp;
/**************************
* Extracts the extension from a filename or path.
*
* This function will search fullname from the end until the
* first dot, path separator or first character of fullname is
* reached. Under Windows, the drive letter separator (<i>colon</i>)
* also terminates the search.
*
* Returns: If a dot was found, characters to its right are
* returned. If a path separator was found, or fullname didn't
* contain any dots or path separators, returns null.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* getExt(r"d:\path\foo.bat") // "bat"
* getExt(r"d:\path.two\bar") // null
* }
* version(Posix)
* {
* getExt(r"/home/user.name/bar.") // ""
* getExt(r"d:\\path.two\\bar") // "two\\bar"
* getExt(r"/home/user/.resource") // "resource"
* }
* -----
*/
string getExt(string fullname)
{
auto i = fullname.length;
while (i > 0)
{
if (fullname[i - 1] == '.')
return fullname[i .. fullname.length];
i--;
version(Windows)
{
if (fullname[i] == ':' || fullname[i] == '\\')
break;
}
else version(Posix)
{
if (fullname[i] == '/')
break;
}
else
{
static assert(0);
}
}
return null;
}
unittest
{
debug(path) printf("path.getExt.unittest\n");
string result;
version (Windows)
result = getExt("d:\\path\\foo.bat");
version (Posix)
result = getExt("/path/foo.bat");
auto i = cmp(result, "bat");
assert(i == 0);
version (Windows)
result = getExt("d:\\path\\foo.");
version (Posix)
result = getExt("d/path/foo.");
i = cmp(result, "");
assert(i == 0);
version (Windows)
result = getExt("d:\\path\\foo");
version (Posix)
result = getExt("d/path/foo");
i = cmp(result, "");
assert(i == 0);
version (Windows)
result = getExt("d:\\path.bar\\foo");
version (Posix)
result = getExt("/path.bar/foo");
i = cmp(result, "");
assert(i == 0);
result = getExt("foo");
i = cmp(result, "");
assert(i == 0);
}
/**************************
* Returns the extensionless version of a filename or path.
*
* This function will search fullname from the end until the
* first dot, path separator or first character of fullname is
* reached. Under Windows, the drive letter separator (<i>colon</i>)
* also terminates the search.
*
* Returns: If a dot was found, characters to its left are
* returned. If a path separator was found, or fullname didn't
* contain any dots or path separators, returns null.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* getName(r"d:\path\foo.bat") => "d:\path\foo"
* getName(r"d:\path.two\bar") => null
* }
* version(Posix)
* {
* getName("/home/user.name/bar.") => "/home/user.name/bar"
* getName(r"d:\path.two\bar") => "d:\path"
* getName("/home/user/.resource") => "/home/user/"
* }
* -----
*/
string getName(string fullname)
{
auto i = fullname.length;
while (i > 0)
{
if (fullname[i - 1] == '.')
return fullname[0 .. i - 1];
i--;
version(Windows)
{
if (fullname[i] == ':' || fullname[i] == '\\')
break;
}
else version(Posix)
{
if (fullname[i] == '/')
break;
}
else
{
static assert(0);
}
}
return null;
}
unittest
{
debug(path) printf("path.getName.unittest\n");
string result;
result = getName("foo.bar");
auto i = cmp(result, "foo");
assert(i == 0);
result = getName("d:\\path.two\\bar");
version (Windows)
i = cmp(result, "");
version (Posix)
i = cmp(result, "d:\\path");
assert(i == 0);
}
/**************************
* Extracts the base name of a path and optionally chops off a
* specific suffix.
*
* This function will search $(D_PARAM fullname) from the end until
* the first path separator or first character of $(D_PARAM fullname)
* is reached. Under Windows, the drive letter separator ($(I colon))
* also terminates the search. After the search has ended, keep the
* portion to the right of the separator if found, or the entire
* $(D_PARAM fullname) otherwise. If the kept portion has suffix
* $(D_PARAM extension), remove that suffix. Return the remaining string.
*
* Returns: The portion of $(D_PARAM fullname) left after the path
* part and the extension part, if any, have been removed.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* basename(r"d:\path\foo.bat") => "foo.bat"
* basename(r"d:\path\foo", ".bat") => "foo"
* }
* version(Posix)
* {
* basename("/home/user.name/bar.") => "bar."
* basename("/home/user.name/bar.", ".") => "bar"
* }
* -----
*/
Char[] basename(Char, ExtChar = immutable(char))(
Char[] fullname, ExtChar[] extension = null)
if (isSomeChar!Char && isSomeChar!ExtChar)
out (result)
{
assert(result.length <= fullname.length);
}
body
{
auto i = fullname.length;
for (; i > 0; i--)
{
version(Windows)
{
if (fullname[i - 1] == ':' || fullname[i - 1] == '\\' || fullname[i - 1] == '/')
break;
}
else version(Posix)
{
if (fullname[i - 1] == '/')
break;
}
else
{
static assert(0);
}
}
return chomp(fullname[i .. fullname.length],
extension.length ? extension : "");
}
/** Alias for $(D_PARAM basename), kept for backward
* compatibility. New code should use $(D_PARAM basename). */
alias basename getBaseName;
unittest
{
debug(path) printf("path.basename.unittest\n");
string result;
version (Windows)
result = basename("d:\\path\\foo.bat");
version (Posix)
result = basename("/path/foo.bat");
//printf("result = '%.*s'\n", result);
assert(result == "foo.bat");
version (Windows)
result = basename("a\\b");
version (Posix)
result = basename("a/b");
assert(result == "b");
version (Windows)
result = basename("a\\b.cde", ".cde");
version (Posix)
result = basename("a/b.cde", ".cde");
assert(result == "b");
version (Windows)
{
assert(basename("abc/xyz") == "xyz");
assert(basename("abc/") == "");
assert(basename("C:/a/b") == "b");
assert(basename(`C:\a/b`) == "b");
}
assert(basename("~/dmd.conf"w, ".conf"d) == "dmd");
assert(basename("~/dmd.conf"d, ".conf"d) == "dmd");
assert(basename("dmd.conf"w.dup, ".conf"d.dup) == "dmd");
}
/**************************
* Extracts the directory part of a path.
*
* This function will search $(D fullname) from the end until the
* first path separator or first character of $(D fullname) is
* reached. Under Windows, the drive letter separator ($(I colon))
* also terminates the search.
*
* Returns: If a path separator was found, all the characters to its
* left without any trailing path separators are returned. Otherwise,
* $(D ".") is returned.
*
* The found path separator will be included in the returned string
* if and only if it represents the root.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* assert(dirname(r"d:\path\foo.bat") == r"d:\path");
* assert(dirname(r"d:\path") == r"d:\");
* assert(dirname("d:foo.bat") == "d:.");
* assert(dirname("foo.bat") == ".");
* }
* version(Posix)
* {
* assert(dirname("/home/user") == "/home");
* assert(dirname("/home") == "/");
* assert(dirname("user") == ".");
* }
* -----
*/
Char[] dirname(Char)(Char[] fullname)
if (isSomeChar!Char)
{
alias immutable(Char)[] ImmString;
Char[] s = fullname;
version (Posix)
{
enum ImmString sep = .sep;
enum ImmString curdir = .curdir;
for (; !s.empty; s.popBack)
{
if (s.endsWith(sep))
break;
}
if (s.empty)
{
return to!(Char[])(curdir);
}
// remove excess non-root slashes: "/home//" --> "/home"
while (s.length > sep.length && s.endsWith(sep))
{
s.popBack;
}
return s;
}
else version (Windows)
{
enum ImmString sep = .sep;
enum ImmString altsep = .altsep;
enum ImmString curdir = .curdir;
enum ImmString drvsep = ":";
bool foundSep;
for (; !s.empty; s.popBack)
{
if (uint withWhat = s.endsWith(sep, altsep, drvsep))
{
foundSep = (withWhat != 3);
break;
}
}
if (!foundSep)
{
return to!(Char[])(s.empty ? curdir : s ~ curdir);
}
// remove excess non-root separators: "C:\\" --> "C:\"
while (s.endsWith(sep) || s.endsWith(altsep))
{
auto ss = s.save;
s.popBack;
if (s.empty || s.endsWith(drvsep))
{
s = ss; // preserve path separator representing root
break;
}
}
return s;
}
else // unknown platform
{
static assert(0);
}
}
unittest
{
assert(dirname("") == ".");
assert(dirname("fileonly") == ".");
version (Posix)
{
assert(dirname("/path/to/file") == "/path/to");
assert(dirname("/home") == "/");
assert(dirname("/dev/zero"w) == "/dev");
assert(dirname("/dev/null"d) == "/dev");
assert(dirname(".login"w.dup) == ".");
assert(dirname(".login"d.dup) == ".");
// doc example
assert(dirname("/home/user") == "/home");
assert(dirname("/home") == "/");
assert(dirname("user") == ".");
}
version (Windows)
{
assert(dirname(r"\path\to\file") == r"\path\to");
assert(dirname(r"\foo") == r"\");
assert(dirname(r"c:\foo") == r"c:\");
assert(dirname("\\Windows"w) == "\\");
assert(dirname("\\Users"d) == "\\");
assert(dirname("ntuser.dat"w.dup) == ".");
assert(dirname("ntuser.dat"d.dup) == ".");
// doc example
assert(dirname(r"d:\path\foo.bat") == r"d:\path");
assert(dirname(r"d:\path") == "d:\\");
assert(dirname("d:foo.bat") == "d:.");
assert(dirname("foo.bat") == ".");
}
{
// fixed-length strings
char[4] u = "abcd";
wchar[4] w = "abcd";
dchar[4] d = "abcd";
assert(dirname(u) == ".");
assert(dirname(w) == "."w);
assert(dirname(d) == "."d);
}
}
/** Alias for $(D_PARAM dirname), kept for backward
* compatibility. New code should use $(D_PARAM dirname). */
alias dirname getDirName;
unittest
{
string filename = "foo/bar";
auto d = getDirName(filename);
assert(d == "foo");
}
unittest // dirname + basename
{
static immutable Common_dirbasename_testcases =
[
[ "/usr/lib" , "/usr" , "lib" ],
[ "/usr/" , "/usr" , "" ],
[ "/usr" , "/" , "usr" ],
[ "/" , "/" , "" ],
[ "var/run" , "var" , "run" ],
[ "var/" , "var" , "" ],
[ "var" , "." , "var" ],
[ "." , "." , "." ],
[ "/usr///lib", "/usr" , "lib" ],
[ "///usr///" , "///usr" , "" ],
[ "///usr" , "/" , "usr" ],
[ "///" , "/" , "" ],
[ "var///run" , "var" , "run" ],
[ "var///" , "var" , "" ],
[ "a/b/c" , "a/b" , "c" ],
[ "a///c" , "a" , "c" ],
[ "/\u7A74" , "/" , "\u7A74" ],
[ "/\u7A74/." , "/\u7A74", "." ]
];
static immutable Windows_dirbasename_testcases =
Common_dirbasename_testcases ~
[
[ "C:\\Users\\7mi", "C:\\Users", "7mi" ],
[ "C:\\Users\\" , "C:\\Users", "" ],
[ "C:\\Users" , "C:\\" , "Users" ],
[ "C:\\" , "C:\\" , "" ],
[ "C:Temp" , "C:." , "Temp" ],
[ "C:" , "C:." , "" ],
[ "\\dmd\\src" , "\\dmd" , "src" ],
[ "\\dmd\\" , "\\dmd" , "" ],
[ "\\dmd" , "\\" , "dmd" ],
[ "C:/Users/7mi" , "C:/Users" , "7mi" ],
[ "C:/Users/" , "C:/Users" , "" ],
[ "C:/Users" , "C:/" , "Users" ],
[ "C:/" , "C:/" , "" ],
[ "C:\\//WinNT" , "C:\\" , "WinNT" ],
[ "C://\\WinNT" , "C:/" , "WinNT" ],
[ `a\b\c` , `a\b` , "c" ],
[ `a\\\c` , "a" , "c" ]
];
version (Windows)
alias Windows_dirbasename_testcases testcases;
else
alias Common_dirbasename_testcases testcases;
foreach (tc; testcases)
{
string path = tc[0];
string dir = tc[1];
string base = tc[2];
assert(path.dirname == dir);
assert(path.basename == base);
}
}
/********************************
* Extracts the drive letter of a path.
*
* This function will search fullname for a colon from the beginning.
*
* Returns: If a colon is found, all the characters to its left
* plus the colon are returned. Otherwise, null is returned.
*
* Under Linux, this function always returns null immediately.
*
* Throws: Nothing.
*
* Examples:
* -----
* getDrive(r"d:\path\foo.bat") => "d:"
* -----
*/
Char[] getDrive(Char)(Char[] fullname) if (isSomeChar!Char)
// out(result)
// {
// assert(result.length <= fullname.length);
// }
body
{
version(Windows)
{
foreach (i; 0 .. fullname.length)
{
if (fullname[i] == ':')
return fullname[0 .. i + 1];
}
return null;
}
else version(Posix)
{
return null;
}
else
{
static assert(0);
}
}
/****************************
* Appends a default extension to a filename.
*
* This function first searches filename for an extension and
* appends ext if there is none. ext should not have any leading
* dots, one will be inserted between filename and ext if filename
* doesn't already end with one.
*
* Returns: filename if it contains an extension, otherwise filename
* + ext.
*
* Throws: Nothing.
*
* Examples:
* -----
* defaultExt("foo.txt", "raw") => "foo.txt"
* defaultExt("foo.", "raw") => "foo.raw"
* defaultExt("bar", "raw") => "bar.raw"
* -----
*/
string defaultExt(string filename, string ext)
{
string existing;
existing = getExt(filename);
if (existing.length == 0)
{
// Check for filename ending in '.'
if (filename.length && filename[filename.length - 1] == '.')
filename ~= ext;
else
filename = filename ~ "." ~ ext;
}
return filename;
}
/****************************
* Adds or replaces an extension to a filename.
*
* This function first searches filename for an extension and
* replaces it with ext if found. If there is no extension, ext
* will be appended. ext should not have any leading dots, one will
* be inserted between filename and ext if filename doesn't already
* end with one.
*
* Returns: filename + ext if filename is extensionless. Otherwise
* strips filename's extension off, appends ext and returns the
* result.
*
* Throws: Nothing.
*
* Examples:
* -----
* addExt("foo.txt", "raw") => "foo.raw"
* addExt("foo.", "raw") => "foo.raw"
* addExt("bar", "raw") => "bar.raw"
* -----
*/
string addExt(string filename, string ext)
{
string existing;
existing = getExt(filename);
if (existing.length == 0)
{
// Check for filename ending in '.'
if (filename.length && filename[filename.length - 1] == '.')
filename ~= ext;
else
filename = filename ~ "." ~ ext;
}
else
{
filename = filename[0 .. $ - existing.length] ~ ext;
}
return filename;
}
/*************************************
* Checks if path is absolute.
*
* Returns: non-zero if the path starts from the root directory (Linux) or
* drive letter and root directory (Windows),
* zero otherwise.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* isabs(r"relative\path") => 0
* isabs(r"\relative\path") => 0
* isabs(r"d:\absolute") => 1
* }
* version(Posix)
* {
* isabs("/home/user") => 1
* isabs("foo") => 0
* }
* -----
*/
bool isabs(in char[] path)
{
auto d = getDrive(path);
version (Windows)
{
return d.length < path.length &&
(path[d.length] == sep[0] || path[d.length] == altsep[0]);
}
else version (Posix)
{
return d.length < path.length && path[d.length] == sep[0];
}
else
{
static assert(0);
}
}
unittest
{
debug(path) printf("path.isabs.unittest\n");
version (Windows)
{
assert(!isabs(r"relative\path"));
assert(isabs(r"\relative\path"));
assert(isabs(r"d:\absolute"));
}
version (Posix)
{
assert(isabs("/home/user"));
assert(!isabs("foo"));
}
}
/**
* Converts a relative path into an absolute path.
*/
string rel2abs(string path)
{
if (!path.length || isabs(path))
{
return path;
}
auto myDir = getcwd;
if (path.startsWith(curdir[]))
{
auto p = path[curdir.length .. $];
if (p.startsWith(sep[]))
path = p[sep.length .. $];
else if (altsep.length && p.startsWith(altsep[]))
path = p[altsep.length .. $];
else if (!p.length)
path = null;
}
return myDir.endsWith(sep[]) || path.length
? join(myDir, path)
: myDir;
}
unittest
{
version (Posix)
{
auto myDir = getcwd();
scope(exit) std.file.chdir(myDir);
std.file.chdir("/");
assert(rel2abs(".") == "/", rel2abs("."));
assert(rel2abs("bin") == "/bin", rel2abs("bin"));
assert(rel2abs("./bin") == "/bin", rel2abs("./bin"));
std.file.chdir("bin");
assert(rel2abs(".") == "/bin", rel2abs("."));
}
}
/*************************************
* Joins two or more path components.
*
* If p1 doesn't have a trailing path separator, one will be appended
* to it before concatenating p2.
*
* Returns: p1 ~ p2. However, if p2 is an absolute path, only p2
* will be returned.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* join(r"c:\foo", "bar") => r"c:\foo\bar"
* join("foo", r"d:\bar") => r"d:\bar"
* }
* version(Posix)
* {
* join("/foo/", "bar") => "/foo/bar"
* join("/foo", "/bar") => "/bar"
* }
* -----
*/
string join(const(char)[] p1, const(char)[] p2, const(char)[][] more...)
{
if (more.length)
{
// more than two components present
return join(join(p1, p2), more[0], more[1 .. $]);
}
// Focus on exactly two components
if (!p2.length)
return p1.idup;
if (!p1.length)
return p2.idup;
version (Posix)
{
if (isabs(p2)) return p2.idup;
if (p1.endsWith(sep[]) || altsep.length && p1.endsWith(altsep[]))
{
return cast(string) (p1 ~ p2);
}
return cast(string) (p1 ~ sep ~ p2);
}
else version (Windows)
{
string p;
const(char)[] d1;
if (getDrive(p2))
{
p = p2.idup;
}
else
{
d1 = getDrive(p1);
if (p1.length == d1.length)
{
p = cast(string) (p1 ~ p2);
}
else if (p2[0] == '\\')
{
if (d1.length == 0)
p = p2.idup;
else if (p1[p1.length - 1] == '\\')
p = cast(string) (p1 ~ p2[1 .. p2.length]);
else
p = cast(string) (p1 ~ p2);
}
else if (p1[p1.length - 1] == '\\')
{
p = cast(string) (p1 ~ p2);
}
else
{
p = cast(string)(p1 ~ sep ~ p2);
}
}
return p;
}
else // unknown platform
{
static assert(0);
}
}
unittest
{
debug(path) printf("path.join.unittest\n");
string p;
sizediff_t i;
p = join("foo", "bar");
version (Windows)
i = cmp(p, "foo\\bar");
version (Posix)
i = cmp(p, "foo/bar");
assert(i == 0);
version (Windows)
{ p = join("foo\\", "bar");
i = cmp(p, "foo\\bar");
}
version (Posix)
{ p = join("foo/", "bar");
i = cmp(p, "foo/bar");
}
assert(i == 0);
version (Windows)
{ p = join("foo", "\\bar");
i = cmp(p, "\\bar");
}
version (Posix)
{ p = join("foo", "/bar");
i = cmp(p, "/bar");
}
assert(i == 0);
version (Windows)
{ p = join("foo\\", "\\bar");
i = cmp(p, "\\bar");
}
version (Posix)
{ p = join("foo/", "/bar");
i = cmp(p, "/bar");
}
assert(i == 0);
version(Windows)
{
p = join("d:", "bar");
i = cmp(p, "d:bar");
assert(i == 0);
p = join("d:\\", "bar");
i = cmp(p, "d:\\bar");
assert(i == 0);
p = join("d:\\", "\\bar");
i = cmp(p, "d:\\bar");
assert(i == 0);
p = join("d:\\foo", "bar");
i = cmp(p, "d:\\foo\\bar");
assert(i == 0);
p = join("d:", "\\bar");
i = cmp(p, "d:\\bar");
assert(i == 0);
p = join("foo", "d:");
i = cmp(p, "d:");
assert(i == 0);
p = join("foo", "d:\\");
i = cmp(p, "d:\\");
assert(i == 0);
p = join("foo", "d:\\bar");
i = cmp(p, "d:\\bar");
assert(i == 0);
assert(join("d","dmd","src") == "d\\dmd\\src");
}
assert (join("", "foo") == "foo");
assert (join("foo", "") == "foo");
}
/*********************************
* Matches filename characters.
*
* Under Windows, the comparison is done ignoring case. Under Linux
* an exact match is performed.
*
* Returns: non zero if c1 matches c2, zero otherwise.
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* fncharmatch('a', 'b') => 0
* fncharmatch('A', 'a') => 1
* }
* version(Posix)
* {
* fncharmatch('a', 'b') => 0
* fncharmatch('A', 'a') => 0
* }
* -----
*/
bool fncharmatch(dchar c1, dchar c2)
{
version (Windows)
{
if (c1 != c2)
{
if ('A' <= c1 && c1 <= 'Z')
c1 += cast(char)'a' - 'A';
if ('A' <= c2 && c2 <= 'Z')
c2 += cast(char)'a' - 'A';
return c1 == c2;
}
return true;
}
else version (Posix)
{
return c1 == c2;
}
else
{
static assert(0);
}
}
/************************************
* Matches a pattern against a filename.
*
* Some characters of pattern have special a meaning (they are
* <i>meta-characters</i>) and <b>can't</b> be escaped. These are:
* <p><table>
* <tr><td><b>*</b></td>
* <td>Matches 0 or more instances of any character.</td></tr>
* <tr><td><b>?</b></td>
* <td>Matches exactly one instances of any character.</td></tr>
* <tr><td><b>[</b><i>chars</i><b>]</b></td>
* <td>Matches one instance of any character that appears
* between the brackets.</td></tr>
* <tr><td><b>[!</b><i>chars</i><b>]</b></td>
* <td>Matches one instance of any character that does not appear
* between the brackets after the exclamation mark.</td></tr>
* </table><p>
* Internally individual character comparisons are done calling
* fncharmatch(), so its rules apply here too. Note that path
* separators and dots don't stop a meta-character from matching
* further portions of the filename.
*
* Returns: non zero if pattern matches filename, zero otherwise.
*
* See_Also: fncharmatch().
*
* Throws: Nothing.
*
* Examples:
* -----
* version(Windows)
* {
* fnmatch("foo.bar", "*") => 1
* fnmatch(r"foo/foo\bar", "f*b*r") => 1
* fnmatch("foo.bar", "f?bar") => 0
* fnmatch("Goo.bar", "[fg]???bar") => 1
* fnmatch(r"d:\foo\bar", "d*foo?bar") => 1
* }
* version(Posix)
* {
* fnmatch("Go*.bar", "[fg]???bar") => 0
* fnmatch("/foo*home/bar", "?foo*bar") => 1
* fnmatch("foobar", "foo?bar") => 1
* }
* -----
*/
bool fnmatch(const(char)[] filename, const(char)[] pattern)
in
{
// Verify that pattern[] is valid
assert(balancedParens(pattern, '[', ']', 0));
assert(balancedParens(pattern, '{', '}', 0));
}
body
{
size_t ni; // current character in filename
foreach (pi; 0 .. pattern.length)
{
char pc = pattern[pi];
switch (pc)
{
case '*':
if (pi + 1 == pattern.length)
return true;
foreach (j; ni .. filename.length)
{
if (fnmatch(filename[j .. filename.length],
pattern[pi + 1 .. pattern.length]))
return true;
}
return false;
case '?':
if (ni == filename.length)
return false;
ni++;
break;
case '[': {
if (ni == filename.length)
return false;
auto nc = filename[ni];
ni++;
auto not = false;
pi++;
if (pattern[pi] == '!')
{
not = true;
pi++;
}
auto anymatch = false;
while (1)
{
pc = pattern[pi];
if (pc == ']')
break;
if (!anymatch && fncharmatch(nc, pc))
anymatch = true;
pi++;
}
if (anymatch == not)
return false;
}
break;
case '{': {
// find end of {} section
auto piRemain = pi;
for (; piRemain < pattern.length
&& pattern[piRemain] != '}'; piRemain++)
{}
if (piRemain < pattern.length) piRemain++;
pi++;
while (pi < pattern.length)
{
auto pi0 = pi;
pc = pattern[pi];
// find end of current alternative
for (; pi<pattern.length && pc!='}' && pc!=','; pi++)
{
pc = pattern[pi];
}
if (pi0 == pi)
{
if (fnmatch(filename[ni..$], pattern[piRemain..$]))
{
return true;
}
pi++;
}
else
{
if (fnmatch(filename[ni..$],
pattern[pi0..pi-1]
~ pattern[piRemain..$]))
{
return true;
}
}
if (pc == '}')
{
break;
}
}
}
return false;
default:
if (ni == filename.length)
return false;
if (!fncharmatch(pc, filename[ni]))
return false;
ni++;
break;
}
}
assert(ni >= filename.length);
return ni == filename.length;
}
unittest
{
debug(path) printf("path.fnmatch.unittest\n");
version (Win32)
assert(fnmatch("foo", "Foo"));
version (linux)
assert(!fnmatch("foo", "Foo"));
assert(fnmatch("foo", "*"));
assert(fnmatch("foo.bar", "*"));
assert(fnmatch("foo.bar", "*.*"));
assert(fnmatch("foo.bar", "foo*"));
assert(fnmatch("foo.bar", "f*bar"));
assert(fnmatch("foo.bar", "f*b*r"));
assert(fnmatch("foo.bar", "f???bar"));
assert(fnmatch("foo.bar", "[fg]???bar"));
assert(fnmatch("foo.bar", "[!gh]*bar"));
assert(!fnmatch("foo", "bar"));
assert(!fnmatch("foo", "*.*"));
assert(!fnmatch("foo.bar", "f*baz"));
assert(!fnmatch("foo.bar", "f*b*x"));
assert(!fnmatch("foo.bar", "[gh]???bar"));
assert(!fnmatch("foo.bar", "[!fg]*bar"));
assert(!fnmatch("foo.bar", "[fg]???baz"));
assert(fnmatch("foo.bar", "{foo,bif}.bar"));
assert(fnmatch("bif.bar", "{foo,bif}.bar"));
assert(fnmatch("bar.foo", "bar.{foo,bif}"));
assert(fnmatch("bar.bif", "bar.{foo,bif}"));
assert(fnmatch("bar.fooz", "bar.{foo,bif}z"));
assert(fnmatch("bar.bifz", "bar.{foo,bif}z"));
assert(fnmatch("bar.foo", "bar.{biz,,baz}foo"));
assert(fnmatch("bar.foo", "bar.{biz,}foo"));
assert(fnmatch("bar.foo", "bar.{,biz}foo"));
assert(fnmatch("bar.foo", "bar.{}foo"));
assert(fnmatch("bar.foo", "bar.{ar,,fo}o"));
assert(fnmatch("bar.foo", "bar.{,ar,fo}o"));
assert(fnmatch("bar.o", "bar.{,ar,fo}o"));
}
/**
* Performs tilde expansion in paths.
*
* There are two ways of using tilde expansion in a path. One
* involves using the tilde alone or followed by a path separator. In
* this case, the tilde will be expanded with the value of the
* environment variable <i>HOME</i>. The second way is putting
* a username after the tilde (i.e. <tt>~john/Mail</tt>). Here,
* the username will be searched for in the user database
* (i.e. <tt>/etc/passwd</tt> on Unix systems) and will expand to
* whatever path is stored there. The username is considered the
* string after the tilde ending at the first instance of a path
* separator.
*
* Note that using the <i>~user</i> syntax may give different
* values from just <i>~</i> if the environment variable doesn't
* match the value stored in the user database.
*
* When the environment variable version is used, the path won't
* be modified if the environment variable doesn't exist or it
* is empty. When the database version is used, the path won't be
* modified if the user doesn't exist in the database or there is
* not enough memory to perform the query.
*
* Returns: inputPath with the tilde expanded, or just inputPath
* if it could not be expanded.
* For Windows, expandTilde() merely returns its argument inputPath.
*
* Throws: std.outofmemory.OutOfMemoryException if there is not enough
* memory to perform
* the database lookup for the <i>~user</i> syntax.
*
* Examples:
* -----
* import std.path;
*
* void process_file(string filename)
* {
* string path = expandTilde(filename);
* ...
* }
* -----
*
* -----
* import std.path;
*
* string RESOURCE_DIR_TEMPLATE = "~/.applicationrc";
* string RESOURCE_DIR; // This gets expanded in main().
*
* int main(string[] args)
* {
* RESOURCE_DIR = expandTilde(RESOURCE_DIR_TEMPLATE);
* ...
* }
* -----
* Version: Available since v0.143.
* Authors: Grzegorz Adam Hankiewicz, Thomas Kühne.
*/
string expandTilde(string inputPath)
{
version(Posix)
{
static assert(sep.length == 1);
// Return early if there is no tilde in path.
if (inputPath.length < 1 || inputPath[0] != '~')
return inputPath;
if (inputPath.length == 1 || inputPath[1] == sep[0])
return expandFromEnvironment(inputPath);
else
return expandFromDatabase(inputPath);
}
else version(Windows)
{
// Put here real windows implementation.
return inputPath;
}
else
{
static assert(0); // Guard. Implement on other platforms.
}
}
unittest
{
debug(path) printf("path.expandTilde.unittest\n");
version (Posix)
{
// Retrieve the current home variable.
auto c_home = std.process.getenv("HOME");
// Testing when there is no environment variable.
unsetenv("HOME");
assert(expandTilde("~/") == "~/");
assert(expandTilde("~") == "~");
// Testing when an environment variable is set.
std.process.setenv("HOME", "dmd/test\0", 1);
assert(expandTilde("~/") == "dmd/test/");
assert(expandTilde("~") == "dmd/test");
// The same, but with a variable ending in a slash.
std.process.setenv("HOME", "dmd/test/\0", 1);
assert(expandTilde("~/") == "dmd/test/");
assert(expandTilde("~") == "dmd/test");
// Recover original HOME variable before continuing.
if (c_home)
std.process.setenv("HOME", c_home, 1);
else
unsetenv("HOME");
// Test user expansion for root. Are there unices without /root?
version (OSX)
assert(expandTilde("~root") == "/var/root", expandTilde("~root"));
else
assert(expandTilde("~root") == "/root", expandTilde("~root"));
version (OSX)
assert(expandTilde("~root/") == "/var/root/", expandTilde("~root/"));
else
assert(expandTilde("~root/") == "/root/", expandTilde("~root/"));
assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey");
}
}
version (Posix)
{
/**
* Replaces the tilde from path with the environment variable HOME.
*/
private string expandFromEnvironment(string path)
{
assert(path.length >= 1);
assert(path[0] == '~');
// Get HOME and use that to replace the tilde.
auto home = core.stdc.stdlib.getenv("HOME");
if (home == null)
return path;
return combineCPathWithDPath(home, path, 1);
}
/**
* Joins a path from a C string to the remainder of path.
*
* The last path separator from c_path is discarded. The result
* is joined to path[char_pos .. length] if char_pos is smaller
* than length, otherwise path is not appended to c_path.
*/
private string combineCPathWithDPath(char* c_path, string path, size_t char_pos)
{
assert(c_path != null);
assert(path.length > 0);
assert(char_pos >= 0);
// Search end of C string
size_t end = std.c.string.strlen(c_path);
// Remove trailing path separator, if any
if (end && c_path[end - 1] == sep[0])
end--;
// Create our own copy, as lifetime of c_path is undocumented
string cp = c_path[0 .. end].idup;
// Do we append something from path?
if (char_pos < path.length)
cp ~= path[char_pos .. $];
return cp;
}
/**
* Replaces the tilde from path with the path from the user database.
*/
private string expandFromDatabase(string path)
{
assert(path.length > 2 || (path.length == 2 && path[1] != sep[0]));
assert(path[0] == '~');
// Extract username, searching for path separator.
string username;
auto last_char = std.algorithm.countUntil(path, sep[0]);
if (last_char == -1)
{
username = path[1 .. $] ~ '\0';
last_char = username.length + 1;
}
else
{
username = path[1 .. last_char] ~ '\0';
}
assert(last_char > 1);
// Reserve C memory for the getpwnam_r() function.
passwd result;
int extra_memory_size = 5 * 1024;
void* extra_memory;
while (1)
{
extra_memory = std.c.stdlib.malloc(extra_memory_size);
if (extra_memory == null)
goto Lerror;
// Obtain info from database.
passwd *verify;
setErrno(0);
if (getpwnam_r(cast(char*) username.ptr, &result, cast(char*) extra_memory, extra_memory_size,
&verify) == 0)
{
// Failure if verify doesn't point at result.
if (verify != &result)
// username is not found, so return path[]
goto Lnotfound;
break;
}
if (errno != ERANGE)
goto Lerror;
// extra_memory isn't large enough
std.c.stdlib.free(extra_memory);
extra_memory_size *= 2;
}
path = combineCPathWithDPath(result.pw_dir, path, last_char);
Lnotfound:
std.c.stdlib.free(extra_memory);
return path;
Lerror:
// Errors are going to be caused by running out of memory
if (extra_memory)
std.c.stdlib.free(extra_memory);
onOutOfMemoryError();
return null;
}
}
|
D
|
// BulletD - a D binding for the Bullet Physics engine
// written in the D programming language
//
// Copyright: Ben Merritt 2012 - 2013,
// MeinMein 2013 - 2014.
// License: Boost License 1.0
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Authors: Ben Merrit,
// Gerbrand Kamphuis (meinmein.com).
module bullet.bindings.dmethods;
import bullet.bindings.bindings;
enum Binding;
/*
called by dMethod:
void _destroy()
called by dGlue:
extern(C) void _glue_12203819563545677224(ref btTypedObject a0)
*/
template dMethodCommon(string qualifiers, T, string name, ArgTypes ...)
{
enum dMethodCommon = qualifiers ~ " " ~ dType!T ~ " " ~ name ~ "(" ~ argList!(dType, 0, ArgTypes) ~ ")";
}
template dMethod(Class, string qualifiers, T, string name, ArgTypes ...)
{
private enum common = dMethodCommon!(qualifiers, T, name, ArgTypes);
static if(adjustSymbols)
{
import std.string: split, canFind;
private enum isStatic = qualifiers.split.canFind("static");
private enum symName = symbolName!(Class, name, ArgTypes);
/*
void _destroy();
@Binding immutable string _d_glue__glue_12203819563545677224 = `extern(C) void _glue_12203819563545677224(ref btTypedObject a0);`;
*/
static if(bindSymbols)
{
private enum glueExtern = dGlueDefineExtern!(Class, T, symName, isStatic, ArgTypes);
enum dMethod = common ~ ";" ~
"@Binding static immutable string _d_glue_" ~ symName ~ " = `" ~ glueExtern ~ "`;";
}
/*
void _destroy() {return _glue_12203819563545677224(this);}
*/
else
{
enum glueCallExtern = dGlueCallExtern!(isStatic, ArgTypes);
enum dMethod = common ~ " {" ~
"return " ~ symName ~ "(" ~ glueCallExtern ~ ");" ~
"}";
}
}
else
{
enum dMethod = "extern(C) " ~ common ~ ";";
}
}
static if(adjustSymbols)
{
/*
extern(C) void _glue_12203819563545677224(ref btTypedObject a0);
*/
template dGlueDefineExtern(Class, T, string symName, bool isStatic, ArgTypes ...)
{
static if(isStatic)
enum dGlueDefineExtern = dMethodCommon!("extern(C)", T, symName, ArgTypes) ~ ";";
else
enum dGlueDefineExtern = dMethodCommon!("extern(C)", T, symName, ParamRef!Class, ArgTypes) ~ ";";
}
/*
this, a0
*/
template dGlueCallExtern(bool isStatic, ArgTypes ...)
{
static if(isStatic)
enum dGlueCallExtern = argNames!(ArgTypes.length);
else
// pass _this.ptr, which is equal to the original C pointer
enum dGlueCallExtern = "cast(typeof(this)*)_this.ptr" ~ (ArgTypes.length ? ", " : "") ~ argNames!(ArgTypes.length);
}
}
mixin template method(T, string name, ArgTypes ...)
{
mixin(dMethod!(typeof(this), "", T, name, ArgTypes));
static if(bindSymbols)
mixin(cMethod!(typeof(this), cMethodBinding, T, name, ArgTypes));
}
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.bigint;
|
D
|
/*
* Copyright (C) 2004 by Digital Mars, www.digitalmars.com
* Written by Walter Bright
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, in both source and binary form, subject to the following
* restrictions:
*
* o The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* o Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
* o This notice may not be removed or altered from any source
* distribution.
*/
static import runtime.system.system;
extern (C):
short *_memset16(short *p, short value, int count)
{
short *pstart = p;
short *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
int *_memset32(int *p, int value, int count)
{
version (X86)
{
asm
{
mov EDI,p ;
mov EAX,value ;
mov ECX,count ;
mov EDX,EDI ;
rep ;
stosd ;
mov EAX,EDX ;
}
}
else
{
int *pstart = p;
int *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
}
long *_memset64(long *p, long value, int count)
{
long *pstart = p;
long *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
cdouble *_memset128(cdouble *p, cdouble value, int count)
{
cdouble *pstart = p;
cdouble *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
real *_memset80(real *p, real value, int count)
{
real *pstart = p;
real *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
creal *_memset160(creal *p, creal value, int count)
{
creal *pstart = p;
creal *ptop;
for (ptop = &p[count]; p < ptop; p++)
*p = value;
return pstart;
}
void *_memsetn(void *p, void *value, int count, int sizelem)
{ void *pstart = p;
int i;
for (i = 0; i < count; i++)
{
runtime.system.system.memcpy(p, value, sizelem);
p = cast(void *)(cast(char *)p + sizelem);
}
return pstart;
}
|
D
|
/**
* Miscellaneous declarations, including typedef, alias, variable declarations including the
* implicit this declaration, type tuples, ClassInfo, ModuleInfo and various TypeInfos.
*
* Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/declaration.d, _declaration.d)
* Documentation: https://dlang.org/phobos/dmd_declaration.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/declaration.d
*/
module dmd.declaration;
import core.stdc.stdio;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.astenums;
import dmd.attrib;
import dmd.ctorflow;
import dmd.dclass;
import dmd.delegatize;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import dmd.expression;
import dmd.func;
import dmd.globals;
import dmd.gluelayer;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.initsem;
import dmd.intrange;
import dmd.location;
import dmd.mtype;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.target;
import dmd.tokens;
import dmd.typesem;
import dmd.visitor;
/************************************
* Check to see the aggregate type is nested and its context pointer is
* accessible from the current scope.
* Returns true if error occurs.
*/
bool checkFrameAccess(Loc loc, Scope* sc, AggregateDeclaration ad, size_t iStart = 0)
{
Dsymbol sparent = ad.toParentLocal();
Dsymbol sparent2 = ad.toParent2();
Dsymbol s = sc.func;
if (ad.isNested() && s)
{
//printf("ad = %p %s [%s], parent:%p\n", ad, ad.toChars(), ad.loc.toChars(), ad.parent);
//printf("sparent = %p %s [%s], parent: %s\n", sparent, sparent.toChars(), sparent.loc.toChars(), sparent.parent,toChars());
//printf("sparent2 = %p %s [%s], parent: %s\n", sparent2, sparent2.toChars(), sparent2.loc.toChars(), sparent2.parent,toChars());
if (!ensureStaticLinkTo(s, sparent) || sparent != sparent2 && !ensureStaticLinkTo(s, sparent2))
{
error(loc, "cannot access frame pointer of `%s`", ad.toPrettyChars());
return true;
}
}
bool result = false;
for (size_t i = iStart; i < ad.fields.length; i++)
{
VarDeclaration vd = ad.fields[i];
Type tb = vd.type.baseElemOf();
if (tb.ty == Tstruct)
{
result |= checkFrameAccess(loc, sc, (cast(TypeStruct)tb).sym);
}
}
return result;
}
/***********************************************
* Mark variable v as modified if it is inside a constructor that var
* is a field in.
* Also used to allow immutable globals to be initialized inside a static constructor.
* Returns:
* true if it's an initialization of v
*/
bool modifyFieldVar(Loc loc, Scope* sc, VarDeclaration var, Expression e1)
{
//printf("modifyFieldVar(var = %s)\n", var.toChars());
Dsymbol s = sc.func;
while (1)
{
FuncDeclaration fd = null;
if (s)
fd = s.isFuncDeclaration();
if (fd &&
((fd.isCtorDeclaration() && var.isField()) ||
((fd.isStaticCtorDeclaration() || fd.isCrtCtor) && !var.isField())) &&
fd.toParentDecl() == var.toParent2() &&
(!e1 || e1.op == EXP.this_))
{
bool result = true;
var.ctorinit = true;
//printf("setting ctorinit\n");
if (var.isField() && sc.ctorflow.fieldinit.length && !sc.intypeof)
{
assert(e1);
auto mustInit = ((var.storage_class & STC.nodefaultctor) != 0 ||
var.type.needsNested());
const dim = sc.ctorflow.fieldinit.length;
auto ad = fd.isMemberDecl();
assert(ad);
size_t i;
for (i = 0; i < dim; i++) // same as findFieldIndexByName in ctfeexp.c ?
{
if (ad.fields[i] == var)
break;
}
assert(i < dim);
auto fieldInit = &sc.ctorflow.fieldinit[i];
const fi = fieldInit.csx;
if (fi & CSX.this_ctor)
{
if (var.type.isMutable() && e1.type.isMutable())
result = false;
else
{
const(char)* modStr = !var.type.isMutable() ? MODtoChars(var.type.mod) : MODtoChars(e1.type.mod);
.error(loc, "%s field `%s` initialized multiple times", modStr, var.toChars());
.errorSupplemental(fieldInit.loc, "Previous initialization is here.");
}
}
else if (sc.inLoop || (fi & CSX.label))
{
if (!mustInit && var.type.isMutable() && e1.type.isMutable())
result = false;
else
{
const(char)* modStr = !var.type.isMutable() ? MODtoChars(var.type.mod) : MODtoChars(e1.type.mod);
.error(loc, "%s field `%s` initialization is not allowed in loops or after labels", modStr, var.toChars());
}
}
fieldInit.csx |= CSX.this_ctor;
fieldInit.loc = e1.loc;
if (var.overlapped) // https://issues.dlang.org/show_bug.cgi?id=15258
{
foreach (j, v; ad.fields)
{
if (v is var || !var.isOverlappedWith(v))
continue;
v.ctorinit = true;
sc.ctorflow.fieldinit[j].csx = CSX.this_ctor;
}
}
}
else if (fd != sc.func)
{
if (var.type.isMutable())
result = false;
else if (sc.func.fes)
{
const(char)* p = var.isField() ? "field" : var.kind();
.error(loc, "%s %s `%s` initialization is not allowed in foreach loop",
MODtoChars(var.type.mod), p, var.toChars());
}
else
{
const(char)* p = var.isField() ? "field" : var.kind();
.error(loc, "%s %s `%s` initialization is not allowed in nested function `%s`",
MODtoChars(var.type.mod), p, var.toChars(), sc.func.toChars());
}
}
else if (fd.isStaticCtorDeclaration() && !fd.isSharedStaticCtorDeclaration() &&
var.type.isImmutable())
{
.error(loc, "%s %s `%s` initialization is not allowed in `static this`",
MODtoChars(var.type.mod), var.kind(), var.toChars());
errorSupplemental(loc, "Use `shared static this` instead.");
}
return result;
}
else
{
if (s)
{
s = s.toParentP(var.toParent2());
continue;
}
}
break;
}
return false;
}
/******************************************
*/
extern (C++) void ObjectNotFound(Identifier id)
{
error(Loc.initial, "`%s` not found. object.d may be incorrectly installed or corrupt.", id.toChars());
fatal();
}
/* Accumulator for successive matches.
*/
struct MatchAccumulator
{
int count; // number of matches found so far
MATCH last = MATCH.nomatch; // match level of lastf
FuncDeclaration lastf; // last matching function we found
FuncDeclaration nextf; // if ambiguous match, this is the "other" function
}
/***********************************************************
*/
extern (C++) abstract class Declaration : Dsymbol
{
Type type;
Type originalType; // before semantic analysis
StorageClass storage_class = STC.undefined_;
Visibility visibility;
LINK _linkage = LINK.default_; // may be `LINK.system`; use `resolvedLinkage()` to resolve it
short inuse; // used to detect cycles
ubyte adFlags; // control re-assignment of AliasDeclaration (put here for packing reasons)
enum wasRead = 1; // set if AliasDeclaration was read
enum ignoreRead = 2; // ignore any reads of AliasDeclaration
enum nounderscore = 4; // don't prepend _ to mangled name
Symbol* isym; // import version of csym
// overridden symbol with pragma(mangle, "...")
const(char)[] mangleOverride;
final extern (D) this(Identifier ident)
{
super(ident);
visibility = Visibility(Visibility.Kind.undefined);
}
final extern (D) this(const ref Loc loc, Identifier ident)
{
super(loc, ident);
visibility = Visibility(Visibility.Kind.undefined);
}
override const(char)* kind() const
{
return "declaration";
}
override final uinteger_t size(const ref Loc loc)
{
assert(type);
const sz = type.size();
if (sz == SIZE_INVALID)
errors = true;
return sz;
}
/**
* Issue an error if an attempt to call a disabled method is made
*
* If the declaration is disabled but inside a disabled function,
* returns `true` but do not issue an error message.
*
* Params:
* loc = Location information of the call
* sc = Scope in which the call occurs
* isAliasedDeclaration = if `true` searches overload set
*
* Returns:
* `true` if this `Declaration` is `@disable`d, `false` otherwise.
*/
extern (D) final bool checkDisabled(Loc loc, Scope* sc, bool isAliasedDeclaration = false)
{
if (!(storage_class & STC.disable))
return false;
if (sc.func && sc.func.storage_class & STC.disable)
return true;
if (auto p = toParent())
{
if (auto postblit = isPostBlitDeclaration())
{
/* https://issues.dlang.org/show_bug.cgi?id=21885
*
* If the generated postblit is disabled, it
* means that one of the fields has a disabled
* postblit. Print the first field that has
* a disabled postblit.
*/
if (postblit.isGenerated())
{
auto sd = p.isStructDeclaration();
assert(sd);
for (size_t i = 0; i < sd.fields.length; i++)
{
auto structField = sd.fields[i];
if (structField.overlapped)
continue;
Type tv = structField.type.baseElemOf();
if (tv.ty != Tstruct)
continue;
auto sdv = (cast(TypeStruct)tv).sym;
if (!sdv.postblit)
continue;
if (sdv.postblit.isDisabled())
{
p.error(loc, "is not copyable because field `%s` is not copyable", structField.toChars());
return true;
}
}
}
p.error(loc, "is not copyable because it has a disabled postblit");
return true;
}
}
// if the function is @disabled, maybe there
// is an overload in the overload set that isn't
if (isAliasedDeclaration)
{
FuncDeclaration fd = isFuncDeclaration();
if (fd)
{
for (FuncDeclaration ovl = fd; ovl; ovl = cast(FuncDeclaration)ovl.overnext)
if (!(ovl.storage_class & STC.disable))
return false;
}
}
if (auto ctor = isCtorDeclaration())
{
if (ctor.isCpCtor && ctor.isGenerated())
{
.error(loc, "generating an `inout` copy constructor for `struct %s` failed, therefore instances of it are uncopyable", parent.toPrettyChars());
return true;
}
}
error(loc, "cannot be used because it is annotated with `@disable`");
return true;
}
/*************************************
* Check to see if declaration can be modified in this context (sc).
* Issue error if not.
* Params:
* loc = location for error messages
* e1 = `null` or `this` expression when this declaration is a field
* sc = context
* flag = if the first bit is set it means do not issue error message for
* invalid modification; if the second bit is set, it means that
this declaration is a field and a subfield of it is modified.
* Returns:
* Modifiable.yes or Modifiable.initialization
*/
extern (D) final Modifiable checkModify(Loc loc, Scope* sc, Expression e1, ModifyFlags flag)
{
VarDeclaration v = isVarDeclaration();
if (v && v.canassign)
return Modifiable.initialization;
if (isParameter() || isResult())
{
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx.func == parent && (scx.flags & SCOPE.contract))
{
const(char)* s = isParameter() && parent.ident != Id.ensure ? "parameter" : "result";
if (!(flag & ModifyFlags.noError))
error(loc, "cannot modify %s `%s` in contract", s, toChars());
return Modifiable.initialization; // do not report type related errors
}
}
}
if (e1 && e1.op == EXP.this_ && isField())
{
VarDeclaration vthis = e1.isThisExp().var;
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx.func == vthis.parent && (scx.flags & SCOPE.contract))
{
if (!(flag & ModifyFlags.noError))
error(loc, "cannot modify parameter `this` in contract");
return Modifiable.initialization; // do not report type related errors
}
}
}
if (v && (v.isCtorinit() || isField()))
{
// It's only modifiable if inside the right constructor
if ((storage_class & (STC.foreach_ | STC.ref_)) == (STC.foreach_ | STC.ref_))
return Modifiable.initialization;
if (flag & ModifyFlags.fieldAssign)
return Modifiable.yes;
return modifyFieldVar(loc, sc, v, e1) ? Modifiable.initialization : Modifiable.yes;
}
return Modifiable.yes;
}
override final Dsymbol search(const ref Loc loc, Identifier ident, int flags = SearchLocalsOnly)
{
Dsymbol s = Dsymbol.search(loc, ident, flags);
if (!s && type)
{
s = type.toDsymbol(_scope);
if (s)
s = s.search(loc, ident, flags);
}
return s;
}
final bool isStatic() const pure nothrow @nogc @safe
{
return (storage_class & STC.static_) != 0;
}
/// Returns the linkage, resolving the target-specific `System` one.
final LINK resolvedLinkage() const
{
return _linkage == LINK.system ? target.systemLinkage() : _linkage;
}
bool isDelete()
{
return false;
}
bool isDataseg()
{
return false;
}
bool isThreadlocal()
{
return false;
}
bool isCodeseg() const pure nothrow @nogc @safe
{
return false;
}
final bool isFinal() const pure nothrow @nogc @safe
{
return (storage_class & STC.final_) != 0;
}
bool isAbstract()
{
return (storage_class & STC.abstract_) != 0;
}
final bool isConst() const pure nothrow @nogc @safe
{
return (storage_class & STC.const_) != 0;
}
final bool isImmutable() const pure nothrow @nogc @safe
{
return (storage_class & STC.immutable_) != 0;
}
final bool isWild() const pure nothrow @nogc @safe
{
return (storage_class & STC.wild) != 0;
}
final bool isAuto() const pure nothrow @nogc @safe
{
return (storage_class & STC.auto_) != 0;
}
final bool isScope() const pure nothrow @nogc @safe
{
return (storage_class & STC.scope_) != 0;
}
final bool isReturn() const pure nothrow @nogc @safe
{
return (storage_class & STC.return_) != 0;
}
final bool isSynchronized() const pure nothrow @nogc @safe
{
return (storage_class & STC.synchronized_) != 0;
}
final bool isParameter() const pure nothrow @nogc @safe
{
return (storage_class & STC.parameter) != 0;
}
override final bool isDeprecated() const pure nothrow @nogc @safe
{
return (storage_class & STC.deprecated_) != 0;
}
final bool isDisabled() const pure nothrow @nogc @safe
{
return (storage_class & STC.disable) != 0;
}
final bool isOverride() const pure nothrow @nogc @safe
{
return (storage_class & STC.override_) != 0;
}
final bool isResult() const pure nothrow @nogc @safe
{
return (storage_class & STC.result) != 0;
}
final bool isField() const pure nothrow @nogc @safe
{
return (storage_class & STC.field) != 0;
}
final bool isIn() const pure nothrow @nogc @safe
{
return (storage_class & STC.in_) != 0;
}
final bool isOut() const pure nothrow @nogc @safe
{
return (storage_class & STC.out_) != 0;
}
final bool isRef() const pure nothrow @nogc @safe
{
return (storage_class & STC.ref_) != 0;
}
/// Returns: Whether the variable is a reference, annotated with `out` or `ref`
final bool isReference() const pure nothrow @nogc @safe
{
return (storage_class & (STC.ref_ | STC.out_)) != 0;
}
final bool isFuture() const pure nothrow @nogc @safe
{
return (storage_class & STC.future) != 0;
}
final extern(D) bool isSystem() const pure nothrow @nogc @safe
{
return (storage_class & STC.system) != 0;
}
override final Visibility visible() pure nothrow @nogc @safe
{
return visibility;
}
override final inout(Declaration) isDeclaration() inout pure nothrow @nogc @safe
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TupleDeclaration : Declaration
{
Objects* objects;
TypeTuple tupletype; // !=null if this is a type tuple
bool isexp; // true: expression tuple
bool building; // it's growing in AliasAssign semantic
extern (D) this(const ref Loc loc, Identifier ident, Objects* objects)
{
super(loc, ident);
this.objects = objects;
}
override TupleDeclaration syntaxCopy(Dsymbol s)
{
assert(0);
}
override const(char)* kind() const
{
return "tuple";
}
override Type getType()
{
/* If this tuple represents a type, return that type
*/
//printf("TupleDeclaration::getType() %s\n", toChars());
if (isexp || building)
return null;
if (!tupletype)
{
/* It's only a type tuple if all the Object's are types
*/
for (size_t i = 0; i < objects.length; i++)
{
RootObject o = (*objects)[i];
if (o.dyncast() != DYNCAST.type)
{
//printf("\tnot[%d], %p, %d\n", i, o, o.dyncast());
return null;
}
}
/* We know it's a type tuple, so build the TypeTuple
*/
Types* types = cast(Types*)objects;
auto args = new Parameters(objects.length);
OutBuffer buf;
int hasdeco = 1;
for (size_t i = 0; i < types.length; i++)
{
Type t = (*types)[i];
//printf("type = %s\n", t.toChars());
version (none)
{
buf.printf("_%s_%d", ident.toChars(), i);
const len = buf.offset;
const name = buf.extractSlice().ptr;
auto id = Identifier.idPool(name, len);
auto arg = new Parameter(STC.in_, t, id, null);
}
else
{
auto arg = new Parameter(0, t, null, null, null);
}
(*args)[i] = arg;
if (!t.deco)
hasdeco = 0;
}
tupletype = new TypeTuple(args);
if (hasdeco)
return tupletype.typeSemantic(Loc.initial, null);
}
return tupletype;
}
override Dsymbol toAlias2()
{
//printf("TupleDeclaration::toAlias2() '%s' objects = %s\n", toChars(), objects.toChars());
for (size_t i = 0; i < objects.length; i++)
{
RootObject o = (*objects)[i];
if (Dsymbol s = isDsymbol(o))
{
s = s.toAlias2();
(*objects)[i] = s;
}
}
return this;
}
override bool needThis()
{
//printf("TupleDeclaration::needThis(%s)\n", toChars());
return isexp ? foreachVar((s) { return s.needThis(); }) != 0 : false;
}
/***********************************************************
* Calls dg(Dsymbol) for each Dsymbol, which should be a VarDeclaration
* inside VarExp (isexp == true).
* Params:
* dg = delegate to call for each Dsymbol
*/
extern (D) void foreachVar(scope void delegate(Dsymbol) dg)
{
assert(isexp);
foreach (o; *objects)
{
if (auto e = o.isExpression())
if (auto ve = e.isVarExp())
dg(ve.var);
}
}
/***********************************************************
* Calls dg(Dsymbol) for each Dsymbol, which should be a VarDeclaration
* inside VarExp (isexp == true).
* If dg returns !=0, stops and returns that value else returns 0.
* Params:
* dg = delegate to call for each Dsymbol
* Returns:
* last value returned by dg()
*/
extern (D) int foreachVar(scope int delegate(Dsymbol) dg)
{
assert(isexp);
foreach (o; *objects)
{
if (auto e = o.isExpression())
if (auto ve = e.isVarExp())
if(auto ret = dg(ve.var))
return ret;
}
return 0;
}
override inout(TupleDeclaration) isTupleDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* https://dlang.org/spec/declaration.html#AliasDeclaration
*/
extern (C++) final class AliasDeclaration : Declaration
{
Dsymbol aliassym; // alias ident = aliassym;
Dsymbol overnext; // next in overload list
Dsymbol _import; // !=null if unresolved internal alias for selective import
extern (D) this(const ref Loc loc, Identifier ident, Type type)
{
super(loc, ident);
//printf("AliasDeclaration(id = '%s', type = %p)\n", id.toChars(), type);
//printf("type = '%s'\n", type.toChars());
this.type = type;
assert(type);
}
extern (D) this(const ref Loc loc, Identifier ident, Dsymbol s)
{
super(loc, ident);
//printf("AliasDeclaration(id = '%s', s = %p)\n", id.toChars(), s);
assert(s != this);
this.aliassym = s;
assert(s);
}
static AliasDeclaration create(const ref Loc loc, Identifier id, Type type)
{
return new AliasDeclaration(loc, id, type);
}
override AliasDeclaration syntaxCopy(Dsymbol s)
{
//printf("AliasDeclaration::syntaxCopy()\n");
assert(!s);
AliasDeclaration sa = type ? new AliasDeclaration(loc, ident, type.syntaxCopy()) : new AliasDeclaration(loc, ident, aliassym.syntaxCopy(null));
sa.comment = comment;
sa.storage_class = storage_class;
return sa;
}
override bool overloadInsert(Dsymbol s)
{
//printf("[%s] AliasDeclaration::overloadInsert('%s') s = %s %s @ [%s]\n",
// loc.toChars(), toChars(), s.kind(), s.toChars(), s.loc.toChars());
/** Aliases aren't overloadable themselves, but if their Aliasee is
* overloadable they are converted to an overloadable Alias (either
* FuncAliasDeclaration or OverDeclaration).
*
* This is done by moving the Aliasee into such an overloadable alias
* which is then used to replace the existing Aliasee. The original
* Alias (_this_) remains a useless shell.
*
* This is a horrible mess. It was probably done to avoid replacing
* existing AST nodes and references, but it needs a major
* simplification b/c it's too complex to maintain.
*
* A simpler approach might be to merge any colliding symbols into a
* simple Overload class (an array) and then later have that resolve
* all collisions.
*/
if (semanticRun >= PASS.semanticdone)
{
/* Semantic analysis is already finished, and the aliased entity
* is not overloadable.
*/
if (type)
{
/*
If type has been resolved already we could
still be inserting an alias from an import.
If we are handling an alias then pretend
it was inserting and return true, if not then
false since we didn't even pretend to insert something.
*/
return this._import && this.equals(s);
}
/* When s is added in member scope by static if, mixin("code") or others,
* aliassym is determined already. See the case in: test/compilable/test61.d
*/
auto sa = aliassym.toAlias();
if (auto td = s.toAlias().isTemplateDeclaration())
s = td.funcroot ? td.funcroot : td;
if (auto fd = sa.isFuncDeclaration())
{
auto fa = new FuncAliasDeclaration(ident, fd);
fa.visibility = visibility;
fa.parent = parent;
aliassym = fa;
return aliassym.overloadInsert(s);
}
if (auto td = sa.isTemplateDeclaration())
{
auto od = new OverDeclaration(ident, td.funcroot ? td.funcroot : td);
od.visibility = visibility;
od.parent = parent;
aliassym = od;
return aliassym.overloadInsert(s);
}
if (auto od = sa.isOverDeclaration())
{
if (sa.ident != ident || sa.parent != parent)
{
od = new OverDeclaration(ident, od);
od.visibility = visibility;
od.parent = parent;
aliassym = od;
}
return od.overloadInsert(s);
}
if (auto os = sa.isOverloadSet())
{
if (sa.ident != ident || sa.parent != parent)
{
os = new OverloadSet(ident, os);
// TODO: visibility is lost here b/c OverloadSets have no visibility attribute
// Might no be a practical issue, b/c the code below fails to resolve the overload anyhow.
// ----
// module os1;
// import a, b;
// private alias merged = foo; // private alias to overload set of a.foo and b.foo
// ----
// module os2;
// import a, b;
// public alias merged = bar; // public alias to overload set of a.bar and b.bar
// ----
// module bug;
// import os1, os2;
// void test() { merged(123); } // should only look at os2.merged
//
// os.visibility = visibility;
os.parent = parent;
aliassym = os;
}
os.push(s);
return true;
}
return false;
}
/* Don't know yet what the aliased symbol is, so assume it can
* be overloaded and check later for correctness.
*/
if (overnext)
return overnext.overloadInsert(s);
if (s is this)
return true;
overnext = s;
return true;
}
override const(char)* kind() const
{
return "alias";
}
override Type getType()
{
if (type)
return type;
return toAlias().getType();
}
override Dsymbol toAlias()
{
//printf("[%s] AliasDeclaration::toAlias('%s', this = %p, aliassym = %p, kind = '%s', inuse = %d)\n",
// loc.toChars(), toChars(), this, aliassym, aliassym ? aliassym.kind() : "", inuse);
assert(this != aliassym);
//static int count; if (++count == 10) *(char*)0=0;
// Reading the AliasDeclaration
if (!(adFlags & ignoreRead))
adFlags |= wasRead; // can never assign to this AliasDeclaration again
if (inuse == 1 && type && _scope)
{
inuse = 2;
uint olderrors = global.errors;
Dsymbol s = type.toDsymbol(_scope);
//printf("[%s] type = %s, s = %p, this = %p\n", loc.toChars(), type.toChars(), s, this);
if (global.errors != olderrors)
goto Lerr;
if (s)
{
s = s.toAlias();
if (global.errors != olderrors)
goto Lerr;
aliassym = s;
inuse = 0;
}
else
{
Type t = type.typeSemantic(loc, _scope);
if (t.ty == Terror)
goto Lerr;
if (global.errors != olderrors)
goto Lerr;
//printf("t = %s\n", t.toChars());
inuse = 0;
}
}
if (inuse)
{
error("recursive alias declaration");
Lerr:
// Avoid breaking "recursive alias" state during errors gagged
if (global.gag)
return this;
aliassym = new AliasDeclaration(loc, ident, Type.terror);
type = Type.terror;
return aliassym;
}
if (semanticRun >= PASS.semanticdone)
{
// semantic is already done.
// Do not see aliassym !is null, because of lambda aliases.
// Do not see type.deco !is null, even so "alias T = const int;` needs
// semantic analysis to take the storage class `const` as type qualifier.
}
else
{
// stop AliasAssign tuple building
if (aliassym)
{
if (auto td = aliassym.isTupleDeclaration())
{
if (td.building)
{
td.building = false;
semanticRun = PASS.semanticdone;
return td;
}
}
}
if (_import && _import._scope)
{
/* If this is an internal alias for selective/renamed import,
* load the module first.
*/
_import.dsymbolSemantic(null);
}
if (_scope)
{
aliasSemantic(this, _scope);
}
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias() : this;
inuse = 0;
return s;
}
override Dsymbol toAlias2()
{
if (inuse)
{
error("recursive alias declaration");
return this;
}
inuse = 1;
Dsymbol s = aliassym ? aliassym.toAlias2() : this;
inuse = 0;
return s;
}
override bool isOverloadable() const
{
// assume overloadable until alias is resolved
return semanticRun < PASS.semanticdone ||
aliassym && aliassym.isOverloadable();
}
override inout(AliasDeclaration) isAliasDeclaration() inout
{
return this;
}
/** Returns: `true` if this instance was created to make a template parameter
visible in the scope of a template body, `false` otherwise */
extern (D) bool isAliasedTemplateParameter() const
{
return !!(storage_class & STC.templateparameter);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class OverDeclaration : Declaration
{
Dsymbol overnext; // next in overload list
Dsymbol aliassym;
extern (D) this(Identifier ident, Dsymbol s)
{
super(ident);
this.aliassym = s;
}
override const(char)* kind() const
{
return "overload alias"; // todo
}
override bool equals(const RootObject o) const
{
if (this == o)
return true;
auto s = isDsymbol(o);
if (!s)
return false;
if (auto od2 = s.isOverDeclaration())
return this.aliassym.equals(od2.aliassym);
return this.aliassym == s;
}
override bool overloadInsert(Dsymbol s)
{
//printf("OverDeclaration::overloadInsert('%s') aliassym = %p, overnext = %p\n", s.toChars(), aliassym, overnext);
if (overnext)
return overnext.overloadInsert(s);
if (s == this)
return true;
overnext = s;
return true;
}
override bool isOverloadable() const
{
return true;
}
Dsymbol isUnique()
{
Dsymbol result = null;
overloadApply(aliassym, (Dsymbol s)
{
if (result)
{
result = null;
return 1; // ambiguous, done
}
else
{
result = s;
return 0;
}
});
return result;
}
override inout(OverDeclaration) isOverDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class VarDeclaration : Declaration
{
Initializer _init;
FuncDeclarations nestedrefs; // referenced by these lexically nested functions
Dsymbol aliassym; // if redone as alias to another symbol
VarDeclaration lastVar; // Linked list of variables for goto-skips-init detection
Expression edtor; // if !=null, does the destruction of the variable
IntRange* range; // if !=null, the variable is known to be within the range
VarDeclarations* maybes; // maybeScope variables that are assigned to this maybeScope variable
uint endlinnum; // line number of end of scope that this var lives in
uint offset;
uint sequenceNumber; // order the variables are declared
structalign_t alignment;
// When interpreting, these point to the value (NULL if value not determinable)
// The index of this variable on the CTFE stack, AdrOnStackNone if not allocated
enum AdrOnStackNone = ~0u;
uint ctfeAdrOnStack;
// `bool` fields that are compacted into bit fields in a string mixin
private extern (D) static struct BitFields
{
bool isargptr; /// if parameter that _argptr points to
bool ctorinit; /// it has been initialized in a ctor
bool iscatchvar; /// this is the exception object variable in catch() clause
bool isowner; /// this is an Owner, despite it being `scope`
bool setInCtorOnly; /// field can only be set in a constructor, as it is const or immutable
/// It is a class that was allocated on the stack
///
/// This means the var is not rebindable once assigned,
/// and the destructor gets run when it goes out of scope
bool onstack;
bool overlapped; /// if it is a field and has overlapping
bool overlapUnsafe; /// if it is an overlapping field and the overlaps are unsafe
bool maybeScope; /// allow inferring 'scope' for this variable
bool doNotInferReturn; /// do not infer 'return' for this variable
bool isArgDtorVar; /// temporary created to handle scope destruction of a function argument
bool isCmacro; /// it is a C macro turned into a C declaration
}
import dmd.common.bitfields : generateBitFields;
mixin(generateBitFields!(BitFields, ushort));
byte canassign; // it can be assigned to
ubyte isdataseg; // private data for isDataseg 0 unset, 1 true, 2 false
final extern (D) this(const ref Loc loc, Type type, Identifier ident, Initializer _init, StorageClass storage_class = STC.undefined_)
in
{
assert(ident);
}
do
{
//printf("VarDeclaration('%s')\n", ident.toChars());
super(loc, ident);
debug
{
if (!type && !_init)
{
//printf("VarDeclaration('%s')\n", ident.toChars());
//*(char*)0=0;
}
}
assert(type || _init);
this.type = type;
this._init = _init;
ctfeAdrOnStack = AdrOnStackNone;
this.storage_class = storage_class;
}
static VarDeclaration create(const ref Loc loc, Type type, Identifier ident, Initializer _init, StorageClass storage_class = STC.undefined_)
{
return new VarDeclaration(loc, type, ident, _init, storage_class);
}
override VarDeclaration syntaxCopy(Dsymbol s)
{
//printf("VarDeclaration::syntaxCopy(%s)\n", toChars());
assert(!s);
auto v = new VarDeclaration(loc, type ? type.syntaxCopy() : null, ident, _init ? _init.syntaxCopy() : null, storage_class);
v.comment = comment;
return v;
}
override void setFieldOffset(AggregateDeclaration ad, ref FieldState fieldState, bool isunion)
{
//printf("VarDeclaration::setFieldOffset(ad = %s) %s\n", ad.toChars(), toChars());
if (aliassym)
{
// If this variable was really a tuple, set the offsets for the tuple fields
TupleDeclaration v2 = aliassym.isTupleDeclaration();
assert(v2);
v2.foreachVar((s) { s.setFieldOffset(ad, fieldState, isunion); });
return;
}
if (!isField())
return;
assert(!(storage_class & (STC.static_ | STC.extern_ | STC.parameter)));
//printf("+VarDeclaration::setFieldOffset(ad = %s) %s\n", ad.toChars(), toChars());
/* Fields that are tuples appear both as part of TupleDeclarations and
* as members. That means ignore them if they are already a field.
*/
if (offset)
{
// already a field
fieldState.offset = ad.structsize; // https://issues.dlang.org/show_bug.cgi?id=13613
return;
}
for (size_t i = 0; i < ad.fields.length; i++)
{
if (ad.fields[i] == this)
{
// already a field
fieldState.offset = ad.structsize; // https://issues.dlang.org/show_bug.cgi?id=13613
return;
}
}
// Check for forward referenced types which will fail the size() call
Type t = type.toBasetype();
if (storage_class & STC.ref_)
{
// References are the size of a pointer
t = Type.tvoidptr;
}
Type tv = t.baseElemOf();
if (tv.ty == Tstruct)
{
auto ts = cast(TypeStruct)tv;
assert(ts.sym != ad); // already checked in ad.determineFields()
if (!ts.sym.determineSize(loc))
{
type = Type.terror;
errors = true;
return;
}
}
// List in ad.fields. Even if the type is error, it's necessary to avoid
// pointless error diagnostic "more initializers than fields" on struct literal.
ad.fields.push(this);
if (t.ty == Terror)
return;
/* If coming after a bit field in progress,
* advance past the field
*/
fieldState.inFlight = false;
const sz = t.size(loc);
assert(sz != SIZE_INVALID && sz < uint.max);
uint memsize = cast(uint)sz; // size of member
uint memalignsize = target.fieldalign(t); // size of member for alignment purposes
offset = AggregateDeclaration.placeField(
&fieldState.offset,
memsize, memalignsize, alignment,
&ad.structsize, &ad.alignsize,
isunion);
//printf("\t%s: memalignsize = %d\n", toChars(), memalignsize);
//printf(" addField '%s' to '%s' at offset %d, size = %d\n", toChars(), ad.toChars(), offset, memsize);
}
override const(char)* kind() const
{
return "variable";
}
override final inout(AggregateDeclaration) isThis() inout
{
if (!(storage_class & (STC.static_ | STC.extern_ | STC.manifest | STC.templateparameter | STC.gshared | STC.ctfe)))
{
/* The casting is necessary because `s = s.parent` is otherwise rejected
*/
for (auto s = cast(Dsymbol)this; s; s = s.parent)
{
auto ad = (cast(inout)s).isMember();
if (ad)
return ad;
if (!s.parent || !s.parent.isTemplateMixin())
break;
}
}
return null;
}
override final bool needThis()
{
//printf("VarDeclaration::needThis(%s, x%x)\n", toChars(), storage_class);
return isField();
}
override final bool isExport() const
{
return visibility.kind == Visibility.Kind.export_;
}
override final bool isImportedSymbol() const
{
if (visibility.kind == Visibility.Kind.export_ && !_init && (storage_class & STC.static_ || parent.isModule()))
return true;
return false;
}
final bool isCtorinit() const pure nothrow @nogc @safe
{
return setInCtorOnly;
}
/*******************************
* Does symbol go into data segment?
* Includes extern variables.
*/
override final bool isDataseg()
{
version (none)
{
printf("VarDeclaration::isDataseg(%p, '%s')\n", this, toChars());
printf("%llx, isModule: %p, isTemplateInstance: %p, isNspace: %p\n",
storage_class & (STC.static_ | STC.const_), parent.isModule(), parent.isTemplateInstance(), parent.isNspace());
printf("parent = '%s'\n", parent.toChars());
}
if (isdataseg == 0) // the value is not cached
{
isdataseg = 2; // The Variables does not go into the datasegment
if (!canTakeAddressOf())
{
return false;
}
Dsymbol parent = toParent();
if (!parent && !(storage_class & STC.static_))
{
error("forward referenced");
type = Type.terror;
}
else if (storage_class & (STC.static_ | STC.extern_ | STC.gshared) ||
parent.isModule() || parent.isTemplateInstance() || parent.isNspace())
{
assert(!isParameter() && !isResult());
isdataseg = 1; // It is in the DataSegment
}
}
return (isdataseg == 1);
}
/************************************
* Does symbol go into thread local storage?
*/
override final bool isThreadlocal()
{
//printf("VarDeclaration::isThreadlocal(%p, '%s')\n", this, toChars());
/* Data defaults to being thread-local. It is not thread-local
* if it is immutable, const or shared.
*/
bool i = isDataseg() && !(storage_class & (STC.immutable_ | STC.const_ | STC.shared_ | STC.gshared));
//printf("\treturn %d\n", i);
return i;
}
/********************************************
* Can variable be read and written by CTFE?
*/
final bool isCTFE()
{
return (storage_class & STC.ctfe) != 0; // || !isDataseg();
}
final bool isOverlappedWith(VarDeclaration v)
{
const vsz = v.type.size();
const tsz = type.size();
assert(vsz != SIZE_INVALID && tsz != SIZE_INVALID);
// Overlap is checked by comparing bit offsets
auto bitoffset = offset * 8;
auto vbitoffset = v.offset * 8;
// Bitsize of types are overridden by any bit-field widths.
ulong tbitsize = void;
if (auto bf = isBitFieldDeclaration())
{
bitoffset += bf.bitOffset;
tbitsize = bf.fieldWidth;
}
else
tbitsize = tsz * 8;
ulong vbitsize = void;
if (auto vbf = v.isBitFieldDeclaration())
{
vbitoffset += vbf.bitOffset;
vbitsize = vbf.fieldWidth;
}
else
vbitsize = vsz * 8;
return bitoffset < vbitoffset + vbitsize &&
vbitoffset < bitoffset + tbitsize;
}
override final bool hasPointers()
{
//printf("VarDeclaration::hasPointers() %s, ty = %d\n", toChars(), type.ty);
return (!isDataseg() && type.hasPointers());
}
/*************************************
* Return true if we can take the address of this variable.
*/
final bool canTakeAddressOf()
{
return !(storage_class & STC.manifest);
}
/******************************************
* Return true if variable needs to call the destructor.
*/
final bool needsScopeDtor()
{
//printf("VarDeclaration::needsScopeDtor() %s\n", toChars());
return edtor && !(storage_class & STC.nodtor);
}
/******************************************
* If a variable has a scope destructor call, return call for it.
* Otherwise, return NULL.
*/
extern (D) final Expression callScopeDtor(Scope* sc)
{
//printf("VarDeclaration::callScopeDtor() %s\n", toChars());
// Destruction of STC.field's is handled by buildDtor()
if (storage_class & (STC.nodtor | STC.ref_ | STC.out_ | STC.field))
{
return null;
}
if (iscatchvar)
return null; // destructor is built by `void semantic(Catch c, Scope* sc)`, not here
Expression e = null;
// Destructors for structs and arrays of structs
Type tv = type.baseElemOf();
if (tv.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)tv).sym;
if (!sd.dtor || sd.errors)
return null;
const sz = type.size();
assert(sz != SIZE_INVALID);
if (!sz)
return null;
if (type.toBasetype().ty == Tstruct)
{
// v.__xdtor()
e = new VarExp(loc, this);
/* This is a hack so we can call destructors on const/immutable objects.
* Need to add things like "const ~this()" and "immutable ~this()" to
* fix properly.
*/
e.type = e.type.mutableOf();
// Enable calling destructors on shared objects.
// The destructor is always a single, non-overloaded function,
// and must serve both shared and non-shared objects.
e.type = e.type.unSharedOf;
e = new DotVarExp(loc, e, sd.dtor, false);
e = new CallExp(loc, e);
}
else
{
// __ArrayDtor(v[0 .. n])
e = new VarExp(loc, this);
const sdsz = sd.type.size();
assert(sdsz != SIZE_INVALID && sdsz != 0);
const n = sz / sdsz;
SliceExp se = new SliceExp(loc, e, new IntegerExp(loc, 0, Type.tsize_t),
new IntegerExp(loc, n, Type.tsize_t));
// Prevent redundant bounds check
se.upperIsInBounds = true;
se.lowerIsLessThanUpper = true;
// This is a hack so we can call destructors on const/immutable objects.
se.type = sd.type.arrayOf();
e = new CallExp(loc, new IdentifierExp(loc, Id.__ArrayDtor), se);
}
return e;
}
// Destructors for classes
if (storage_class & (STC.auto_ | STC.scope_) && !(storage_class & STC.parameter))
{
for (ClassDeclaration cd = type.isClassHandle(); cd; cd = cd.baseClass)
{
/* We can do better if there's a way with onstack
* classes to determine if there's no way the monitor
* could be set.
*/
//if (cd.isInterfaceDeclaration())
// error("interface `%s` cannot be scope", cd.toChars());
if (onstack) // if any destructors
{
// delete'ing C++ classes crashes (and delete is deprecated anyway)
if (cd.classKind == ClassKind.cpp)
{
// Don't call non-existant dtor
if (!cd.dtor)
break;
e = new VarExp(loc, this);
e.type = e.type.mutableOf().unSharedOf(); // Hack for mutable ctor on immutable instances
e = new DotVarExp(loc, e, cd.dtor, false);
e = new CallExp(loc, e);
break;
}
// delete this;
Expression ec;
ec = new VarExp(loc, this);
e = new DeleteExp(loc, ec, true);
e.type = Type.tvoid;
break;
}
}
}
return e;
}
/*******************************************
* If variable has a constant expression initializer, get it.
* Otherwise, return null.
*/
extern (D) final Expression getConstInitializer(bool needFullType = true)
{
assert(type && _init);
// Ungag errors when not speculative
uint oldgag = global.gag;
if (global.gag)
{
Dsymbol sym = isMember();
if (sym && !sym.isSpeculative())
global.gag = 0;
}
if (_scope)
{
inuse++;
_init = _init.initializerSemantic(_scope, type, INITinterpret);
_scope = null;
inuse--;
}
Expression e = _init.initializerToExpression(needFullType ? type : null);
global.gag = oldgag;
return e;
}
/*******************************************
* Helper function for the expansion of manifest constant.
*/
extern (D) final Expression expandInitializer(Loc loc)
{
assert((storage_class & STC.manifest) && _init);
auto e = getConstInitializer();
if (!e)
{
.error(loc, "cannot make expression out of initializer for `%s`", toChars());
return ErrorExp.get();
}
e = e.copy();
e.loc = loc; // for better error message
return e;
}
override final void checkCtorConstInit()
{
version (none)
{
/* doesn't work if more than one static ctor */
if (ctorinit == 0 && isCtorinit() && !isField())
error("missing initializer in static constructor for const variable");
}
}
/************************************
* Check to see if this variable is actually in an enclosing function
* rather than the current one.
* Update nestedrefs[], closureVars[] and outerVars[].
* Returns: true if error occurs.
*/
extern (D) final bool checkNestedReference(Scope* sc, Loc loc)
{
//printf("VarDeclaration::checkNestedReference() %s\n", toChars());
if (sc.intypeof == 1 || (sc.flags & SCOPE.ctfe))
return false;
if (!parent || parent == sc.parent)
return false;
if (isDataseg() || (storage_class & STC.manifest))
return false;
// The current function
FuncDeclaration fdthis = sc.parent.isFuncDeclaration();
if (!fdthis)
return false; // out of function scope
Dsymbol p = toParent2();
// Function literals from fdthis to p must be delegates
ensureStaticLinkTo(fdthis, p);
// The function that this variable is in
FuncDeclaration fdv = p.isFuncDeclaration();
if (!fdv || fdv == fdthis)
return false;
// Add fdthis to nestedrefs[] if not already there
if (!nestedrefs.contains(fdthis))
nestedrefs.push(fdthis);
//printf("\tfdv = %s\n", fdv.toChars());
//printf("\tfdthis = %s\n", fdthis.toChars());
if (loc.isValid())
{
if (fdthis.getLevelAndCheck(loc, sc, fdv, this) == fdthis.LevelError)
return true;
}
// Add this VarDeclaration to fdv.closureVars[] if not already there
if (!sc.intypeof && !(sc.flags & SCOPE.compile) &&
// https://issues.dlang.org/show_bug.cgi?id=17605
(fdv.isCompileTimeOnly || !fdthis.isCompileTimeOnly)
)
{
if (!fdv.closureVars.contains(this))
fdv.closureVars.push(this);
}
if (!fdthis.outerVars.contains(this))
fdthis.outerVars.push(this);
//printf("fdthis is %s\n", fdthis.toChars());
//printf("var %s in function %s is nested ref\n", toChars(), fdv.toChars());
// __dollar creates problems because it isn't a real variable
// https://issues.dlang.org/show_bug.cgi?id=3326
if (ident == Id.dollar)
{
.error(loc, "cannnot use `$` inside a function literal");
return true;
}
if (ident == Id.withSym) // https://issues.dlang.org/show_bug.cgi?id=1759
{
ExpInitializer ez = _init.isExpInitializer();
assert(ez);
Expression e = ez.exp;
if (e.op == EXP.construct || e.op == EXP.blit)
e = (cast(AssignExp)e).e2;
return lambdaCheckForNestedRef(e, sc);
}
return false;
}
override final Dsymbol toAlias()
{
//printf("VarDeclaration::toAlias('%s', this = %p, aliassym = %p)\n", toChars(), this, aliassym);
if ((!type || !type.deco) && _scope)
dsymbolSemantic(this, _scope);
assert(this != aliassym);
Dsymbol s = aliassym ? aliassym.toAlias() : this;
return s;
}
// Eliminate need for dynamic_cast
override final inout(VarDeclaration) isVarDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/*******************************************************
* C11 6.7.2.1-4 bit fields
*/
extern (C++) class BitFieldDeclaration : VarDeclaration
{
Expression width;
uint fieldWidth;
uint bitOffset;
final extern (D) this(const ref Loc loc, Type type, Identifier ident, Expression width)
{
super(loc, type, ident, null);
this.width = width;
this.storage_class |= STC.field;
}
override BitFieldDeclaration syntaxCopy(Dsymbol s)
{
//printf("BitFieldDeclaration::syntaxCopy(%s)\n", toChars());
assert(!s);
auto bf = new BitFieldDeclaration(loc, type ? type.syntaxCopy() : null, ident, width.syntaxCopy());
bf.comment = comment;
return bf;
}
override final inout(BitFieldDeclaration) isBitFieldDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
/***********************************
* Retrieve the .min or .max values.
* Only valid after semantic analysis.
* Params:
* id = Id.min or Id.max
* Returns:
* the min or max value
*/
final ulong getMinMax(Identifier id)
{
const width = fieldWidth;
const uns = type.isunsigned();
const min = id == Id.min;
ulong v;
assert(width != 0); // should have been rejected in semantic pass
if (width == ulong.sizeof * 8)
v = uns ? (min ? ulong.min : ulong.max)
: (min ? long.min : long.max);
else
v = uns ? (min ? 0
: (1L << width) - 1)
: (min ? -(1L << (width - 1))
: (1L << (width - 1)) - 1);
return v;
}
override final void setFieldOffset(AggregateDeclaration ad, ref FieldState fieldState, bool isunion)
{
enum log = false;
static if (log)
{
printf("BitFieldDeclaration::setFieldOffset(ad: %s, field: %s)\n", ad.toChars(), toChars());
void print(const ref FieldState fieldState)
{
printf("FieldState.offset = %d bytes\n", fieldState.offset);
printf(" .fieldOffset = %d bytes\n", fieldState.fieldOffset);
printf(" .bitOffset = %d bits\n", fieldState.bitOffset);
printf(" .fieldSize = %d bytes\n", fieldState.fieldSize);
printf(" .inFlight = %d\n", fieldState.inFlight);
printf(" fieldWidth = %d bits\n", fieldWidth);
}
print(fieldState);
}
Type t = type.toBasetype();
const bool anon = isAnonymous();
// List in ad.fields. Even if the type is error, it's necessary to avoid
// pointless error diagnostic "more initializers than fields" on struct literal.
if (!anon)
ad.fields.push(this);
if (t.ty == Terror)
return;
const sz = t.size(loc);
assert(sz != SIZE_INVALID && sz < uint.max);
uint memsize = cast(uint)sz; // size of member
uint memalignsize = target.fieldalign(t); // size of member for alignment purposes
if (log) printf(" memsize: %u memalignsize: %u\n", memsize, memalignsize);
if (fieldWidth == 0 && !anon)
error(loc, "named bit fields cannot have 0 width");
if (fieldWidth > memsize * 8)
error(loc, "bit field width %d is larger than type", fieldWidth);
const style = target.c.bitFieldStyle;
void startNewField()
{
if (log) printf("startNewField()\n");
uint alignsize;
if (style == TargetC.BitFieldStyle.Gcc_Clang)
{
if (fieldWidth > 32)
alignsize = memalignsize;
else if (fieldWidth > 16)
alignsize = 4;
else if (fieldWidth > 8)
alignsize = 2;
else
alignsize = 1;
}
else
alignsize = memsize; // not memalignsize
uint dummy;
offset = AggregateDeclaration.placeField(
&fieldState.offset,
memsize, alignsize, alignment,
&ad.structsize,
(anon && style == TargetC.BitFieldStyle.Gcc_Clang) ? &dummy : &ad.alignsize,
isunion);
fieldState.inFlight = true;
fieldState.fieldOffset = offset;
fieldState.bitOffset = 0;
fieldState.fieldSize = memsize;
}
if (style == TargetC.BitFieldStyle.Gcc_Clang)
{
if (fieldWidth == 0)
{
if (!isunion)
{
// Use type of zero width field to align to next field
fieldState.offset = (fieldState.offset + memalignsize - 1) & ~(memalignsize - 1);
ad.structsize = fieldState.offset;
}
fieldState.inFlight = false;
return;
}
if (ad.alignsize == 0)
ad.alignsize = 1;
if (!anon &&
ad.alignsize < memalignsize)
ad.alignsize = memalignsize;
}
else if (style == TargetC.BitFieldStyle.MS)
{
if (ad.alignsize == 0)
ad.alignsize = 1;
if (fieldWidth == 0)
{
if (fieldState.inFlight && !isunion)
{
// documentation says align to next int
//const alsz = cast(uint)Type.tint32.size();
const alsz = memsize; // but it really does this
fieldState.offset = (fieldState.offset + alsz - 1) & ~(alsz - 1);
ad.structsize = fieldState.offset;
}
fieldState.inFlight = false;
return;
}
}
else if (style == TargetC.BitFieldStyle.DM)
{
if (anon && fieldWidth && (!fieldState.inFlight || fieldState.bitOffset == 0))
return; // this probably should be a bug in DMC
if (ad.alignsize == 0)
ad.alignsize = 1;
if (fieldWidth == 0)
{
if (fieldState.inFlight && !isunion)
{
const alsz = memsize;
fieldState.offset = (fieldState.offset + alsz - 1) & ~(alsz - 1);
ad.structsize = fieldState.offset;
}
fieldState.inFlight = false;
return;
}
}
if (!fieldState.inFlight)
{
//printf("not in flight\n");
startNewField();
}
else if (style == TargetC.BitFieldStyle.Gcc_Clang)
{
// If the bit-field spans more units of alignment than its type,
// start a new field at the next alignment boundary.
if (fieldState.bitOffset == fieldState.fieldSize * 8)
startNewField(); // the bit field is full
else
{
// if alignment boundary is crossed
uint start = fieldState.fieldOffset * 8 + fieldState.bitOffset;
uint end = start + fieldWidth;
//printf("%s start: %d end: %d memalignsize: %d\n", ad.toChars(), start, end, memalignsize);
if (start / (memalignsize * 8) != (end - 1) / (memalignsize * 8))
{
//printf("alignment is crossed\n");
startNewField();
}
}
}
else if (style == TargetC.BitFieldStyle.DM ||
style == TargetC.BitFieldStyle.MS)
{
if (memsize != fieldState.fieldSize ||
fieldState.bitOffset + fieldWidth > fieldState.fieldSize * 8)
{
//printf("new field\n");
startNewField();
}
}
else
assert(0);
offset = fieldState.fieldOffset;
bitOffset = fieldState.bitOffset;
const pastField = bitOffset + fieldWidth;
if (style == TargetC.BitFieldStyle.Gcc_Clang)
{
auto size = (pastField + 7) / 8;
fieldState.fieldSize = size;
//printf(" offset: %d, size: %d\n", offset, size);
ad.structsize = offset + size;
}
else
fieldState.fieldSize = memsize;
//printf("at end: ad.structsize = %d\n", cast(int)ad.structsize);
//print(fieldState);
if (!isunion)
{
fieldState.offset = offset + fieldState.fieldSize;
fieldState.bitOffset = pastField;
}
//printf("\t%s: memalignsize = %d\n", toChars(), memalignsize);
//printf(" addField '%s' to '%s' at offset %d, size = %d\n", toChars(), ad.toChars(), offset, memsize);
}
}
/***********************************************************
* This is a shell around a back end symbol
*/
extern (C++) final class SymbolDeclaration : Declaration
{
AggregateDeclaration dsym;
extern (D) this(const ref Loc loc, AggregateDeclaration dsym)
{
super(loc, dsym.ident);
this.dsym = dsym;
storage_class |= STC.const_;
}
// Eliminate need for dynamic_cast
override inout(SymbolDeclaration) isSymbolDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) class TypeInfoDeclaration : VarDeclaration
{
Type tinfo;
final extern (D) this(Type tinfo)
{
super(Loc.initial, Type.dtypeinfo.type, tinfo.getTypeInfoIdent(), null);
this.tinfo = tinfo;
storage_class = STC.static_ | STC.gshared;
visibility = Visibility(Visibility.Kind.public_);
_linkage = LINK.c;
alignment.set(target.ptrsize);
}
static TypeInfoDeclaration create(Type tinfo)
{
return new TypeInfoDeclaration(tinfo);
}
override final TypeInfoDeclaration syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override final const(char)* toChars() const
{
//printf("TypeInfoDeclaration::toChars() tinfo = %s\n", tinfo.toChars());
OutBuffer buf;
buf.writestring("typeid(");
buf.writestring(tinfo.toChars());
buf.writeByte(')');
return buf.extractChars();
}
override final inout(TypeInfoDeclaration) isTypeInfoDeclaration() inout @nogc nothrow pure @safe
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStructDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfostruct)
{
ObjectNotFound(Id.TypeInfo_Struct);
}
type = Type.typeinfostruct.type;
}
static TypeInfoStructDeclaration create(Type tinfo)
{
return new TypeInfoStructDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoClassDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoclass)
{
ObjectNotFound(Id.TypeInfo_Class);
}
type = Type.typeinfoclass.type;
}
static TypeInfoClassDeclaration create(Type tinfo)
{
return new TypeInfoClassDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInterfaceDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfointerface)
{
ObjectNotFound(Id.TypeInfo_Interface);
}
type = Type.typeinfointerface.type;
}
static TypeInfoInterfaceDeclaration create(Type tinfo)
{
return new TypeInfoInterfaceDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoPointerDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfopointer)
{
ObjectNotFound(Id.TypeInfo_Pointer);
}
type = Type.typeinfopointer.type;
}
static TypeInfoPointerDeclaration create(Type tinfo)
{
return new TypeInfoPointerDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoarray)
{
ObjectNotFound(Id.TypeInfo_Array);
}
type = Type.typeinfoarray.type;
}
static TypeInfoArrayDeclaration create(Type tinfo)
{
return new TypeInfoArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfostaticarray)
{
ObjectNotFound(Id.TypeInfo_StaticArray);
}
type = Type.typeinfostaticarray.type;
}
static TypeInfoStaticArrayDeclaration create(Type tinfo)
{
return new TypeInfoStaticArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoassociativearray)
{
ObjectNotFound(Id.TypeInfo_AssociativeArray);
}
type = Type.typeinfoassociativearray.type;
}
static TypeInfoAssociativeArrayDeclaration create(Type tinfo)
{
return new TypeInfoAssociativeArrayDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoEnumDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoenum)
{
ObjectNotFound(Id.TypeInfo_Enum);
}
type = Type.typeinfoenum.type;
}
static TypeInfoEnumDeclaration create(Type tinfo)
{
return new TypeInfoEnumDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoFunctionDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfofunction)
{
ObjectNotFound(Id.TypeInfo_Function);
}
type = Type.typeinfofunction.type;
}
static TypeInfoFunctionDeclaration create(Type tinfo)
{
return new TypeInfoFunctionDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoDelegateDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfodelegate)
{
ObjectNotFound(Id.TypeInfo_Delegate);
}
type = Type.typeinfodelegate.type;
}
static TypeInfoDelegateDeclaration create(Type tinfo)
{
return new TypeInfoDelegateDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoTupleDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfotypelist)
{
ObjectNotFound(Id.TypeInfo_Tuple);
}
type = Type.typeinfotypelist.type;
}
static TypeInfoTupleDeclaration create(Type tinfo)
{
return new TypeInfoTupleDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoConstDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoconst)
{
ObjectNotFound(Id.TypeInfo_Const);
}
type = Type.typeinfoconst.type;
}
static TypeInfoConstDeclaration create(Type tinfo)
{
return new TypeInfoConstDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoInvariantDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoinvariant)
{
ObjectNotFound(Id.TypeInfo_Invariant);
}
type = Type.typeinfoinvariant.type;
}
static TypeInfoInvariantDeclaration create(Type tinfo)
{
return new TypeInfoInvariantDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoSharedDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfoshared)
{
ObjectNotFound(Id.TypeInfo_Shared);
}
type = Type.typeinfoshared.type;
}
static TypeInfoSharedDeclaration create(Type tinfo)
{
return new TypeInfoSharedDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoWildDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfowild)
{
ObjectNotFound(Id.TypeInfo_Wild);
}
type = Type.typeinfowild.type;
}
static TypeInfoWildDeclaration create(Type tinfo)
{
return new TypeInfoWildDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeInfoVectorDeclaration : TypeInfoDeclaration
{
extern (D) this(Type tinfo)
{
super(tinfo);
if (!Type.typeinfovector)
{
ObjectNotFound(Id.TypeInfo_Vector);
}
type = Type.typeinfovector.type;
}
static TypeInfoVectorDeclaration create(Type tinfo)
{
return new TypeInfoVectorDeclaration(tinfo);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* For the "this" parameter to member functions
*/
extern (C++) final class ThisDeclaration : VarDeclaration
{
extern (D) this(const ref Loc loc, Type t)
{
super(loc, t, Id.This, null);
storage_class |= STC.nodtor;
}
override ThisDeclaration syntaxCopy(Dsymbol s)
{
assert(0); // should never be produced by syntax
}
override inout(ThisDeclaration) isThisDeclaration() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
|
D
|
/**
* ...
*
* Copyright: Copyright Benjamin Thaut 2010 - 2011.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Benjamin Thaut, Sean Kelly
* Source: $(DRUNTIMESRC core/sys/windows/_stacktrace.d)
*/
module core.sys.windows.dbghelp;
version (Windows):
import core.sys.windows.windows;
public import core.sys.windows.dbghelp_types;
extern(System)
{
alias BOOL function(HANDLE hProcess, DWORD64 lpBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead) ReadProcessMemoryProc64;
alias PVOID function(HANDLE hProcess, DWORD64 AddrBase) FunctionTableAccessProc64;
alias DWORD64 function(HANDLE hProcess, DWORD64 Address) GetModuleBaseProc64;
alias DWORD64 function(HANDLE hProcess, HANDLE hThread, ADDRESS64 *lpaddr) TranslateAddressProc64;
alias BOOL function(HANDLE hProcess, PCSTR UserSearchPath, bool fInvadeProcess) SymInitializeFunc;
alias BOOL function(HANDLE hProcess) SymCleanupFunc;
alias DWORD function(DWORD SymOptions) SymSetOptionsFunc;
alias DWORD function() SymGetOptionsFunc;
alias PVOID function(HANDLE hProcess, DWORD64 AddrBase) SymFunctionTableAccess64Func;
alias BOOL function(DWORD MachineType, HANDLE hProcess, HANDLE hThread, STACKFRAME64 *StackFrame, PVOID ContextRecord,
ReadProcessMemoryProc64 ReadMemoryRoutine, FunctionTableAccessProc64 FunctoinTableAccess,
GetModuleBaseProc64 GetModuleBaseRoutine, TranslateAddressProc64 TranslateAddress) StackWalk64Func;
alias BOOL function(HANDLE hProcess, DWORD64 dwAddr, PDWORD pdwDisplacement, IMAGEHLP_LINEA64 *line) SymGetLineFromAddr64Func;
alias DWORD64 function(HANDLE hProcess, DWORD64 dwAddr) SymGetModuleBase64Func;
alias BOOL function(HANDLE hProcess, DWORD64 dwAddr, IMAGEHLP_MODULEA64 *ModuleInfo) SymGetModuleInfo64Func;
alias BOOL function(HANDLE hProcess, DWORD64 Address, DWORD64 *Displacement, IMAGEHLP_SYMBOLA64 *Symbol) SymGetSymFromAddr64Func;
alias DWORD function(PCTSTR DecoratedName, PTSTR UnDecoratedName, DWORD UndecoratedLength, DWORD Flags) UnDecorateSymbolNameFunc;
alias DWORD64 function(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll) SymLoadModule64Func;
alias BOOL function(HANDLE HProcess, PTSTR SearchPath, DWORD SearchPathLength) SymGetSearchPathFunc;
alias BOOL function(HANDLE hProcess, DWORD64 Address) SymUnloadModule64Func;
alias BOOL function(HANDLE hProcess, ULONG ActionCode, ulong CallbackContext, ulong UserContext) PSYMBOL_REGISTERED_CALLBACK64;
alias BOOL function(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, ulong UserContext) SymRegisterCallback64Func;
alias API_VERSION* function() ImagehlpApiVersionFunc;
}
struct DbgHelp
{
SymInitializeFunc SymInitialize;
SymCleanupFunc SymCleanup;
StackWalk64Func StackWalk64;
SymGetOptionsFunc SymGetOptions;
SymSetOptionsFunc SymSetOptions;
SymFunctionTableAccess64Func SymFunctionTableAccess64;
SymGetLineFromAddr64Func SymGetLineFromAddr64;
SymGetModuleBase64Func SymGetModuleBase64;
SymGetModuleInfo64Func SymGetModuleInfo64;
SymGetSymFromAddr64Func SymGetSymFromAddr64;
UnDecorateSymbolNameFunc UnDecorateSymbolName;
SymLoadModule64Func SymLoadModule64;
SymGetSearchPathFunc SymGetSearchPath;
SymUnloadModule64Func SymUnloadModule64;
SymRegisterCallback64Func SymRegisterCallback64;
ImagehlpApiVersionFunc ImagehlpApiVersion;
static DbgHelp* get()
{
if( sm_hndl != sm_hndl.init )
return &sm_inst;
if( (sm_hndl = LoadLibraryA( "dbghelp.dll" )) != sm_hndl.init )
{
sm_inst.SymInitialize = cast(SymInitializeFunc) GetProcAddress(sm_hndl,"SymInitialize");
sm_inst.SymCleanup = cast(SymCleanupFunc) GetProcAddress(sm_hndl,"SymCleanup");
sm_inst.StackWalk64 = cast(StackWalk64Func) GetProcAddress(sm_hndl,"StackWalk64");
sm_inst.SymGetOptions = cast(SymGetOptionsFunc) GetProcAddress(sm_hndl,"SymGetOptions");
sm_inst.SymSetOptions = cast(SymSetOptionsFunc) GetProcAddress(sm_hndl,"SymSetOptions");
sm_inst.SymFunctionTableAccess64 = cast(SymFunctionTableAccess64Func) GetProcAddress(sm_hndl,"SymFunctionTableAccess64");
sm_inst.SymGetLineFromAddr64 = cast(SymGetLineFromAddr64Func) GetProcAddress(sm_hndl,"SymGetLineFromAddr64");
sm_inst.SymGetModuleBase64 = cast(SymGetModuleBase64Func) GetProcAddress(sm_hndl,"SymGetModuleBase64");
sm_inst.SymGetModuleInfo64 = cast(SymGetModuleInfo64Func) GetProcAddress(sm_hndl,"SymGetModuleInfo64");
sm_inst.SymGetSymFromAddr64 = cast(SymGetSymFromAddr64Func) GetProcAddress(sm_hndl,"SymGetSymFromAddr64");
sm_inst.SymLoadModule64 = cast(SymLoadModule64Func) GetProcAddress(sm_hndl,"SymLoadModule64");
sm_inst.SymGetSearchPath = cast(SymGetSearchPathFunc) GetProcAddress(sm_hndl,"SymGetSearchPath");
sm_inst.SymUnloadModule64 = cast(SymUnloadModule64Func) GetProcAddress(sm_hndl,"SymUnloadModule64");
sm_inst.SymRegisterCallback64 = cast(SymRegisterCallback64Func) GetProcAddress(sm_hndl, "SymRegisterCallback64");
sm_inst.ImagehlpApiVersion = cast(ImagehlpApiVersionFunc) GetProcAddress(sm_hndl, "ImagehlpApiVersion");
assert( sm_inst.SymInitialize && sm_inst.SymCleanup && sm_inst.StackWalk64 && sm_inst.SymGetOptions &&
sm_inst.SymSetOptions && sm_inst.SymFunctionTableAccess64 && sm_inst.SymGetLineFromAddr64 &&
sm_inst.SymGetModuleBase64 && sm_inst.SymGetModuleInfo64 && sm_inst.SymGetSymFromAddr64 &&
sm_inst.SymLoadModule64 && sm_inst.SymGetSearchPath && sm_inst.SymUnloadModule64 &&
sm_inst.SymRegisterCallback64 && sm_inst.ImagehlpApiVersion);
return &sm_inst;
}
return null;
}
shared static ~this()
{
if( sm_hndl != sm_hndl.init )
FreeLibrary( sm_hndl );
}
private:
__gshared DbgHelp sm_inst;
__gshared HANDLE sm_hndl;
}
|
D
|
#!/usr/bin/rdmd
import core.thread, std.process;
void main()
{
while(true)
{
Thread.sleep(30.seconds);
executeShell("make cbs");
}
}
|
D
|
/home/liyun/clink/clink_mpc/target/debug/build/num-traits-816149f342a68063/build_script_build-816149f342a68063: /home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/num-traits-0.2.14/build.rs
/home/liyun/clink/clink_mpc/target/debug/build/num-traits-816149f342a68063/build_script_build-816149f342a68063.d: /home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/num-traits-0.2.14/build.rs
/home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/num-traits-0.2.14/build.rs:
|
D
|
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/Objects-normal/arm64/Walker.o : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Version.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSRange+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Comparison.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSDate+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/UnsafeBufferPointers.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PriorityQueue.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BlockValueTransformer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Threading.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Bases.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BitRange.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/TestingPublisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Dispatch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Heap.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DataScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/MapTable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Box.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Atomic.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Hexdump.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Path.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errors.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSMapTable+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DispatchData.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Foundation.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/InternalUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Walker.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PureUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Timestamp.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Publisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Math.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Endianness.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/RegularExpression.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errno.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Result.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Data+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AStarSearch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSURL+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Collections+Misc.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/CRC16.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BufferType.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Search.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Benchmark.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AssociatedObjectHelper.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Observable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/Objects-normal/arm64/Walker~partial.swiftmodule : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Version.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSRange+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Comparison.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSDate+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/UnsafeBufferPointers.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PriorityQueue.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BlockValueTransformer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Threading.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Bases.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BitRange.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/TestingPublisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Dispatch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Heap.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DataScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/MapTable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Box.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Atomic.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Hexdump.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Path.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errors.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSMapTable+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DispatchData.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Foundation.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/InternalUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Walker.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PureUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Timestamp.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Publisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Math.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Endianness.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/RegularExpression.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errno.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Result.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Data+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AStarSearch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSURL+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Collections+Misc.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/CRC16.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BufferType.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Search.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Benchmark.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AssociatedObjectHelper.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Observable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule
/users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/Objects-normal/arm64/Walker~partial.swiftdoc : /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Version.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSRange+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Comparison.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSDate+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/UnsafeBufferPointers.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PriorityQueue.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BlockValueTransformer.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Threading.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Bases.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BitRange.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/TestingPublisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Dispatch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Heap.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DataScanner.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/MapTable.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Box.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Atomic.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Hexdump.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Path.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errors.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSMapTable+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/DispatchData.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/String+Foundation.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/InternalUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Walker.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/PureUtilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Timestamp.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Publisher.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Math.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Endianness.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/RegularExpression.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Errno.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Result.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Utilities.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Data+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AStarSearch.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/NSURL+Extensions.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Collections+Misc.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/CRC16.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/BufferType.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Search.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Benchmark.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/AssociatedObjectHelper.swift /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/Observable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /users/tommy-b-10/Desktop/SidePilotApp/Modules/module.map /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Source/SwiftUtilities.h /users/tommy-b-10/Desktop/SidePilotApp/Carthage/Checkouts/SwiftUtilities/Build/Intermediates/SwiftUtilities.build/Debug-iphoneos/SwiftUtilities_iOS.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/SwiftOnoneSupport.swiftmodule
|
D
|
import std;
alias gcov_unsigned_t = Typedef!uint32_t;
alias gcov_position_t = Typedef!uint32_t;
//MAGIC
enum uint32_t GCOV_NOTE_MAGIC = 0x67636461; //gcno
enum uint32_t GCOV_DATA_MAGIC = 0x67636e6f; //gcda
enum uint32_t SUMMARY_MAGIC = 0x456d696c;
//TAGS
enum uint32_t GCOV_TAG_PROGRAM_SUMMARY = 0xa3000000;
//enum uint32_t GCOV_TAG_SUMMARY_LENGTH(NUM) \ (1 + GCOV_COUNTERS_SUMMABLE * (10 + 3 * 2) + (NUM) * 5)
enum uint32_t GCOV_TAG_FUNCTION = 0x01000000;
enum uint32_t GCOV_TAG_BLOCKS = 0x01410000;
enum uint32_t GCOV_TAG_LINES = 0x01450000;
enum uint32_t GCOV_TAG_ARCS = 0x01430000;
enum uint32_t GCOV_TAG_COUNTER_BASE = 0x01a10000;
//Arc flags
enum ArcFlag {
ON_TREE = 1 << 0,
FAKE = 1 << 1,
FALLTHROUGH = 1 << 2
}
//TODO: Usage
struct SummaryStruct {
uint32_t magic;
uint32_t versionn;
uint32_t includeInTotals;
uint32_t nLines;
uint32_t nExecutedLines;
string name;
}
struct CodeLine {
string lineNr, executionNr;
auto toString() const {
return format(("Line nr %s: Executed %s times"), lineNr, executionNr);
};
}
struct LineUsageCnt {
int uncov, unexec, cov;
auto toString() const {
return format(("%s unexecuted lines(-). %s none covered lines(#####). %s covered lines"),
uncov, unexec, cov);
}
}
struct Lines {
CodeLine[] codelines;
}
struct FileHeader {
int32_t magic, versionn, stamp;
}
struct Header {
int32_t tag;
int32_t length;
}
class GcovParser {
public:
auto parse() {
if (!verify()) {
return false;
}
const uint8_t* cur = m_data + FileHeader.sizeof;
ptrdiff_t left = cast(ptrdiff_t)(m_dataSize - FileHeader.sizeof);
while (1) {
writeln("Loop");
const Header* header = cast(Header*) cur;
if (!onRecord(header, cur + header.sizeof)) {
writeln(cur);
return false;
}
size_t curLen = header.sizeof + header.length * 4;
if (left <= 0) {
break;
}
*cast(uint8_t*)&cur += curLen; //TODO: Can this be done any better?
}
return true;
}
protected:
this(const uint8_t* data, size_t dataSize) {
m_data = data;
m_dataSize = dataSize;
}
bool verify() {
const FileHeader* fileheader = cast(FileHeader*) m_data;
writeln("fileheader: ",fileheader);
return !(fileheader.magic != GCOV_DATA_MAGIC && fileheader.magic != GCOV_NOTE_MAGIC); //return false if not gcda or gcno
}
bool onRecord(const Header* header, const uint8_t* data) {
writeln("In here");
return 0;
}
const uint8_t* readString(const uint8_t* p, ref string outt) {
int32_t length = *cast(const int32_t*) p;
const char* c_str = cast(const char*)&p[4];
outt = to!string(c_str);
return padPointer(p + length * 4 + 4); // Including the length field?
}
//TODO: When using 32-bit pointers, could be convenient.
/*const int32_t * readString(const int32_t * p, ref string outt){
return cast (const int32_t *) readString(cast (const uint8_t *) p, outt);
}*/
const uint8_t* padPointer(const uint8_t* p) {
ulong addr = cast(ulong) p;
if ((addr & 3) != 0) {
*cast(uint8_t*)&p += 4 - (addr & 3); //TODO: Very hacky
}
return cast(uint8_t*) p;
}
private:
const uint8_t* m_data;
size_t m_dataSize;
}
class GcnoParser : GcovParser {
public:
this(const uint8_t* data, size_t dataSize) {
super(data, dataSize);
m_functionId = -1;
}
//Holder-class for fn/bb -> file/line, used for something
class BasicBlockMapping {
public:
int32_t m_func;
int32_t m_basicblock;
string m_file;
int32_t m_line;
int32_t m_index;
this(const ref BasicBlockMapping other) {
m_func = other.m_func;
m_basicblock = other.m_basicblock;
m_file = other.m_file;
m_line = other.m_line;
m_index = other.m_index;
}
this(int32_t func, int32_t basicBlock, const ref string file, int32_t line, int32_t index) {
m_func = func;
m_basicblock = basicBlock;
m_file = file;
m_line = line;
m_index = index;
}
};
class Arc {
public:
int32_t m_func;
int32_t m_srcBlock;
int32_t m_dstBlock;
this(const ref Arc other) {
m_func = other.m_func;
m_srcBlock = other.m_srcBlock;
m_dstBlock = other.m_dstBlock;
}
this(int32_t func, int32_t srcBlock, int32_t dstBlock) {
m_func = func;
m_srcBlock = srcBlock;
m_dstBlock = dstBlock;
}
};
//These might not be needed
alias BasicBlockList_t = Typedef!BasicBlockMapping;
alias FunctionList_t = Typedef!(int32_t);
alias ArcList_t = Typedef!Arc;
const ref auto getBasicBlocks() {
return m_basicBlocks;
}
const ref auto getFunctions() {
return m_function;
}
const ref auto getArcs() {
return m_arcs;
}
protected:
override bool onRecord(const Header* header, const uint8_t* data) {
switch (header.tag) {
writeln("Yo");
case GCOV_TAG_FUNCTION:
writeln("FunctionOnrecordGcno");
onAnnounceFunction(header, data);
break;
case GCOV_TAG_BLOCKS:
onBlocks(header, data);
break;
case GCOV_TAG_LINES:
onLines(header, data);
break;
case GCOV_TAG_ARCS:
onArcs(header, data);
break;
default:
break;
}
return 0;
}
private:
auto onAnnounceFunction(const Header* header, const uint8_t* data) {
const int32_t* p32 = cast(const int32_t*) data;
uint8_t* p8 = cast(uint8_t*) data;
int32_t ident = p32[0];
p8 = readString(p8 + 3 * 4, m_function);
p8 = readString(p8, m_file);
m_functionId = ident;
m_functions ~= cast(FunctionList_t) m_functionId; //Weird cast needed?
writeln("GCNO function %d: %s \n", m_functionId, m_file);
}
auto onBlocks(const Header* header, const uint8_t* data) {
//TODO: Not sure if implementation is needed.
}
auto onLines(const Header* header, const uint8_t* data) {
int32_t* p32 = cast(int32_t*) data;
int32_t blockNo = p32[0];
int32_t* last = cast(int32_t*) p32[header.length]; //More fun casting
int32_t n = 0; //Index
p32++; //Skipping the blockNo
//Iterate through the lines
//TODO: Improve the iteration...
while (p32 < last) {
int32_t line = *p32;
//The filename
//TODO: Oversee the casting being done here.
if (line == 0) {
string name;
ubyte* curFilenameLine = cast(ubyte*)(p32 + 1);
p32 = cast(int32_t*) readString(curFilenameLine, name);
if (name != "") {
m_file = name;
}
continue;
}
p32++;
writeln("GCNO basic block in function %d, nr %d %s:%d",
m_functionId, blockNo, m_file, line);
m_basicBlocks ~= cast(BasicBlockList_t) new BasicBlockMapping(m_functionId,
blockNo, m_file, line, n);
n++;
}
}
auto onArcs(const Header* header, const uint8_t* data) {
int32_t* p32 = cast(int32_t*) data;
int32_t blockNo = p32[0];
int32_t* last = cast(int32_t*) p32[header.length]; //More fun casting
uint arc = 0; //Index
p32++; //Skipping the blockNo
//Iterate through the lines
//TODO: Improve the iteration...
while (p32 < last) {
int32_t destBlock = p32[0];
int32_t flags = p32[1];
if (!(flags & ArcFlag.ON_TREE)) {
m_arcs ~= cast(ArcList_t) new Arc(m_functionId, blockNo, destBlock);
}
p32 += 2;
arc++;
writeln("GCNO arc in function %d, nr %d %s:%d", m_functionId,
blockNo, destBlock, flags);
}
}
string m_file;
string m_function;
int32_t m_functionId;
FunctionList_t[] m_functions;
BasicBlockList_t[] m_basicBlocks;
ArcList_t[] m_arcs;
};
//For gcda files
class GcdaParser : GcovParser {
public:
this(const uint8_t* data, size_t dataSize) {
super(data, dataSize);
m_functionId = -1;
}
auto countersForFunction(int32_t func) {
if (func < 0) {
writeln("Garbage");
}
//TODO: find func in m_functionToCounters and return -1 if it is equal to m_functionToCounters.end()
writeln("countersForFunction", func);
return m_functionToCounters[func].length;
}
//List of counter
auto getCounter(int32_t func, int32_t counter) {
CounterList_t cur = m_functionToCounters[func];
if (func < 0 || counter < 0) {
writeln("getcounter Garbage");
}
if (cast(size_t) counter >= cur.length) {
return -1;
}
return cast(int64_t) cur[counter];
}
protected:
override bool onRecord(const Header* header, const uint8_t* data) {
switch (header.tag) {
case GCOV_TAG_FUNCTION:
writeln("FunctionOnrecordGcda");
onAnnounceFunction(header, data);
break;
case GCOV_TAG_COUNTER_BASE:
onCounterBase(header, data);
break;
default:
break;
}
return 0;
}
auto onAnnounceFunction(const Header* header, const uint8_t* data) {
const int32_t* p32 = cast(int32_t*) data;
int32_t ident = p32[0];
m_functionId = ident;
}
auto onCounterBase(const Header* header, const uint8_t* data) {
const int32_t* p32 = cast(int32_t*) data;
int32_t count = header.length; //64-bit value.
//Store counters in list
CounterList_t counters;
//TODO: Improve this iteration...
for (int32_t i = 0; i < count; i += 2) {
//TODO: Check on this shifting...
uint64_t v64 = cast(uint64_t) p32[i] | cast(uint64_t) p32[i + 1] << 32;
counters ~= cast(int64_t) v64;
writeln("GCDA counter %d %lld", i);
}
m_functionToCounters[m_functionId] = counters;
}
alias CounterList_t = Typedef!(int64_t[]);
alias FunctionToCountersMap_t = Typedef!(CounterList_t[int32_t]);
int32_t m_functionId;
FunctionToCountersMap_t m_functionToCounters;
};
auto splitCodeLine(string line) {
string exenr, linenr;
auto splitted = split(line, ":");
exenr = strip(splitted[0]);
linenr = strip(splitted[1]);
auto splitLine = CodeLine(linenr, exenr);
return splitLine;
}
//TODO: Will improve this later on... With count??
auto countLineUsage(Lines line) {
LineUsageCnt lineUsage;
foreach (i; line.codelines) {
if (i.executionNr == "-" && i.lineNr != "0") {
lineUsage.uncov++;
} else if (i.executionNr == "#####") {
lineUsage.unexec++;
} else if (isNumeric(i.executionNr)) {
lineUsage.cov++;
}
}
return lineUsage;
}
auto getUncoveredLines(Lines lines) {
writeln("None covered lines: ");
foreach (nocovered; filter!(a => a.executionNr == "#####")(lines.codelines)) {
writeln(toJson(nocovered));
}
}
//Might be redundant
auto getCoveredLines(Lines lines) {
writeln("Covered lines: ");
foreach (covered; filter!(a => isNumeric(a.executionNr))(lines.codelines)) {
writeln(toJson(covered));
}
}
auto toJson(CodeLine codeline) {
JSONValue j = ["executionNr" : ""];
j.object["lineNr"] = JSONValue(codeline.lineNr);
j.object["executionNr"] = JSONValue(codeline.executionNr);
return j;
}
//Temporary
auto testParse(ref File gcnoFile) {
uint8_t[1000] data;
writeln(gcnoFile.rawRead(data));
size_t datasize = data.sizeof;
GcdaParser gcdaparser = new GcdaParser(data.ptr, datasize);
writeln(gcdaparser.verify());
writeln(gcdaparser.parse());
return gcdaparser;
}
void mai() {
Lines lines;
auto file = File("source/test.c.gcov", "r");
foreach (line; file.byLineCopy.map!(a => splitCodeLine(a))) {
lines.codelines ~= line;
}
auto gcnoFile = File("ExampleFile/test.gcno", "rb");
auto gcdaFile = File("ExampleFile/test.gcda", "r");
testParse(gcdaFile);
}
|
D
|
void test1()
{
static assert(__traits(isSame, (a, b) => a + b, (c, d) => c + d));
static assert(__traits(isSame, a => ++a, b => ++b));
static assert(!__traits(isSame, (int a, int b) => a + b, (a, b) => a + b));
static assert(__traits(isSame, (a, b) => a + b + 10, (c, d) => c + d + 10));
}
class Y
{
static int r = 5;
int x;
this(int x)
{
this.x = x;
}
}
class A
{
Y a;
this(Y a)
{
this.a = a;
}
}
void foo3(alias pred)()
{
static assert(!__traits(isSame, pred, (A x, A y) => ++x.a.x + (--y.a.x)));
}
void test2()
{
int b;
static assert(!__traits(isSame, a => a + b, a => a + b));
int f() { return 3;}
static assert(!__traits(isSame, a => a + f(), a => a + f()));
class A
{
Y a;
this(Y a)
{
this.a = a;
}
}
class B
{
int a;
this(int a)
{
this.a = a;
}
}
B q = new B(7);
alias pred = (A a, A b) => ++a.a.x + (--b.a.x);
foo3!pred();
static assert(!__traits(isSame, (A a) => ++a.a.x + 2, (A b) => ++b.a.x + 3));
static assert(__traits(isSame, pred, (A x, A y) => ++x.a.x + (--y.a.x)));
static assert(!__traits(isSame, (B a) => ++a.a + 2, (B b) => ++b.a + 3));
static assert(__traits(isSame, (B a) => ++a.a, (B a) => ++a.a));
B cl = new B(7);
static assert(!__traits(isSame, a => a + q.a, c => c + cl.a));
class C(G)
{
G a;
this(int a)
{
this.a = a;
}
}
static assert(!__traits(isSame, (C!int a) => ++a.a, (C!int a) => ++a.a));
struct X
{
int a;
}
static assert(__traits(isSame, (X a) => a.a + 2, (X b) => b.a + 2));
struct T(G)
{
G a;
}
static assert(!__traits(isSame, (T!int a) => ++a.a, (T!int a) => ++a.a));
}
void test3()
{
enum q = 10;
static assert(__traits(isSame, (a, b) => a + b + q, (c, d) => c + d + 10));
struct Bar
{
int a;
}
enum r1 = Bar(1);
enum r2 = Bar(1);
static assert(__traits(isSame, a => a + r1.a, b => b + r2.a));
enum X { A, B, C}
static assert(__traits(isSame, a => a + X.A, a => a + 0));
}
void foo(alias pred)()
{
static assert(__traits(isSame, pred, (c, d) => c + d));
static assert(__traits(isSame, (c, d) => c + d, pred));
}
void bar(alias pred)()
{
static assert(__traits(isSame, pred, (c, d) => c < d + 7));
enum q = 7;
static assert(__traits(isSame, pred, (c, d) => c < d + q));
int r = 7;
static assert(!__traits(isSame, pred, (c, d) => c < d + r));
}
void test4()
{
foo!((a, b) => a + b)();
bar!((a, b) => a < b + 7);
}
void main()
{
test1();
test2();
test3();
test4();
}
|
D
|
import ldc.attributes;
//This function returns the iterations it takes for the given pixel
//The function it iterates is f(z) = z^2 + C
auto iterateMandelbrot(in real x, in real y) pure nothrow @nogc @safe @fastmath
{
import std.complex : complex, abs;
import std.math : log;
enum max_iters = 500_000U;
//Skip calculating for some values inside the big bulbs
if (x >= -1.2 && x <= -0.8 && y <= 0.1)
return max_iters;
else if (x >= -0.6 && x <= 0.2 && y <= 0.4)
return max_iters;
auto z = 0.complex;
auto c = complex(x, y);
uint i;
for (; i < max_iters && z.re ^^ 2 + z.im ^^ 2 < 4; ++i)
z = z ^^ 2 + c;
return i;
}
ubyte[] colourMandelbrot(in uint width, in uint height) @fastmath
{
import std.parallelism : parallel;
import std.range : iota;
ubyte[] output;
output.length = width * height * 3;
const PixelWidth = (1.0 + 2.5) / width;
const PixelHeight = (1.0 + 1.0) / height;
foreach (pY; iota(height / 2, height).parallel) {
real y = -1.0 + pY * PixelHeight;
foreach (pX; 0 .. width) {
real x = -2.5 + pX * PixelWidth;
uint i;
i = iterateMandelbrot(x, y);
//This doubles the output
//Makes use of the fact that the set is symmetric about X axis
foreach (j, ref c; output[3 * pX + 3 * pY * width .. pY * width * 3 + pX * 3 + 3])
c = (i * 4 + (2 - j) * 8) % ubyte.max;
foreach (j, ref c; output[3 * pX + 3 * (height - pY) * width .. (height - pY) * width * 3 + pX * 3 + 3])
c = (i * 4 + (2 - j) * 8) % ubyte.max;
}
}
return output;
}
void main(string[] args)
{
import std.stdio : File;
import std.getopt;
uint width = 720, height = 576;
auto helpInformation = getopt(
args,
"width|w", "width of image", &width,
"height|h", "height of image", &height);
if (helpInformation.helpWanted) {
defaultGetoptPrinter("madelbrot\nUsage : ./madelbrot",
helpInformation.options);
return;
}
auto file = File("mandelbrot_" ~ width.to!string ~ "x" ~ height.to!string ~ ".ppm", "wb");
//ppm Format:
//P6, comment, rows cols, colors
file.writef!"P6\n#\n%d %d\n255\n"(width, height);
file.rawWrite(colourMandelbrot(width, height));
}
|
D
|
// Copyright (с) 2013 Gushcha Anton <ncrashed@gmail.com>
/*
* This file is part of Borey Engine.
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
// This file is written in D programming language
/**
* Module describes mouse buttons and button states.
*/
module borey.mouse;
@safe:
import std.bitmanip;
/// Describes mouse buttons
enum MouseButton
{
BUTTON_1 = 0,
BUTTON_2 = 1,
BUTTON_3 = 2,
BUTTON_4 = 3,
BUTTON_5 = 4,
BUTTON_6 = 5,
BUTTON_7 = 6,
BUTTON_8 = 7,
LEFT = BUTTON_1,
RIGHT = BUTTON_2,
MIDDLE = BUTTON_3
}
/// Describes mouse button position: pressed or relased.
enum MouseButtonPosition
{
PRESS,
RELEASE
}
/**
* Describes mouse button state to pass into input callbacks.
*/
struct MouseButtonState
{
/// Mouse button pressed/released
MouseButton button;
/// Pressed/released
MouseButtonPosition position;
/// Modifier key flags
mixin(bitfields!(
bool, "shift", 1,
bool, "control", 1,
bool, "alt", 1,
bool, "_super", 1,
uint, "", 4));
}
|
D
|
module track_layer;
struct Vertex
{
import gfm.math : vec3f, vec4f;
vec3f position;
vec4f color;
float heading;
}
import std.math : PI;
import gfm.math : vec3f, vec4f;
import batcher : VertexSlice;
auto v12_89 = [
Vertex(vec3f(2592.73, 29898.1, 0), vec4f(1.0, 1.0, 1.0, 1.0), 0 * PI/180.0),
Vertex(vec3f(4718.28, 30201.3, 0), vec4f(1.0, 1.0, 1.0, 1.0), 30 * PI/180.0),
Vertex(vec3f(7217.78, 31579.6, 0), vec4f(1.0, 1.0, 1.0, 1.0), 60 * PI/180.0),
Vertex(vec3f(8803.98, 31867.5, 0), vec4f(1.0, 1.0, 1.0, 1.0), 90 * PI/180.0),
Vertex(vec3f(10319.9, 32846.7, 0), vec4f(1.0, 1.0, 1.0, 1.0), 120 * PI/180.0),
Vertex(vec3f(12101.3, 33290.6, 0), vec4f(1.0, 1.0, 1.0, 1.0), 150 * PI/180.0),
Vertex(vec3f( 15099, 34126, 0), vec4f(1.0, 1.0, 1.0, 1.0), 180 * PI/180.0),
Vertex(vec3f(15750.3, 34418.7, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f( 18450, 35493.3, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(20338.8, 36117.9, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(22569.5, 36753, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(23030.3, 37399.1, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(26894.2, 38076.8, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(27829.2, 38624.7, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(30832.9, 39502.2, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(31785.5, 39910.8, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(34543.4, 39246.4, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(36346.9, 38694.4, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(38273.6, 38011, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(39485.8, 37357, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f( 42242, 36425.5, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(43082.6, 36391.4, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(47068.2, 34976.8, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(48361.4, 34596.8, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(50459.5, 34002.1, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(53024.4, 33244.2, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(54822.9, 32615.2, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(56916.5, 31945, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
Vertex(vec3f(59601.7, 31186.4, 0), vec4f(1.0, 1.0, 1.0, 1.0), 1.0),
];
auto vs12_89_line = [
VertexSlice(VertexSlice.Kind.LineStrip, 0, 28),
];
auto vs12_89_point = [
VertexSlice(VertexSlice.Kind.Points, 0, 28),
];
class TrackLayer
{
import gfm.opengl : OpenGL, GLProgram, VertexSpecification;
import gfm.math : vec2i;
import batcher : GLProvider;
this(R)(OpenGL gl, R vertices)
{
import std.range : ElementType;
static assert(is(ElementType!R == Vertex));
_gl = gl;
{
const program_source =
q{#version 330 core
#if VERTEX_SHADER
layout(location = 0) in vec3 position;
layout(location = 1) in vec4 color;
layout(location = 2) in float heading;
out vec4 vColor;
out float vHeading;
uniform mat4 mvp_matrix;
void main()
{
gl_Position = mvp_matrix * vec4(position.xyz, 1.0);
gl_PointSize = 3.0;
vColor = color;
vHeading = heading;
}
#endif
#if GEOMETRY_SHADER
layout(points) in;
layout(line_strip, max_vertices = 19) out;
in vec4 vColor[]; // Output from vertex shader for each vertex
in float vHeading[];
out vec4 fColor; // Output to fragment shader
uniform ivec2 resolution;
const float PI = 3.1415926;
void main()
{
fColor = vColor[0]; // Point has only one vertex
float fHeading = vHeading[0];
float size = 8.0 / resolution.x;
float heading_length = 4 * size;
float aspect_ratio = resolution.x / float(resolution.y);
const float sides = 16;
gl_Position = gl_in[0].gl_Position;
EmitVertex();
vec4 offset = vec4(cos(fHeading) * heading_length, -sin(fHeading) * aspect_ratio * heading_length, 0.0, 0.0);
gl_Position = gl_in[0].gl_Position + offset;
EmitVertex();
EndPrimitive();
for (int i = 0; i <= sides; i++) {
// Angle between each side in radians
float ang = PI * 2.0 / sides * i;
// Offset from center of point
vec4 offset = vec4(cos(ang) * size, -sin(ang) * aspect_ratio * size, 0.0, 0.0);
gl_Position = gl_in[0].gl_Position + offset;
EmitVertex();
}
EndPrimitive();
}
#endif
#if FRAGMENT_SHADER
in vec4 fColor;
out vec4 color_out;
void main()
{
color_out = fColor;
}
#endif
};
_point_program = new GLProgram(_gl, program_source);
}
{
const program_source =
q{#version 330 core
#if VERTEX_SHADER
layout(location = 0) in vec3 position;
layout(location = 1) in vec4 color;
layout(location = 2) in float heading;
out vec4 vColor;
uniform mat4 mvp_matrix;
uniform ivec2 resolution;
void main()
{
gl_Position = mvp_matrix * vec4(position.xyz, 1.0);
vColor = color;
}
#endif
#if FRAGMENT_SHADER
in vec4 vColor;
out vec4 color_out;
void main()
{
color_out = vColor;
}
#endif
};
_line_program = new GLProgram(_gl, program_source);
}
_glprovider = new GLProvider!Vertex(_gl, new VertexSpecification!Vertex(_point_program), vertices);
}
~this()
{
_glprovider.destroy();
_point_program.destroy();
_line_program.destroy();
}
void draw(Matrix)(ref Matrix mvp, vec2i resolution)
{
{
_line_program.uniform("mvp_matrix").set(mvp);
_line_program.use();
scope(exit) _line_program.unuse();
_glprovider.drawVertices(vs12_89_line);
_gl.runtimeCheck();
}
{
_point_program.uniform("mvp_matrix").set(mvp);
_point_program.uniform("resolution").set(resolution);
_point_program.use();
scope(exit) _point_program.unuse();
_glprovider.drawVertices(vs12_89_point);
_gl.runtimeCheck();
}
}
private:
OpenGL _gl;
GLProgram _line_program, _point_program;
GLProvider!Vertex _glprovider;
}
|
D
|
instance VLK_519_Buddler(Npc_Default)
{
name[0] = NAME_Buddler;
npcType = npctype_ambient;
guild = GIL_VLK;
level = 2;
voice = 2;
id = 519;
attribute[ATR_STRENGTH] = 25;
attribute[ATR_DEXTERITY] = 20;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 94;
attribute[ATR_HITPOINTS] = 94;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",2,1,"Hum_Head_Thief",69,2,-1);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1H_Club_01);
CreateInvItem(self,ItFoApple);
daily_routine = Rtn_start_519;
};
func void Rtn_start_519()
{
TA_Sleep(22,0,8,0,"OCR_HUT_43");
TA_SitAround(8,0,12,0,"OCR_HUT_43");
TA_WashSelf(12,0,12,15,"OCR_WASH_8");
TA_StandAround(12,15,16,35,"OCR_MARKETPLACE_HANGAROUND");
TA_SitAround(16,35,22,0,"OCR_HUT_43");
};
|
D
|
instance VLK_557_BUDDLER(NPC_DEFAULT)
{
name[0] = NAME_BUDDLER;
npctype = NPCTYPE_AMBIENT;
guild = GIL_VLK;
level = 3;
voice = 1;
id = 557;
attribute[ATR_STRENGTH] = 15;
attribute[ATR_DEXTERITY] = 10;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 76;
attribute[ATR_HITPOINTS] = 76;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_SetVisualBody(self,"hum_body_Naked0",2,1,"Hum_Head_FatBald",71,1,vlk_armor_l);
b_scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,itmw_1h_nailmace_01);
CreateInvItem(self,itmwpickaxe);
CreateInvItem(self,itfobeer);
CreateInvItem(self,itlstorch);
daily_routine = rtn_start_557;
};
func void rtn_start_557()
{
ta_sleep(23,15,6,30,"OCR_HUT_75");
ta_washself(6,30,7,6,"OCR_LAKE_4");
ta_standaround(7,6,12,0,"OCR_OUTSIDE_HUT_77_MOVEMENT2");
ta_sitaround(12,0,13,0,"OCR_OUTSIDE_HUT_75");
ta_cook(13,0,14,0,"OCR_OUTSIDE_HUT_75");
ta_standaround(14,0,16,0,"OCR_OUTSIDE_HUT_77_MOVEMENT2");
ta_sitaround(16,0,17,55,"OCR_OUTSIDE_HUT_75");
ta_sitcampfire(17,55,23,15,"OCR_OUTSIDE_HUT_77_MOVEMENT2");
};
|
D
|
/**
* Performs the semantic3 stage, which deals with function bodies.
*
* Copyright: Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/semantic3.d, _semantic3.d)
* Documentation: https://dlang.org/phobos/dmd_semantic3.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/semantic3.d
*/
module dmd.semantic3;
import core.stdc.stdio;
import core.stdc.string;
import dmd.aggregate;
import dmd.aliasthis;
import dmd.arraytypes;
import dmd.astcodegen;
import dmd.attrib;
import dmd.blockexit;
import dmd.clone;
import dmd.ctorflow;
import dmd.dcast;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dimport;
import dmd.dinterpret;
import dmd.dmodule;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.dversion;
import dmd.errors;
import dmd.escape;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.initsem;
import dmd.hdrgen;
import dmd.mtype;
import dmd.nogc;
import dmd.nspace;
import dmd.ob;
import dmd.objc;
import dmd.opover;
import dmd.parse;
import dmd.root.filename;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.sideeffect;
import dmd.statementsem;
import dmd.staticassert;
import dmd.tokens;
import dmd.utf;
import dmd.semantic2;
import dmd.statement;
import dmd.target;
import dmd.templateparamsem;
import dmd.typesem;
import dmd.visitor;
enum LOG = false;
/*************************************
* Does semantic analysis on function bodies.
*/
extern(C++) void semantic3(Dsymbol dsym, Scope* sc)
{
scope v = new Semantic3Visitor(sc);
dsym.accept(v);
}
private extern(C++) final class Semantic3Visitor : Visitor
{
alias visit = Visitor.visit;
Scope* sc;
this(Scope* sc)
{
this.sc = sc;
}
override void visit(Dsymbol) {}
override void visit(TemplateInstance tempinst)
{
static if (LOG)
{
printf("TemplateInstance.semantic3('%s'), semanticRun = %d\n", tempinst.toChars(), tempinst.semanticRun);
}
//if (toChars()[0] == 'D') *(char*)0=0;
if (tempinst.semanticRun >= PASS.semantic3)
return;
tempinst.semanticRun = PASS.semantic3;
if (!tempinst.errors && tempinst.members)
{
TemplateDeclaration tempdecl = tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
sc = sc.push(tempinst.argsym);
sc = sc.push(tempinst);
sc.tinst = tempinst;
sc.minst = tempinst.minst;
int needGagging = (tempinst.gagged && !global.gag);
uint olderrors = global.errors;
int oldGaggedErrors = -1; // dead-store to prevent spurious warning
/* If this is a gagged instantiation, gag errors.
* Future optimisation: If the results are actually needed, errors
* would already be gagged, so we don't really need to run semantic
* on the members.
*/
if (needGagging)
oldGaggedErrors = global.startGagging();
for (size_t i = 0; i < tempinst.members.dim; i++)
{
Dsymbol s = (*tempinst.members)[i];
s.semantic3(sc);
if (tempinst.gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!tempinst.errors)
{
if (!tempdecl.literal)
tempinst.error(tempinst.loc, "error instantiating");
if (tempinst.tinst)
tempinst.tinst.printInstantiationTrace();
}
tempinst.errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
}
override void visit(TemplateMixin tmix)
{
if (tmix.semanticRun >= PASS.semantic3)
return;
tmix.semanticRun = PASS.semantic3;
static if (LOG)
{
printf("TemplateMixin.semantic3('%s')\n", tmix.toChars());
}
if (tmix.members)
{
sc = sc.push(tmix.argsym);
sc = sc.push(tmix);
for (size_t i = 0; i < tmix.members.dim; i++)
{
Dsymbol s = (*tmix.members)[i];
s.semantic3(sc);
}
sc = sc.pop();
sc.pop();
}
}
override void visit(Module mod)
{
//printf("Module::semantic3('%s'): parent = %p\n", toChars(), parent);
if (mod.semanticRun != PASS.semantic2done)
return;
mod.semanticRun = PASS.semantic3;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
Scope* sc = Scope.createGlobal(mod); // create root scope
//printf("Module = %p\n", sc.scopesym);
// Pass 3 semantic routines: do initializers and function bodies
for (size_t i = 0; i < mod.members.dim; i++)
{
Dsymbol s = (*mod.members)[i];
//printf("Module %s: %s.semantic3()\n", toChars(), s.toChars());
s.semantic3(sc);
mod.runDeferredSemantic2();
}
if (mod.userAttribDecl)
{
mod.userAttribDecl.semantic3(sc);
}
sc = sc.pop();
sc.pop();
mod.semanticRun = PASS.semantic3done;
}
override void visit(FuncDeclaration funcdecl)
{
/* Determine if function should add `return 0;`
*/
bool addReturn0()
{
TypeFunction f = cast(TypeFunction)funcdecl.type;
return f.next.ty == Tvoid &&
(funcdecl.isMain() || global.params.betterC && funcdecl.isCMain());
}
VarDeclaration _arguments = null;
if (!funcdecl.parent)
{
if (global.errors)
return;
//printf("FuncDeclaration::semantic3(%s '%s', sc = %p)\n", kind(), toChars(), sc);
assert(0);
}
if (funcdecl.errors || isError(funcdecl.parent))
{
funcdecl.errors = true;
return;
}
//printf("FuncDeclaration::semantic3('%s.%s', %p, sc = %p, loc = %s)\n", funcdecl.parent.toChars(), funcdecl.toChars(), funcdecl, sc, funcdecl.loc.toChars());
//fflush(stdout);
//printf("storage class = x%x %x\n", sc.stc, storage_class);
//{ static int x; if (++x == 2) *(char*)0=0; }
//printf("\tlinkage = %d\n", sc.linkage);
if (funcdecl.ident == Id.assign && !funcdecl.inuse)
{
if (funcdecl.storage_class & STC.inference)
{
/* https://issues.dlang.org/show_bug.cgi?id=15044
* For generated opAssign function, any errors
* from its body need to be gagged.
*/
uint oldErrors = global.startGagging();
++funcdecl.inuse;
funcdecl.semantic3(sc);
--funcdecl.inuse;
if (global.endGagging(oldErrors)) // if errors happened
{
// Disable generated opAssign, because some members forbid identity assignment.
funcdecl.storage_class |= STC.disable;
funcdecl.fbody = null; // remove fbody which contains the error
funcdecl.semantic3Errors = false;
}
return;
}
}
//printf(" sc.incontract = %d\n", (sc.flags & SCOPE.contract));
if (funcdecl.semanticRun >= PASS.semantic3)
return;
funcdecl.semanticRun = PASS.semantic3;
funcdecl.semantic3Errors = false;
if (!funcdecl.type || funcdecl.type.ty != Tfunction)
return;
TypeFunction f = cast(TypeFunction)funcdecl.type;
if (!funcdecl.inferRetType && f.next.ty == Terror)
return;
if (!funcdecl.fbody && funcdecl.inferRetType && !f.next)
{
funcdecl.error("has no function body with return type inference");
return;
}
uint oldErrors = global.errors;
auto fds = FuncDeclSem3(funcdecl,sc);
fds.checkInContractOverrides();
// Remember whether we need to generate an 'out' contract.
immutable bool needEnsure = FuncDeclaration.needsFensure(funcdecl);
if (funcdecl.fbody || funcdecl.frequires || needEnsure)
{
/* Symbol table into which we place parameters and nested functions,
* solely to diagnose name collisions.
*/
funcdecl.localsymtab = new DsymbolTable();
// Establish function scope
auto ss = new ScopeDsymbol(funcdecl.loc, null);
// find enclosing scope symbol, might skip symbol-less CTFE and/or FuncExp scopes
for (auto scx = sc; ; scx = scx.enclosing)
{
if (scx.scopesym)
{
ss.parent = scx.scopesym;
break;
}
}
ss.endlinnum = funcdecl.endloc.linnum;
Scope* sc2 = sc.push(ss);
sc2.func = funcdecl;
sc2.parent = funcdecl;
sc2.ctorflow.callSuper = CSX.none;
sc2.sbreak = null;
sc2.scontinue = null;
sc2.sw = null;
sc2.fes = funcdecl.fes;
sc2.linkage = LINK.d;
sc2.stc &= STCFlowThruFunction;
sc2.protection = Prot(Prot.Kind.public_);
sc2.explicitProtection = 0;
sc2.aligndecl = null;
if (funcdecl.ident != Id.require && funcdecl.ident != Id.ensure)
sc2.flags = sc.flags & ~SCOPE.contract;
sc2.flags &= ~SCOPE.compile;
sc2.tf = null;
sc2.os = null;
sc2.inLoop = false;
sc2.userAttribDecl = null;
if (sc2.intypeof == 1)
sc2.intypeof = 2;
sc2.ctorflow.fieldinit = null;
/* Note: When a lambda is defined immediately under aggregate member
* scope, it should be contextless due to prevent interior pointers.
* e.g.
* // dg points 'this' - it's interior pointer
* class C { int x; void delegate() dg = (){ this.x = 1; }; }
*
* However, lambdas could be used inside typeof, in order to check
* some expressions validity at compile time. For such case the lambda
* body can access aggregate instance members.
* e.g.
* class C { int x; static assert(is(typeof({ this.x = 1; }))); }
*
* To properly accept it, mark these lambdas as member functions.
*/
if (auto fld = funcdecl.isFuncLiteralDeclaration())
{
if (auto ad = funcdecl.isMember2())
{
if (!sc.intypeof)
{
if (fld.tok == TOK.delegate_)
funcdecl.error("cannot be %s members", ad.kind());
else
fld.tok = TOK.function_;
}
else
{
if (fld.tok != TOK.function_)
fld.tok = TOK.delegate_;
}
}
}
funcdecl.declareThis(sc2);
//printf("[%s] ad = %p vthis = %p\n", loc.toChars(), ad, vthis);
//if (vthis) printf("\tvthis.type = %s\n", vthis.type.toChars());
// Declare hidden variable _arguments[] and _argptr
if (f.parameterList.varargs == VarArg.variadic)
{
if (f.linkage == LINK.d)
{
// Variadic arguments depend on Typeinfo being defined.
if (!global.params.useTypeInfo || !Type.dtypeinfo || !Type.typeinfotypelist)
{
if (!global.params.useTypeInfo)
funcdecl.error("D-style variadic functions cannot be used with -betterC");
else if (!Type.typeinfotypelist)
funcdecl.error("`object.TypeInfo_Tuple` could not be found, but is implicitly used in D-style variadic functions");
else
funcdecl.error("`object.TypeInfo` could not be found, but is implicitly used in D-style variadic functions");
fatal();
}
// Declare _arguments[]
funcdecl.v_arguments = new VarDeclaration(funcdecl.loc, Type.typeinfotypelist.type, Id._arguments_typeinfo, null);
funcdecl.v_arguments.storage_class |= STC.temp | STC.parameter;
funcdecl.v_arguments.dsymbolSemantic(sc2);
sc2.insert(funcdecl.v_arguments);
funcdecl.v_arguments.parent = funcdecl;
//Type t = Type.dtypeinfo.type.constOf().arrayOf();
Type t = Type.dtypeinfo.type.arrayOf();
_arguments = new VarDeclaration(funcdecl.loc, t, Id._arguments, null);
_arguments.storage_class |= STC.temp;
_arguments.dsymbolSemantic(sc2);
sc2.insert(_arguments);
_arguments.parent = funcdecl;
}
if (f.linkage == LINK.d || f.parameterList.length)
{
// Declare _argptr
Type t = target.va_listType(funcdecl.loc, sc);
// Init is handled in FuncDeclaration_toObjFile
funcdecl.v_argptr = new VarDeclaration(funcdecl.loc, t, Id._argptr, new VoidInitializer(funcdecl.loc));
funcdecl.v_argptr.storage_class |= STC.temp;
funcdecl.v_argptr.dsymbolSemantic(sc2);
sc2.insert(funcdecl.v_argptr);
funcdecl.v_argptr.parent = funcdecl;
}
}
/* Declare all the function parameters as variables
* and install them in parameters[]
*/
if (const nparams = f.parameterList.length)
{
/* parameters[] has all the tuples removed, as the back end
* doesn't know about tuples
*/
funcdecl.parameters = new VarDeclarations();
funcdecl.parameters.reserve(nparams);
foreach (i, fparam; f.parameterList)
{
Identifier id = fparam.ident;
StorageClass stc = 0;
if (!id)
{
/* Generate identifier for un-named parameter,
* because we need it later on.
*/
fparam.ident = id = Identifier.generateId("_param_", i);
stc |= STC.temp;
}
Type vtype = fparam.type;
auto v = new VarDeclaration(funcdecl.loc, vtype, id, null);
//printf("declaring parameter %s of type %s\n", v.toChars(), v.type.toChars());
stc |= STC.parameter;
if (f.parameterList.varargs == VarArg.typesafe && i + 1 == nparams)
{
stc |= STC.variadic;
auto vtypeb = vtype.toBasetype();
if (vtypeb.ty == Tarray)
{
/* Since it'll be pointing into the stack for the array
* contents, it needs to be `scope`
*/
stc |= STC.scope_;
}
}
if ((funcdecl.flags & FUNCFLAG.inferScope) && !(fparam.storageClass & STC.scope_))
stc |= STC.maybescope;
stc |= fparam.storageClass & (STC.IOR | STC.return_ | STC.scope_ | STC.lazy_ | STC.final_ | STC.TYPECTOR | STC.nodtor);
v.storage_class = stc;
v.dsymbolSemantic(sc2);
if (!sc2.insert(v))
{
funcdecl.error("parameter `%s.%s` is already defined", funcdecl.toChars(), v.toChars());
funcdecl.errors = true;
}
else
funcdecl.parameters.push(v);
funcdecl.localsymtab.insert(v);
v.parent = funcdecl;
if (fparam.userAttribDecl)
v.userAttribDecl = fparam.userAttribDecl;
}
}
// Declare the tuple symbols and put them in the symbol table,
// but not in parameters[].
if (f.parameterList.parameters)
foreach (fparam; *f.parameterList.parameters)
{
if (!fparam.ident)
continue; // never used, so ignore
// expand any tuples
if (fparam.type.ty != Ttuple)
continue;
TypeTuple t = cast(TypeTuple)fparam.type;
size_t dim = Parameter.dim(t.arguments);
auto exps = new Objects(dim);
foreach (j; 0 .. dim)
{
Parameter narg = Parameter.getNth(t.arguments, j);
assert(narg.ident);
VarDeclaration v = sc2.search(Loc.initial, narg.ident, null).isVarDeclaration();
assert(v);
(*exps)[j] = new VarExp(v.loc, v);
}
assert(fparam.ident);
auto v = new TupleDeclaration(funcdecl.loc, fparam.ident, exps);
//printf("declaring tuple %s\n", v.toChars());
v.isexp = true;
if (!sc2.insert(v))
funcdecl.error("parameter `%s.%s` is already defined", funcdecl.toChars(), v.toChars());
funcdecl.localsymtab.insert(v);
v.parent = funcdecl;
}
// Precondition invariant
Statement fpreinv = null;
if (funcdecl.addPreInvariant())
{
Expression e = addInvariant(funcdecl.isThis(), funcdecl.vthis);
if (e)
fpreinv = new ExpStatement(Loc.initial, e);
}
// Postcondition invariant
Statement fpostinv = null;
if (funcdecl.addPostInvariant())
{
Expression e = addInvariant(funcdecl.isThis(), funcdecl.vthis);
if (e)
fpostinv = new ExpStatement(Loc.initial, e);
}
// Pre/Postcondition contract
if (!funcdecl.fbody)
funcdecl.buildEnsureRequire();
Scope* scout = null;
if (needEnsure || funcdecl.addPostInvariant())
{
/* https://issues.dlang.org/show_bug.cgi?id=3657
* Set the correct end line number for fensure scope.
*/
uint fensure_endlin = funcdecl.endloc.linnum;
if (funcdecl.fensure)
if (auto s = funcdecl.fensure.isScopeStatement())
fensure_endlin = s.endloc.linnum;
if ((needEnsure && global.params.useOut == CHECKENABLE.on) || fpostinv)
{
funcdecl.returnLabel = funcdecl.searchLabel(Id.returnLabel);
}
// scope of out contract (need for vresult.semantic)
auto sym = new ScopeDsymbol(funcdecl.loc, null);
sym.parent = sc2.scopesym;
sym.endlinnum = fensure_endlin;
scout = sc2.push(sym);
}
if (funcdecl.fbody)
{
auto sym = new ScopeDsymbol(funcdecl.loc, null);
sym.parent = sc2.scopesym;
sym.endlinnum = funcdecl.endloc.linnum;
sc2 = sc2.push(sym);
auto ad2 = funcdecl.isMemberLocal();
/* If this is a class constructor
*/
if (ad2 && funcdecl.isCtorDeclaration())
{
sc2.ctorflow.allocFieldinit(ad2.fields.dim);
foreach (v; ad2.fields)
{
v.ctorinit = 0;
}
}
bool inferRef = (f.isref && (funcdecl.storage_class & STC.auto_));
funcdecl.fbody = funcdecl.fbody.statementSemantic(sc2);
if (!funcdecl.fbody)
funcdecl.fbody = new CompoundStatement(Loc.initial, new Statements());
if (funcdecl.naked)
{
fpreinv = null; // can't accommodate with no stack frame
fpostinv = null;
}
assert(funcdecl.type == f || (funcdecl.type.ty == Tfunction && f.purity == PURE.impure && (cast(TypeFunction)funcdecl.type).purity >= PURE.fwdref));
f = cast(TypeFunction)funcdecl.type;
if (funcdecl.inferRetType)
{
// If no return type inferred yet, then infer a void
if (!f.next)
f.next = Type.tvoid;
if (f.checkRetType(funcdecl.loc))
funcdecl.fbody = new ErrorStatement();
}
if (global.params.vcomplex && f.next !is null)
f.next.checkComplexTransition(funcdecl.loc, sc);
if (funcdecl.returns && !funcdecl.fbody.isErrorStatement())
{
for (size_t i = 0; i < funcdecl.returns.dim;)
{
Expression exp = (*funcdecl.returns)[i].exp;
if (exp.op == TOK.variable && (cast(VarExp)exp).var == funcdecl.vresult)
{
if (addReturn0())
exp.type = Type.tint32;
else
exp.type = f.next;
// Remove `return vresult;` from returns
funcdecl.returns.remove(i);
continue;
}
if (inferRef && f.isref && !exp.type.constConv(f.next)) // https://issues.dlang.org/show_bug.cgi?id=13336
f.isref = false;
i++;
}
}
if (f.isref) // Function returns a reference
{
if (funcdecl.storage_class & STC.auto_)
funcdecl.storage_class &= ~STC.auto_;
}
// handle NRVO
if (!target.isReturnOnStack(f, funcdecl.needThis()) || funcdecl.checkNrvo())
funcdecl.nrvo_can = 0;
if (funcdecl.fbody.isErrorStatement())
{
}
else if (funcdecl.isStaticCtorDeclaration())
{
/* It's a static constructor. Ensure that all
* ctor consts were initialized.
*/
ScopeDsymbol pd = funcdecl.toParent().isScopeDsymbol();
for (size_t i = 0; i < pd.members.dim; i++)
{
Dsymbol s = (*pd.members)[i];
s.checkCtorConstInit();
}
}
else if (ad2 && funcdecl.isCtorDeclaration())
{
ClassDeclaration cd = ad2.isClassDeclaration();
// Verify that all the ctorinit fields got initialized
if (!(sc2.ctorflow.callSuper & CSX.this_ctor))
{
foreach (i, v; ad2.fields)
{
if (v.isThisDeclaration())
continue;
if (v.ctorinit == 0)
{
/* Current bugs in the flow analysis:
* 1. union members should not produce error messages even if
* not assigned to
* 2. structs should recognize delegating opAssign calls as well
* as delegating calls to other constructors
*/
if (v.isCtorinit() && !v.type.isMutable() && cd)
funcdecl.error("missing initializer for %s field `%s`", MODtoChars(v.type.mod), v.toChars());
else if (v.storage_class & STC.nodefaultctor)
error(funcdecl.loc, "field `%s` must be initialized in constructor", v.toChars());
else if (v.type.needsNested())
error(funcdecl.loc, "field `%s` must be initialized in constructor, because it is nested struct", v.toChars());
}
else
{
bool mustInit = (v.storage_class & STC.nodefaultctor || v.type.needsNested());
if (mustInit && !(sc2.ctorflow.fieldinit[i].csx & CSX.this_ctor))
{
funcdecl.error("field `%s` must be initialized but skipped", v.toChars());
}
}
}
}
sc2.ctorflow.freeFieldinit();
if (cd && !(sc2.ctorflow.callSuper & CSX.any_ctor) && cd.baseClass && cd.baseClass.ctor)
{
sc2.ctorflow.callSuper = CSX.none;
// Insert implicit super() at start of fbody
Type tthis = ad2.type.addMod(funcdecl.vthis.type.mod);
FuncDeclaration fd = resolveFuncCall(Loc.initial, sc2, cd.baseClass.ctor, null, tthis, null, FuncResolveFlag.quiet);
if (!fd)
{
funcdecl.error("no match for implicit `super()` call in constructor");
}
else if (fd.storage_class & STC.disable)
{
funcdecl.error("cannot call `super()` implicitly because it is annotated with `@disable`");
}
else
{
Expression e1 = new SuperExp(Loc.initial);
Expression e = new CallExp(Loc.initial, e1);
e = e.expressionSemantic(sc2);
Statement s = new ExpStatement(Loc.initial, e);
funcdecl.fbody = new CompoundStatement(Loc.initial, s, funcdecl.fbody);
}
}
//printf("ctorflow.callSuper = x%x\n", sc2.ctorflow.callSuper);
}
/* https://issues.dlang.org/show_bug.cgi?id=17502
* Wait until after the return type has been inferred before
* generating the contracts for this function, and merging contracts
* from overrides.
*
* https://issues.dlang.org/show_bug.cgi?id=17893
* However should take care to generate this before inferered
* function attributes are applied, such as 'nothrow'.
*
* This was originally at the end of the first semantic pass, but
* required a fix-up to be done here for the '__result' variable
* type of __ensure() inside auto functions, but this didn't work
* if the out parameter was implicit.
*/
funcdecl.buildEnsureRequire();
// Check for errors related to 'nothrow'.
const blockexit = funcdecl.fbody.blockExit(funcdecl, f.isnothrow);
if (f.isnothrow && blockexit & BE.throw_)
error(funcdecl.loc, "`nothrow` %s `%s` may throw", funcdecl.kind(), funcdecl.toPrettyChars());
if (!(blockexit & (BE.throw_ | BE.halt) || funcdecl.flags & FUNCFLAG.hasCatches))
{
/* Disable optimization on Win32 due to
* https://issues.dlang.org/show_bug.cgi?id=17997
*/
// if (!global.params.isWindows || global.params.is64bit)
funcdecl.eh_none = true; // don't generate unwind tables for this function
}
if (funcdecl.flags & FUNCFLAG.nothrowInprocess)
{
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isnothrow = !(blockexit & BE.throw_);
}
if (funcdecl.fbody.isErrorStatement())
{
}
else if (ad2 && funcdecl.isCtorDeclaration())
{
/* Append:
* return this;
* to function body
*/
if (blockexit & BE.fallthru)
{
Statement s = new ReturnStatement(funcdecl.loc, null);
s = s.statementSemantic(sc2);
funcdecl.fbody = new CompoundStatement(funcdecl.loc, funcdecl.fbody, s);
funcdecl.hasReturnExp |= (funcdecl.hasReturnExp & 1 ? 16 : 1);
}
}
else if (funcdecl.fes)
{
// For foreach(){} body, append a return 0;
if (blockexit & BE.fallthru)
{
Expression e = IntegerExp.literal!0;
Statement s = new ReturnStatement(Loc.initial, e);
funcdecl.fbody = new CompoundStatement(Loc.initial, funcdecl.fbody, s);
funcdecl.hasReturnExp |= (funcdecl.hasReturnExp & 1 ? 16 : 1);
}
assert(!funcdecl.returnLabel);
}
else
{
const(bool) inlineAsm = (funcdecl.hasReturnExp & 8) != 0;
if ((blockexit & BE.fallthru) && f.next.ty != Tvoid && !inlineAsm)
{
Expression e;
if (!funcdecl.hasReturnExp)
funcdecl.error("has no `return` statement, but is expected to return a value of type `%s`", f.next.toChars());
else
funcdecl.error("no `return exp;` or `assert(0);` at end of function");
if (global.params.useAssert == CHECKENABLE.on && !global.params.useInline)
{
/* Add an assert(0, msg); where the missing return
* should be.
*/
e = new AssertExp(funcdecl.endloc, IntegerExp.literal!0, new StringExp(funcdecl.loc, "missing return expression"));
}
else
e = new HaltExp(funcdecl.endloc);
e = new CommaExp(Loc.initial, e, f.next.defaultInit(Loc.initial));
e = e.expressionSemantic(sc2);
Statement s = new ExpStatement(Loc.initial, e);
funcdecl.fbody = new CompoundStatement(Loc.initial, funcdecl.fbody, s);
}
}
if (funcdecl.returns)
{
bool implicit0 = addReturn0();
Type tret = implicit0 ? Type.tint32 : f.next;
assert(tret.ty != Tvoid);
if (funcdecl.vresult || funcdecl.returnLabel)
funcdecl.buildResultVar(scout ? scout : sc2, tret);
/* Cannot move this loop into NrvoWalker, because
* returns[i] may be in the nested delegate for foreach-body.
*/
for (size_t i = 0; i < funcdecl.returns.dim; i++)
{
ReturnStatement rs = (*funcdecl.returns)[i];
Expression exp = rs.exp;
if (exp.op == TOK.error)
continue;
if (tret.ty == Terror)
{
// https://issues.dlang.org/show_bug.cgi?id=13702
exp = checkGC(sc2, exp);
continue;
}
/* If the expression in the return statement (exp) cannot be implicitly
* converted to the return type (tret) of the function and if the
* type of the expression is type isolated, then it may be possible
* that a promotion to `immutable` or `inout` (through a cast) will
* match the return type.
*/
if (!exp.implicitConvTo(tret) && funcdecl.isTypeIsolated(exp.type))
{
/* https://issues.dlang.org/show_bug.cgi?id=20073
*
* The problem is that if the type of the returned expression (exp.type)
* is an aggregated declaration with an alias this, the alias this may be
* used for the conversion testing without it being an isolated type.
*
* To make sure this does not happen, we can test here the implicit conversion
* only for the aggregated declaration type by using `implicitConvToWithoutAliasThis`.
* The implicit conversion with alias this is taken care of later.
*/
AggregateDeclaration aggDecl = isAggregate(exp.type);
TypeStruct tstruct;
TypeClass tclass;
bool hasAliasThis;
if (aggDecl && aggDecl.aliasthis)
{
hasAliasThis = true;
tclass = exp.type.isTypeClass();
if (!tclass)
tstruct = exp.type.isTypeStruct();
assert(tclass || tstruct);
}
if (hasAliasThis)
{
if (tclass)
{
if ((cast(TypeClass)(exp.type.immutableOf())).implicitConvToWithoutAliasThis(tret))
exp = exp.castTo(sc2, exp.type.immutableOf());
else if ((cast(TypeClass)(exp.type.wildOf())).implicitConvToWithoutAliasThis(tret))
exp = exp.castTo(sc2, exp.type.wildOf());
}
else
{
if ((cast(TypeStruct)exp.type.immutableOf()).implicitConvToWithoutAliasThis(tret))
exp = exp.castTo(sc2, exp.type.immutableOf());
else if ((cast(TypeStruct)exp.type.immutableOf()).implicitConvToWithoutAliasThis(tret))
exp = exp.castTo(sc2, exp.type.wildOf());
}
}
else
{
if (exp.type.immutableOf().implicitConvTo(tret))
exp = exp.castTo(sc2, exp.type.immutableOf());
else if (exp.type.wildOf().implicitConvTo(tret))
exp = exp.castTo(sc2, exp.type.wildOf());
}
}
const hasCopyCtor = exp.type.ty == Tstruct && (cast(TypeStruct)exp.type).sym.hasCopyCtor;
// if a copy constructor is present, the return type conversion will be handled by it
if (!(hasCopyCtor && exp.isLvalue()))
exp = exp.implicitCastTo(sc2, tret);
if (f.isref)
{
// Function returns a reference
exp = exp.toLvalue(sc2, exp);
checkReturnEscapeRef(sc2, exp, false);
}
else
{
exp = exp.optimize(WANTvalue);
/* https://issues.dlang.org/show_bug.cgi?id=10789
* If NRVO is not possible, all returned lvalues should call their postblits.
*/
if (!funcdecl.nrvo_can)
exp = doCopyOrMove(sc2, exp, f.next);
if (tret.hasPointers())
checkReturnEscape(sc2, exp, false);
}
exp = checkGC(sc2, exp);
if (funcdecl.vresult)
{
// Create: return vresult = exp;
exp = new BlitExp(rs.loc, funcdecl.vresult, exp);
exp.type = funcdecl.vresult.type;
if (rs.caseDim)
exp = Expression.combine(exp, new IntegerExp(rs.caseDim));
}
else if (funcdecl.tintro && !tret.equals(funcdecl.tintro.nextOf()))
{
exp = exp.implicitCastTo(sc2, funcdecl.tintro.nextOf());
}
rs.exp = exp;
}
}
if (funcdecl.nrvo_var || funcdecl.returnLabel)
{
scope NrvoWalker nw = new NrvoWalker();
nw.fd = funcdecl;
nw.sc = sc2;
nw.visitStmt(funcdecl.fbody);
}
sc2 = sc2.pop();
}
funcdecl.frequire = funcdecl.mergeFrequire(funcdecl.frequire, funcdecl.fdrequireParams);
funcdecl.fensure = funcdecl.mergeFensure(funcdecl.fensure, Id.result, funcdecl.fdensureParams);
Statement freq = funcdecl.frequire;
Statement fens = funcdecl.fensure;
/* Do the semantic analysis on the [in] preconditions and
* [out] postconditions.
*/
if (freq)
{
/* frequire is composed of the [in] contracts
*/
auto sym = new ScopeDsymbol(funcdecl.loc, null);
sym.parent = sc2.scopesym;
sym.endlinnum = funcdecl.endloc.linnum;
sc2 = sc2.push(sym);
sc2.flags = (sc2.flags & ~SCOPE.contract) | SCOPE.require;
// BUG: need to error if accessing out parameters
// BUG: need to disallow returns and throws
// BUG: verify that all in and ref parameters are read
freq = freq.statementSemantic(sc2);
freq.blockExit(funcdecl, false);
funcdecl.eh_none = false;
sc2 = sc2.pop();
if (global.params.useIn == CHECKENABLE.off)
freq = null;
}
if (fens)
{
/* fensure is composed of the [out] contracts
*/
if (f.next.ty == Tvoid && funcdecl.fensures)
{
foreach (e; *funcdecl.fensures)
{
if (e.id)
{
funcdecl.error(e.ensure.loc, "`void` functions have no result");
//fens = null;
}
}
}
sc2 = scout; //push
sc2.flags = (sc2.flags & ~SCOPE.contract) | SCOPE.ensure;
// BUG: need to disallow returns and throws
if (funcdecl.fensure && f.next.ty != Tvoid)
funcdecl.buildResultVar(scout, f.next);
fens = fens.statementSemantic(sc2);
fens.blockExit(funcdecl, false);
funcdecl.eh_none = false;
sc2 = sc2.pop();
if (global.params.useOut == CHECKENABLE.off)
fens = null;
}
if (funcdecl.fbody && funcdecl.fbody.isErrorStatement())
{
}
else
{
auto a = new Statements();
// Merge in initialization of 'out' parameters
if (funcdecl.parameters)
{
for (size_t i = 0; i < funcdecl.parameters.dim; i++)
{
VarDeclaration v = (*funcdecl.parameters)[i];
if (v.storage_class & STC.out_)
{
if (!v._init)
{
v.error("Zero-length `out` parameters are not allowed.");
return;
}
ExpInitializer ie = v._init.isExpInitializer();
assert(ie);
if (auto iec = ie.exp.isConstructExp())
{
// construction occurred in parameter processing
auto ec = new AssignExp(iec.loc, iec.e1, iec.e2);
ec.type = iec.type;
ie.exp = ec;
}
a.push(new ExpStatement(Loc.initial, ie.exp));
}
}
}
if (_arguments)
{
/* Advance to elements[] member of TypeInfo_Tuple with:
* _arguments = v_arguments.elements;
*/
Expression e = new VarExp(Loc.initial, funcdecl.v_arguments);
e = new DotIdExp(Loc.initial, e, Id.elements);
e = new ConstructExp(Loc.initial, _arguments, e);
e = e.expressionSemantic(sc2);
_arguments._init = new ExpInitializer(Loc.initial, e);
auto de = new DeclarationExp(Loc.initial, _arguments);
a.push(new ExpStatement(Loc.initial, de));
}
// Merge contracts together with body into one compound statement
if (freq || fpreinv)
{
if (!freq)
freq = fpreinv;
else if (fpreinv)
freq = new CompoundStatement(Loc.initial, freq, fpreinv);
a.push(freq);
}
if (funcdecl.fbody)
a.push(funcdecl.fbody);
if (fens || fpostinv)
{
if (!fens)
fens = fpostinv;
else if (fpostinv)
fens = new CompoundStatement(Loc.initial, fpostinv, fens);
auto ls = new LabelStatement(Loc.initial, Id.returnLabel, fens);
funcdecl.returnLabel.statement = ls;
a.push(funcdecl.returnLabel.statement);
if (f.next.ty != Tvoid && funcdecl.vresult)
{
// Create: return vresult;
Expression e = new VarExp(Loc.initial, funcdecl.vresult);
if (funcdecl.tintro)
{
e = e.implicitCastTo(sc, funcdecl.tintro.nextOf());
e = e.expressionSemantic(sc);
}
auto s = new ReturnStatement(Loc.initial, e);
a.push(s);
}
}
if (addReturn0())
{
// Add a return 0; statement
Statement s = new ReturnStatement(Loc.initial, IntegerExp.literal!0);
a.push(s);
}
Statement sbody = new CompoundStatement(Loc.initial, a);
/* Append destructor calls for parameters as finally blocks.
*/
if (funcdecl.parameters)
{
foreach (v; *funcdecl.parameters)
{
if (v.storage_class & (STC.ref_ | STC.out_ | STC.lazy_))
continue;
if (v.needsScopeDtor())
{
// same with ExpStatement.scopeCode()
Statement s = new DtorExpStatement(Loc.initial, v.edtor, v);
v.storage_class |= STC.nodtor;
s = s.statementSemantic(sc2);
bool isnothrow = f.isnothrow & !(funcdecl.flags & FUNCFLAG.nothrowInprocess);
const blockexit = s.blockExit(funcdecl, isnothrow);
if (blockexit & BE.throw_)
funcdecl.eh_none = false;
if (f.isnothrow && isnothrow && blockexit & BE.throw_)
error(funcdecl.loc, "`nothrow` %s `%s` may throw", funcdecl.kind(), funcdecl.toPrettyChars());
if (funcdecl.flags & FUNCFLAG.nothrowInprocess && blockexit & BE.throw_)
f.isnothrow = false;
if (sbody.blockExit(funcdecl, f.isnothrow) == BE.fallthru)
sbody = new CompoundStatement(Loc.initial, sbody, s);
else
sbody = new TryFinallyStatement(Loc.initial, sbody, s);
}
}
}
// from this point on all possible 'throwers' are checked
funcdecl.flags &= ~FUNCFLAG.nothrowInprocess;
if (funcdecl.isSynchronized())
{
/* Wrap the entire function body in a synchronized statement
*/
ClassDeclaration cd = funcdecl.toParentDecl().isClassDeclaration();
if (cd)
{
if (!global.params.is64bit && global.params.isWindows && !funcdecl.isStatic() && !sbody.usesEH() && !global.params.trace)
{
/* The back end uses the "jmonitor" hack for syncing;
* no need to do the sync at this level.
*/
}
else
{
Expression vsync;
if (funcdecl.isStatic())
{
// The monitor is in the ClassInfo
vsync = new DotIdExp(funcdecl.loc, symbolToExp(cd, funcdecl.loc, sc2, false), Id.classinfo);
}
else
{
// 'this' is the monitor
vsync = new VarExp(funcdecl.loc, funcdecl.vthis);
if (funcdecl.isThis2)
{
vsync = new PtrExp(funcdecl.loc, vsync);
vsync = new IndexExp(funcdecl.loc, vsync, IntegerExp.literal!0);
}
}
sbody = new PeelStatement(sbody); // don't redo semantic()
sbody = new SynchronizedStatement(funcdecl.loc, vsync, sbody);
sbody = sbody.statementSemantic(sc2);
}
}
else
{
funcdecl.error("synchronized function `%s` must be a member of a class", funcdecl.toChars());
}
}
// If declaration has no body, don't set sbody to prevent incorrect codegen.
if (funcdecl.fbody || funcdecl.allowsContractWithoutBody())
funcdecl.fbody = sbody;
}
// Check for undefined labels
if (funcdecl.labtab)
foreach (keyValue; funcdecl.labtab.tab.asRange)
{
//printf(" KV: %s = %s\n", keyValue.key.toChars(), keyValue.value.toChars());
LabelDsymbol label = cast(LabelDsymbol)keyValue.value;
if (!label.statement && (!label.deleted || label.iasm))
{
funcdecl.error("label `%s` is undefined", label.toChars());
}
}
// Fix up forward-referenced gotos
if (funcdecl.gotos)
{
for (size_t i = 0; i < funcdecl.gotos.dim; ++i)
{
(*funcdecl.gotos)[i].checkLabel();
}
}
if (funcdecl.naked && (funcdecl.fensures || funcdecl.frequires))
funcdecl.error("naked assembly functions with contracts are not supported");
sc2.ctorflow.callSuper = CSX.none;
sc2.pop();
}
if (funcdecl.checkClosure())
{
// We should be setting errors here instead of relying on the global error count.
//errors = true;
}
/* If function survived being marked as impure, then it is pure
*/
if (funcdecl.flags & FUNCFLAG.purityInprocess)
{
funcdecl.flags &= ~FUNCFLAG.purityInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.purity = PURE.fwdref;
}
if (funcdecl.flags & FUNCFLAG.safetyInprocess)
{
funcdecl.flags &= ~FUNCFLAG.safetyInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.trust = TRUST.safe;
}
if (funcdecl.flags & FUNCFLAG.nogcInprocess)
{
funcdecl.flags &= ~FUNCFLAG.nogcInprocess;
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isnogc = true;
}
if (funcdecl.flags & FUNCFLAG.returnInprocess)
{
funcdecl.flags &= ~FUNCFLAG.returnInprocess;
if (funcdecl.storage_class & STC.return_)
{
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isreturn = true;
if (funcdecl.storage_class & STC.returninferred)
f.isreturninferred = true;
}
}
funcdecl.flags &= ~FUNCFLAG.inferScope;
// Eliminate maybescope's
{
// Create and fill array[] with maybe candidates from the `this` and the parameters
VarDeclaration[] array = void;
VarDeclaration[10] tmp = void;
size_t dim = (funcdecl.vthis !is null) + (funcdecl.parameters ? funcdecl.parameters.dim : 0);
if (dim <= tmp.length)
array = tmp[0 .. dim];
else
{
auto ptr = cast(VarDeclaration*)mem.xmalloc(dim * VarDeclaration.sizeof);
array = ptr[0 .. dim];
}
size_t n = 0;
if (funcdecl.vthis)
array[n++] = funcdecl.vthis;
if (funcdecl.parameters)
{
foreach (v; *funcdecl.parameters)
{
array[n++] = v;
}
}
eliminateMaybeScopes(array[0 .. n]);
if (dim > tmp.length)
mem.xfree(array.ptr);
}
// Infer STC.scope_
if (funcdecl.parameters && !funcdecl.errors)
{
assert(f.parameterList.length == funcdecl.parameters.dim);
foreach (u, p; f.parameterList)
{
auto v = (*funcdecl.parameters)[u];
if (v.storage_class & STC.maybescope)
{
//printf("Inferring scope for %s\n", v.toChars());
notMaybeScope(v);
v.storage_class |= STC.scope_ | STC.scopeinferred;
p.storageClass |= STC.scope_ | STC.scopeinferred;
assert(!(p.storageClass & STC.maybescope));
}
}
}
if (funcdecl.vthis && funcdecl.vthis.storage_class & STC.maybescope)
{
notMaybeScope(funcdecl.vthis);
funcdecl.vthis.storage_class |= STC.scope_ | STC.scopeinferred;
f.isScopeQual = true;
f.isscopeinferred = true;
}
// reset deco to apply inference result to mangled name
if (f != funcdecl.type)
f.deco = null;
// Do semantic type AFTER pure/nothrow inference.
if (!f.deco && funcdecl.ident != Id.xopEquals && funcdecl.ident != Id.xopCmp)
{
sc = sc.push();
if (funcdecl.isCtorDeclaration()) // https://issues.dlang.org/show_bug.cgi?id=#15665
sc.flags |= SCOPE.ctor;
sc.stc = 0;
sc.linkage = funcdecl.linkage; // https://issues.dlang.org/show_bug.cgi?id=8496
funcdecl.type = f.typeSemantic(funcdecl.loc, sc);
sc = sc.pop();
}
// Do live analysis
if (global.params.useDIP1021 && funcdecl.fbody && funcdecl.type.ty != Terror &&
funcdecl.type.isTypeFunction().islive)
{
oblive(funcdecl);
}
/* If this function had instantiated with gagging, error reproduction will be
* done by TemplateInstance::semantic.
* Otherwise, error gagging should be temporarily ungagged by functionSemantic3.
*/
funcdecl.semanticRun = PASS.semantic3done;
funcdecl.semantic3Errors = (global.errors != oldErrors) || (funcdecl.fbody && funcdecl.fbody.isErrorStatement());
if (funcdecl.type.ty == Terror)
funcdecl.errors = true;
//printf("-FuncDeclaration::semantic3('%s.%s', sc = %p, loc = %s)\n", parent.toChars(), toChars(), sc, loc.toChars());
//fflush(stdout);
}
override void visit(CtorDeclaration ctor)
{
//printf("CtorDeclaration()\n%s\n", ctor.fbody.toChars());
if (ctor.semanticRun >= PASS.semantic3)
return;
/* If any of the fields of the aggregate have a destructor, add
* scope (failure) { this.fieldDtor(); }
* as the first statement of the constructor (unless the constructor
* doesn't define a body - @disable, extern)
*.It is not necessary to add it after
* each initialization of a field, because destruction of .init constructed
* structs should be benign.
* https://issues.dlang.org/show_bug.cgi?id=14246
*/
AggregateDeclaration ad = ctor.isMemberDecl();
if (ctor.fbody && ad && ad.fieldDtor && global.params.dtorFields)
{
/* Generate:
* this.fieldDtor()
*/
Expression e = new ThisExp(ctor.loc);
e.type = ad.type.mutableOf();
e = new DotVarExp(ctor.loc, e, ad.fieldDtor, false);
e = new CallExp(ctor.loc, e);
auto sexp = new ExpStatement(ctor.loc, e);
auto ss = new ScopeStatement(ctor.loc, sexp, ctor.loc);
version (all)
{
/* Generate:
* try { ctor.fbody; }
* catch (Exception __o)
* { this.fieldDtor(); throw __o; }
* This differs from the alternate scope(failure) version in that an Exception
* is caught rather than a Throwable. This enables the optimization whereby
* the try-catch can be removed if ctor.fbody is nothrow. (nothrow only
* applies to Exception.)
*/
Identifier id = Identifier.generateId("__o");
auto ts = new ThrowStatement(ctor.loc, new IdentifierExp(ctor.loc, id));
auto handler = new CompoundStatement(ctor.loc, ss, ts);
auto catches = new Catches();
auto ctch = new Catch(ctor.loc, getException(), id, handler);
catches.push(ctch);
ctor.fbody = new TryCatchStatement(ctor.loc, ctor.fbody, catches);
}
else
{
/* Generate:
* scope (failure) { this.fieldDtor(); }
* Hopefully we can use this version someday when scope(failure) catches
* Exception instead of Throwable.
*/
auto s = new ScopeGuardStatement(ctor.loc, TOK.onScopeFailure, ss);
ctor.fbody = new CompoundStatement(ctor.loc, s, ctor.fbody);
}
}
visit(cast(FuncDeclaration)ctor);
}
override void visit(Nspace ns)
{
if (ns.semanticRun >= PASS.semantic3)
return;
ns.semanticRun = PASS.semantic3;
static if (LOG)
{
printf("Nspace::semantic3('%s')\n", ns.toChars());
}
if (ns.members)
{
sc = sc.push(ns);
sc.linkage = LINK.cpp;
foreach (s; *ns.members)
{
s.semantic3(sc);
}
sc.pop();
}
}
override void visit(AttribDeclaration ad)
{
Dsymbols* d = ad.include(sc);
if (d)
{
Scope* sc2 = ad.newScope(sc);
for (size_t i = 0; i < d.dim; i++)
{
Dsymbol s = (*d)[i];
s.semantic3(sc2);
}
if (sc2 != sc)
sc2.pop();
}
}
override void visit(AggregateDeclaration ad)
{
//printf("AggregateDeclaration::semantic3(sc=%p, %s) type = %s, errors = %d\n", sc, toChars(), type.toChars(), errors);
if (!ad.members)
return;
StructDeclaration sd = ad.isStructDeclaration();
if (!sc) // from runDeferredSemantic3 for TypeInfo generation
{
assert(sd);
sd.semanticTypeInfoMembers();
return;
}
auto sc2 = ad.newScope(sc);
for (size_t i = 0; i < ad.members.dim; i++)
{
Dsymbol s = (*ad.members)[i];
s.semantic3(sc2);
}
sc2.pop();
// don't do it for unused deprecated types
// or error ypes
if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated != DiagnosticReporting.error) && (ad.type && ad.type.ty != Terror))
{
// Evaluate: RTinfo!type
auto tiargs = new Objects();
tiargs.push(ad.type);
auto ti = Pool!TemplateInstance.make(ad.loc, Type.rtinfo, tiargs);
Scope* sc3 = ti.tempdecl._scope.startCTFE();
sc3.tinst = sc.tinst;
sc3.minst = sc.minst;
if (ad.isDeprecated())
sc3.stc |= STC.deprecated_;
ti.dsymbolSemantic(sc3);
ti.semantic2(sc3);
ti.semantic3(sc3);
auto e = symbolToExp(ti.toAlias(), Loc.initial, sc3, false);
sc3.endCTFE();
e = e.ctfeInterpret();
ad.getRTInfo = e;
}
if (sd)
sd.semanticTypeInfoMembers();
ad.semanticRun = PASS.semantic3done;
}
}
private struct FuncDeclSem3
{
// The FuncDeclaration subject to Semantic analysis
FuncDeclaration funcdecl;
// Scope of analysis
Scope* sc;
this(FuncDeclaration fd,Scope* s)
{
funcdecl = fd;
sc = s;
}
/* Checks that the overriden functions (if any) have in contracts if
* funcdecl has an in contract.
*/
void checkInContractOverrides()
{
if (funcdecl.frequires)
{
for (size_t i = 0; i < funcdecl.foverrides.dim; i++)
{
FuncDeclaration fdv = funcdecl.foverrides[i];
if (fdv.fbody && !fdv.frequires)
{
funcdecl.error("cannot have an in contract when overridden function `%s` does not have an in contract", fdv.toPrettyChars());
break;
}
}
}
}
}
|
D
|
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM ROCKTYPE
340 40 5 0 80 100 -33.7999992 150.699997 1768 10 10 intrusives
325 55 5 0 80 100 -33.9000015 151.300003 1766 10 10 intrusives, basalt
330.100006 45.9000015 3.9000001 600 80 100 -33.7999992 150.800003 83 7.5999999 7.5999999 intrusives, breccia
307.200012 48.0999985 3.4000001 228.600006 80 100 -33.7000008 150.800003 82 6.19999981 6.19999981 intrusives, basalts, breccias
342.100006 57.7000008 19.5 40.7999992 80 100 -33.7999992 151.100006 87 35.5999985 35.5999985 intrusives, breccia
317 54 8 63 80 100 -34.5 150.300003 8442 12.3999996 12.8999996 intrusives, dolerite
338.200012 55.2000008 5.9000001 238.800003 80 100 -35.2999992 150.399994 240 10.6000004 10.6000004 intrusives, porphyry
319.399994 59.0999985 2.29999995 300.799988 80 100 -33.7000008 151.100006 238 4.19999981 4.19999981 extrusives
|
D
|
module textinput;
import observable;
import derelict.sdl2.sdl;
import std.stdio;
import std.utf;
/**
* a server that, when directing SDL events to it and is set reading, records
* what is written on the keyboard
**/
class TextInput : Observable {
private string textInput;
private bool reading;
public this() {
super(1); // one observer allowed
this.reading = false;
}
public void start() {
SDL_StartTextInput();
this.reading = true;
}
public void stop() {
this.reading = false;
SDL_StopTextInput();
this.notifyObservers();
}
public void setText(string text) {
this.textInput = text;
this.notifyObservers();
}
public string getTextInput() {
return this.textInput;
}
public bool isReading() {
return this.reading;
}
public void handleEvent(SDL_Event event) {
if (reading) { // waiting for TEXTINPUT events
if (event.type == SDL_TEXTINPUT) {
char[] text;
text ~= event.text.text;
size_t size;
//~ dchar u = decodeFront!(char[])(text, size);
dchar u = decodeFront(text, size);
this.textInput ~= u;
this.notifyObservers();
}
// key down
else if (event.type == SDL_KEYDOWN) {
// input stop
if (event.key.keysym.sym == SDLK_RETURN) {
this.stop();
}
// backspace --> delete last character
else if (event.key.keysym.sym == SDLK_BACKSPACE) {
// converting text to utf32 so length corresponds to number
// of characters
dstring tmp = toUTF32(this.textInput);
if (tmp.length > 0) {
tmp.length = tmp.length - 1;
this.textInput = toUTF8(tmp);
this.notifyObservers();
}
}
}
}
}
}
|
D
|
module org.serviio.library.online.metadata.FeedItem;
import java.lang.String;
import java.io.Serializable;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.serviio.library.online.metadata.OnlineContainerItem;
import org.serviio.library.online.metadata.Feed;
public class FeedItem : OnlineContainerItem!(Feed) , Serializable
{
private static const long serialVersionUID = -1114391919989682022L;
private Map!(String, URL) links;
public this(Feed parentFeed, int feedOrder)
{
links = new HashMap!(String, URL)();
parentContainer = parentFeed;
order = feedOrder;
}
public Map!(String, URL) getLinks()
{
return links;
}
}
/* Location: D:\Program Files\Serviio\lib\serviio.jar
* Qualified Name: org.serviio.library.online.metadata.FeedItem
* JD-Core Version: 0.6.2
*/
|
D
|
/**
* Copyright © DiamondMVC 2019
* License: MIT (https://github.com/DiamondMVC/Diamond/blob/master/LICENSE)
* Author: Jacob Jensen (bausshf)
*/
module diamond.data.i18n.messages;
import diamond.core.apptype;
static if (isWeb)
{
import diamond.http;
/// Alias for an associative array.
private alias Language = string[string];
/// A collection of localization messages.
private __gshared Language[string] _messages;
/// The default language.
package(diamond) __gshared string _defaultLanguage;
/**
* Sets the default language of the application.
* Params:
* language = The language.
*/
void setDefaultLanguage(string language)
{
_defaultLanguage = language;
}
/**
* Gets a message.
* Params:
* clent = The client to use the language of.
* key = The key of the message to retrieve.
* Returns:
* The message if found for the client's language, otherwise it will attempt to get the default language's message and if that fails too then it returns an empty string.
*/
string getMessage(HttpClient client, string key)
{
return getMessage(client.language, key);
}
/**
* Gets a message.
* Params:
* languageName = The language to retrieve a message from.
* key = The key of the message to retrieve.
* Returns:
* The message if found for the specified language, otherwise it will attempt to get the default language's message and if that fails too then it returns an empty string.
*/
string getMessage(string languageName, string key)
{
auto language = _messages.get(languageName, null);
if (!language)
{
language = _messages.get(_defaultLanguage, null);
}
if (!language)
{
return "";
}
return language.get(key, "");
}
/**
* Adds a message to a specific language.
* Params:
* language = The language to add the message to.
* key = The key of the message.
* message = The message to add.
*/
void addMessage(string language, string key, string message)
{
_messages[language][key] = message;
}
}
|
D
|
/home/eduardo/Projects/cursos/rust-course/quick-question-mark-operator/target/rls/debug/deps/quick_question_mark_operator-cdeb5bdb4b85409a.rmeta: src/main.rs
/home/eduardo/Projects/cursos/rust-course/quick-question-mark-operator/target/rls/debug/deps/quick_question_mark_operator-cdeb5bdb4b85409a.d: src/main.rs
src/main.rs:
|
D
|
module wsf.spec.tileset;
import wsf.serialization;
/**
A region corrsponding to a file in the tileset
*/
struct TileRegion {
/**
The origin file
*/
string file;
/**
Where the tile region starts
*/
int x;
/**
Where the tile region starts
*/
int y;
/**
Width of tile region
*/
int width;
/**
Height of tile region
*/
int height;
}
/**
A tileset
*/
struct Tileset {
/**
Width of tileset texture
*/
uint width;
/**
Height of tileset texture
*/
uint height;
/**
8-bit RGBA color data
*/
ubyte[] data;
/**
Tile information
*/
TileInfo[] info;
/**
Loaded tile regions
*/
@optional
TileRegion[] regions;
/**
Scrub the region of contents
*/
void scrubRegions() {
regions = [];
}
}
/**
Information about a tile
*/
struct TileInfo {
/**
Numeric id of tile
*/
uint id;
/**
Human readable name
*/
@optional
string name = "%d";
/**
Collission data for tile
*/
ubyte[][] collissionData;
}
|
D
|
// Compiler implementation of the D programming language
// Copyright (c) 1999-2015 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
module ddmd.dtemplate;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import ddmd.aggregate;
import ddmd.aliasthis;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.gluelayer;
import ddmd.dcast;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.dmangle;
import ddmd.dmodule;
import ddmd.doc;
import ddmd.dscope;
import ddmd.dsymbol;
import ddmd.errors;
import ddmd.expression;
import ddmd.func;
import ddmd.globals;
import ddmd.hdrgen;
import ddmd.id;
import ddmd.identifier;
import ddmd.init;
import ddmd.mtype;
import ddmd.opover;
import ddmd.root.aav;
import ddmd.root.array;
import ddmd.root.outbuffer;
import ddmd.root.rootobject;
import ddmd.tokens;
import ddmd.visitor;
private enum LOG = false;
enum IDX_NOTFOUND = 0x12345678;
/********************************************
* These functions substitute for dynamic_cast. dynamic_cast does not work
* on earlier versions of gcc.
*/
extern (C++) Expression isExpression(RootObject o)
{
//return dynamic_cast<Expression *>(o);
if (!o || o.dyncast() != DYNCAST_EXPRESSION)
return null;
return cast(Expression)o;
}
extern (C++) Dsymbol isDsymbol(RootObject o)
{
//return dynamic_cast<Dsymbol *>(o);
if (!o || o.dyncast() != DYNCAST_DSYMBOL)
return null;
return cast(Dsymbol)o;
}
extern (C++) Type isType(RootObject o)
{
//return dynamic_cast<Type *>(o);
if (!o || o.dyncast() != DYNCAST_TYPE)
return null;
return cast(Type)o;
}
extern (C++) Tuple isTuple(RootObject o)
{
//return dynamic_cast<Tuple *>(o);
if (!o || o.dyncast() != DYNCAST_TUPLE)
return null;
return cast(Tuple)o;
}
extern (C++) Parameter isParameter(RootObject o)
{
//return dynamic_cast<Parameter *>(o);
if (!o || o.dyncast() != DYNCAST_PARAMETER)
return null;
return cast(Parameter)o;
}
/**************************************
* Is this Object an error?
*/
extern (C++) bool isError(RootObject o)
{
Type t = isType(o);
if (t)
return (t.ty == Terror);
Expression e = isExpression(o);
if (e)
return (e.op == TOKerror || !e.type || e.type.ty == Terror);
Tuple v = isTuple(o);
if (v)
return arrayObjectIsError(&v.objects);
Dsymbol s = isDsymbol(o);
assert(s);
if (s.errors)
return true;
return s.parent ? isError(s.parent) : false;
}
/**************************************
* Are any of the Objects an error?
*/
extern (C++) bool arrayObjectIsError(Objects* args)
{
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
if (isError(o))
return true;
}
return false;
}
/***********************
* Try to get arg as a type.
*/
extern (C++) Type getType(RootObject o)
{
Type t = isType(o);
if (!t)
{
Expression e = isExpression(o);
if (e)
t = e.type;
}
return t;
}
extern (C++) Dsymbol getDsymbol(RootObject oarg)
{
//printf("getDsymbol()\n");
//printf("e %p s %p t %p v %p\n", isExpression(oarg), isDsymbol(oarg), isType(oarg), isTuple(oarg));
Dsymbol sa;
Expression ea = isExpression(oarg);
if (ea)
{
// Try to convert Expression to symbol
if (ea.op == TOKvar)
sa = (cast(VarExp)ea).var;
else if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
}
else
sa = null;
}
else
{
// Try to convert Type to symbol
Type ta = isType(oarg);
if (ta)
sa = ta.toDsymbol(null);
else
sa = isDsymbol(oarg); // if already a symbol
}
return sa;
}
extern (C++) Expression getValue(ref Dsymbol s)
{
Expression e = null;
if (s)
{
VarDeclaration v = s.isVarDeclaration();
if (v && v.storage_class & STCmanifest)
{
e = v.getConstInitializer();
}
}
return e;
}
/***********************
* Try to get value from manifest constant
*/
extern (C++) Expression getValue(Expression e)
{
if (e && e.op == TOKvar)
{
VarDeclaration v = (cast(VarExp)e).var.isVarDeclaration();
if (v && v.storage_class & STCmanifest)
{
e = v.getConstInitializer();
}
}
return e;
}
/******************************
* If o1 matches o2, return true.
* Else, return false.
*/
extern (C++) bool match(RootObject o1, RootObject o2)
{
static Expression getExpression(RootObject o)
{
auto s = isDsymbol(o);
return s ? .getValue(s) : .getValue(isExpression(o));
}
enum debugPrint = 0;
static if (debugPrint)
{
printf("match() o1 = %p %s (%d), o2 = %p %s (%d)\n",
o1, o1.toChars(), o1.dyncast(), o2, o2.toChars(), o2.dyncast());
}
/* A proper implementation of the various equals() overrides
* should make it possible to just do o1.equals(o2), but
* we'll do that another day.
*/
/* Manifest constants should be compared by their values,
* at least in template arguments.
*/
if (auto t1 = isType(o1))
{
auto t2 = isType(o2);
if (!t2)
goto Lnomatch;
static if (debugPrint)
{
printf("\tt1 = %s\n", t1.toChars());
printf("\tt2 = %s\n", t2.toChars());
}
if (!t1.equals(t2))
goto Lnomatch;
goto Lmatch;
}
if (auto e1 = getExpression(o1))
{
auto e2 = getExpression(o2);
if (!e2)
goto Lnomatch;
static if (debugPrint)
{
printf("\te1 = %s '%s' %s\n", e1.type.toChars(), Token.toChars(e1.op), e1.toChars());
printf("\te2 = %s '%s' %s\n", e2.type.toChars(), Token.toChars(e2.op), e2.toChars());
}
if (!e1.equals(e2))
goto Lnomatch;
goto Lmatch;
}
if (auto s1 = isDsymbol(o1))
{
auto s2 = isDsymbol(o2);
if (!s2)
goto Lnomatch;
static if (debugPrint)
{
printf("\ts1 = %s \n", s1.kind(), s1.toChars());
printf("\ts2 = %s \n", s2.kind(), s2.toChars());
}
if (!s1.equals(s2))
goto Lnomatch;
if (s1.parent != s2.parent && !s1.isFuncDeclaration() && !s2.isFuncDeclaration())
goto Lnomatch;
goto Lmatch;
}
if (auto u1 = isTuple(o1))
{
auto u2 = isTuple(o2);
if (!u2)
goto Lnomatch;
static if (debugPrint)
{
printf("\tu1 = %s\n", u1.toChars());
printf("\tu2 = %s\n", u2.toChars());
}
if (!arrayObjectMatch(&u1.objects, &u2.objects))
goto Lnomatch;
goto Lmatch;
}
Lmatch:
static if (debugPrint)
printf("\t-> match\n");
return true;
Lnomatch:
static if (debugPrint)
printf("\t-> nomatch\n");
return false;
}
/************************************
* Match an array of them.
*/
extern (C++) int arrayObjectMatch(Objects* oa1, Objects* oa2)
{
if (oa1 == oa2)
return 1;
if (oa1.dim != oa2.dim)
return 0;
for (size_t j = 0; j < oa1.dim; j++)
{
RootObject o1 = (*oa1)[j];
RootObject o2 = (*oa2)[j];
if (!match(o1, o2))
{
return 0;
}
}
return 1;
}
/************************************
* Return hash of Objects.
*/
extern (C++) hash_t arrayObjectHash(Objects* oa1)
{
hash_t hash = 0;
for (size_t j = 0; j < oa1.dim; j++)
{
/* Must follow the logic of match()
*/
RootObject o1 = (*oa1)[j];
if (Type t1 = isType(o1))
hash += cast(size_t)t1.deco;
else
{
Dsymbol s1 = isDsymbol(o1);
Expression e1 = s1 ? getValue(s1) : getValue(isExpression(o1));
if (e1)
{
if (e1.op == TOKint64)
{
IntegerExp ne = cast(IntegerExp)e1;
hash += cast(size_t)ne.getInteger();
}
}
else if (s1)
{
FuncAliasDeclaration fa1 = s1.isFuncAliasDeclaration();
if (fa1)
s1 = fa1.toAliasFunc();
hash += cast(size_t)cast(void*)s1.getIdent() + cast(size_t)cast(void*)s1.parent;
}
else if (Tuple u1 = isTuple(o1))
hash += arrayObjectHash(&u1.objects);
}
}
return hash;
}
extern (C++) RootObject objectSyntaxCopy(RootObject o)
{
if (!o)
return null;
if (Type t = isType(o))
return t.syntaxCopy();
if (Expression e = isExpression(o))
return e.syntaxCopy();
return o;
}
extern (C++) final class Tuple : RootObject
{
public:
Objects objects;
// kludge for template.isType()
override int dyncast()
{
return DYNCAST_TUPLE;
}
override const(char)* toChars()
{
return objects.toChars();
}
}
struct TemplatePrevious
{
TemplatePrevious* prev;
Scope* sc;
Objects* dedargs;
}
/***********************************************************
*/
extern (C++) final class TemplateDeclaration : ScopeDsymbol
{
public:
TemplateParameters* parameters; // array of TemplateParameter's
TemplateParameters* origParameters; // originals for Ddoc
Expression constraint;
// Hash table to look up TemplateInstance's of this TemplateDeclaration
Array!(TemplateInstances*) buckets;
size_t numinstances; // number of instances in the hash table
TemplateDeclaration overnext; // next overloaded TemplateDeclaration
TemplateDeclaration overroot; // first in overnext list
FuncDeclaration funcroot; // first function in unified overload list
Dsymbol onemember; // if !=null then one member of this template
bool literal; // this template declaration is a literal
bool ismixin; // template declaration is only to be used as a mixin
bool isstatic; // this is static template declaration
Prot protection;
// threaded list of previous instantiation attempts on stack
TemplatePrevious* previous;
extern (D) this(Loc loc, Identifier id, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin = false, bool literal = false)
{
super(id);
static if (LOG)
{
printf("TemplateDeclaration(this = %p, id = '%s')\n", this, id.toChars());
}
version (none)
{
if (parameters)
for (int i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
//printf("\tparameter[%d] = %p\n", i, tp);
TemplateTypeParameter ttp = tp.isTemplateTypeParameter();
if (ttp)
{
printf("\tparameter[%d] = %s : %s\n", i, tp.ident.toChars(), ttp.specType ? ttp.specType.toChars() : "");
}
}
}
this.loc = loc;
this.parameters = parameters;
this.origParameters = parameters;
this.constraint = constraint;
this.members = decldefs;
this.literal = literal;
this.ismixin = ismixin;
this.isstatic = true;
this.protection = Prot(PROTundefined);
// Compute in advance for Ddoc's use
// Bugzilla 11153: ident could be NULL if parsing fails.
if (members && ident)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, ident) && s)
{
onemember = s;
s.parent = this;
}
}
}
override Dsymbol syntaxCopy(Dsymbol)
{
//printf("TemplateDeclaration::syntaxCopy()\n");
TemplateParameters* p = null;
if (parameters)
{
p = new TemplateParameters();
p.setDim(parameters.dim);
for (size_t i = 0; i < p.dim; i++)
(*p)[i] = (*parameters)[i].syntaxCopy();
}
return new TemplateDeclaration(loc, ident, p, constraint ? constraint.syntaxCopy() : null, Dsymbol.arraySyntaxCopy(members), ismixin, literal);
}
override void semantic(Scope* sc)
{
static if (LOG)
{
printf("TemplateDeclaration::semantic(this = %p, id = '%s')\n", this, ident.toChars());
printf("sc->stc = %llx\n", sc.stc);
printf("sc->module = %s\n", sc._module.toChars());
}
if (semanticRun != PASSinit)
return; // semantic() already run
semanticRun = PASSsemantic;
// Remember templates defined in module object that we need to know about
if (sc._module && sc._module.ident == Id.object)
{
if (ident == Id.RTInfo)
Type.rtinfo = this;
}
/* Remember Scope for later instantiations, but make
* a copy since attributes can change.
*/
if (!this._scope)
{
this._scope = sc.copy();
this._scope.setNoFree();
}
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = sc.parent;
Scope* paramscope = sc.push(paramsym);
paramscope.stc = 0;
if (!parent)
parent = sc.parent;
isstatic = toParent().isModule() || (_scope.stc & STCstatic);
protection = sc.protection;
if (global.params.doDocComments)
{
origParameters = new TemplateParameters();
origParameters.setDim(parameters.dim);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
(*origParameters)[i] = tp.syntaxCopy();
}
}
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (!tp.declareParameter(paramscope))
{
error(tp.loc, "parameter '%s' multiply defined", tp.ident.toChars());
errors = true;
}
if (!tp.semantic(paramscope, parameters))
{
errors = true;
}
if (i + 1 != parameters.dim && tp.isTemplateTupleParameter())
{
error("template tuple parameter must be last one");
errors = true;
}
}
/* Calculate TemplateParameter::dependent
*/
TemplateParameters tparams;
tparams.setDim(1);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
tparams[0] = tp;
for (size_t j = 0; j < parameters.dim; j++)
{
// Skip cases like: X(T : T)
if (i == j)
continue;
if (TemplateTypeParameter ttp = (*parameters)[j].isTemplateTypeParameter())
{
if (reliesOnTident(ttp.specType, &tparams))
tp.dependent = true;
}
else if (TemplateAliasParameter tap = (*parameters)[j].isTemplateAliasParameter())
{
if (reliesOnTident(tap.specType, &tparams) || reliesOnTident(isType(tap.specAlias), &tparams))
{
tp.dependent = true;
}
}
}
}
paramscope.pop();
// Compute again
onemember = null;
if (members)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, ident) && s)
{
onemember = s;
s.parent = this;
}
}
/* BUG: should check:
* o no virtual functions or non-static data members of classes
*/
}
/**********************************
* Overload existing TemplateDeclaration 'this' with the new one 's'.
* Return true if successful; i.e. no conflict.
*/
override bool overloadInsert(Dsymbol s)
{
static if (LOG)
{
printf("TemplateDeclaration::overloadInsert('%s')\n", s.toChars());
}
FuncDeclaration fd = s.isFuncDeclaration();
if (fd)
{
if (funcroot)
return funcroot.overloadInsert(fd);
funcroot = fd;
return funcroot.overloadInsert(this);
}
TemplateDeclaration td = s.isTemplateDeclaration();
if (!td)
return false;
TemplateDeclaration pthis = this;
TemplateDeclaration* ptd;
for (ptd = &pthis; *ptd; ptd = &(*ptd).overnext)
{
}
td.overroot = this;
*ptd = td;
static if (LOG)
{
printf("\ttrue: no conflict\n");
}
return true;
}
override bool hasStaticCtorOrDtor()
{
return false; // don't scan uninstantiated templates
}
override const(char)* kind() const
{
return (onemember && onemember.isAggregateDeclaration()) ? onemember.kind() : "template";
}
override const(char)* toChars()
{
if (literal)
return Dsymbol.toChars();
OutBuffer buf;
HdrGenState hgs;
buf.writestring(ident.toChars());
buf.writeByte('(');
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (i)
buf.writestring(", ");
.toCBuffer(tp, &buf, &hgs);
}
buf.writeByte(')');
if (onemember)
{
FuncDeclaration fd = onemember.isFuncDeclaration();
if (fd && fd.type)
{
TypeFunction tf = cast(TypeFunction)fd.type;
buf.writestring(parametersTypeToChars(tf.parameters, tf.varargs));
}
}
if (constraint)
{
buf.writestring(" if (");
.toCBuffer(constraint, &buf, &hgs);
buf.writeByte(')');
}
return buf.extractString();
}
override Prot prot()
{
return protection;
}
/****************************
* Check to see if constraint is satisfied.
*/
bool evaluateConstraint(TemplateInstance ti, Scope* sc, Scope* paramscope, Objects* dedargs, FuncDeclaration fd)
{
/* Detect recursive attempts to instantiate this template declaration,
* Bugzilla 4072
* void foo(T)(T x) if (is(typeof(foo(x)))) { }
* static assert(!is(typeof(foo(7))));
* Recursive attempts are regarded as a constraint failure.
*/
/* There's a chicken-and-egg problem here. We don't know yet if this template
* instantiation will be a local one (enclosing is set), and we won't know until
* after selecting the correct template. Thus, function we're nesting inside
* is not on the sc scope chain, and this can cause errors in FuncDeclaration::getLevel().
* Workaround the problem by setting a flag to relax the checking on frame errors.
*/
for (TemplatePrevious* p = previous; p; p = p.prev)
{
if (arrayObjectMatch(p.dedargs, dedargs))
{
//printf("recursive, no match p->sc=%p %p %s\n", p->sc, this, this->toChars());
/* It must be a subscope of p->sc, other scope chains are not recursive
* instantiations.
*/
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx == p.sc)
return false;
}
}
/* BUG: should also check for ref param differences
*/
}
TemplatePrevious pr;
pr.prev = previous;
pr.sc = paramscope;
pr.dedargs = dedargs;
previous = ≺ // add this to threaded list
uint nerrors = global.errors;
Scope* scx = paramscope.push(ti);
scx.parent = ti;
scx.tinst = null;
scx.minst = null;
assert(!ti.symtab);
if (fd)
{
/* Declare all the function parameters as variables and add them to the scope
* Making parameters is similar to FuncDeclaration::semantic3
*/
TypeFunction tf = cast(TypeFunction)fd.type;
assert(tf.ty == Tfunction);
scx.parent = fd;
Parameters* fparameters = tf.parameters;
int fvarargs = tf.varargs;
size_t nfparams = Parameter.dim(fparameters);
for (size_t i = 0; i < nfparams; i++)
{
Parameter fparam = Parameter.getNth(fparameters, i);
fparam.storageClass &= (STCin | STCout | STCref | STClazy | STCfinal | STC_TYPECTOR | STCnodtor);
fparam.storageClass |= STCparameter;
if (fvarargs == 2 && i + 1 == nfparams)
fparam.storageClass |= STCvariadic;
}
for (size_t i = 0; i < fparameters.dim; i++)
{
Parameter fparam = (*fparameters)[i];
if (!fparam.ident)
continue;
// don't add it, if it has no name
auto v = new VarDeclaration(loc, fparam.type, fparam.ident, null);
v.storage_class = fparam.storageClass;
v.semantic(scx);
if (!ti.symtab)
ti.symtab = new DsymbolTable();
if (!scx.insert(v))
error("parameter %s.%s is already defined", toChars(), v.toChars());
else
v.parent = fd;
}
if (isstatic)
fd.storage_class |= STCstatic;
fd.vthis = fd.declareThis(scx, fd.isThis());
}
Expression e = constraint.syntaxCopy();
scx = scx.startCTFE();
scx.flags |= SCOPEcondition | SCOPEconstraint;
assert(ti.inst is null);
ti.inst = ti; // temporary instantiation to enable genIdent()
//printf("\tscx->parent = %s %s\n", scx->parent->kind(), scx->parent->toPrettyChars());
e = e.semantic(scx);
e = resolveProperties(scx, e);
ti.inst = null;
ti.symtab = null;
scx = scx.endCTFE();
scx = scx.pop();
previous = pr.prev; // unlink from threaded list
if (nerrors != global.errors) // if any errors from evaluating the constraint, no match
return false;
if (e.op == TOKerror)
return false;
e = e.ctfeInterpret();
if (e.isBool(true))
{
}
else if (e.isBool(false))
return false;
else
{
e.error("constraint %s is not constant or does not evaluate to a bool", e.toChars());
}
return true;
}
/***************************************
* Given that ti is an instance of this TemplateDeclaration,
* deduce the types of the parameters to this, and store
* those deduced types in dedtypes[].
* Input:
* flag 1: don't do semantic() because of dummy types
* 2: don't change types in matchArg()
* Output:
* dedtypes deduced arguments
* Return match level.
*/
MATCH matchWithInstance(Scope* sc, TemplateInstance ti, Objects* dedtypes, Expressions* fargs, int flag)
{
enum LOGM = 0;
static if (LOGM)
{
printf("\n+TemplateDeclaration::matchWithInstance(this = %s, ti = %s, flag = %d)\n", toChars(), ti.toChars(), flag);
}
version (none)
{
printf("dedtypes->dim = %d, parameters->dim = %d\n", dedtypes.dim, parameters.dim);
if (ti.tiargs.dim)
printf("ti->tiargs->dim = %d, [0] = %p\n", ti.tiargs.dim, (*ti.tiargs)[0]);
}
MATCH m;
size_t dedtypes_dim = dedtypes.dim;
dedtypes.zero();
if (errors)
return MATCHnomatch;
size_t parameters_dim = parameters.dim;
int variadic = isVariadic() !is null;
// If more arguments than parameters, no match
if (ti.tiargs.dim > parameters_dim && !variadic)
{
static if (LOGM)
{
printf(" no match: more arguments than parameters\n");
}
return MATCHnomatch;
}
assert(dedtypes_dim == parameters_dim);
assert(dedtypes_dim >= ti.tiargs.dim || variadic);
assert(_scope);
// Set up scope for template parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = _scope.parent;
Scope* paramscope = _scope.push(paramsym);
paramscope.tinst = ti;
paramscope.minst = sc.minst;
paramscope.callsc = sc;
paramscope.stc = 0;
// Attempt type deduction
m = MATCHexact;
for (size_t i = 0; i < dedtypes_dim; i++)
{
MATCH m2;
TemplateParameter tp = (*parameters)[i];
Declaration sparam;
//printf("\targument [%d]\n", i);
static if (LOGM)
{
//printf("\targument [%d] is %s\n", i, oarg ? oarg->toChars() : "null");
TemplateTypeParameter ttp = tp.isTemplateTypeParameter();
if (ttp)
printf("\tparameter[%d] is %s : %s\n", i, tp.ident.toChars(), ttp.specType ? ttp.specType.toChars() : "");
}
m2 = tp.matchArg(ti.loc, paramscope, ti.tiargs, i, parameters, dedtypes, &sparam);
//printf("\tm2 = %d\n", m2);
if (m2 == MATCHnomatch)
{
version (none)
{
printf("\tmatchArg() for parameter %i failed\n", i);
}
goto Lnomatch;
}
if (m2 < m)
m = m2;
if (!flag)
sparam.semantic(paramscope);
if (!paramscope.insert(sparam)) // TODO: This check can make more early
goto Lnomatch;
// in TemplateDeclaration::semantic, and
// then we don't need to make sparam if flags == 0
}
if (!flag)
{
/* Any parameter left without a type gets the type of
* its corresponding arg
*/
for (size_t i = 0; i < dedtypes_dim; i++)
{
if (!(*dedtypes)[i])
{
assert(i < ti.tiargs.dim);
(*dedtypes)[i] = cast(Type)(*ti.tiargs)[i];
}
}
}
if (m > MATCHnomatch && constraint && !flag)
{
if (ti.hasNestedArgs(ti.tiargs, this.isstatic)) // TODO: should gag error
ti.parent = ti.enclosing;
else
ti.parent = this.parent;
// Similar to doHeaderInstantiation
FuncDeclaration fd = onemember ? onemember.isFuncDeclaration() : null;
if (fd)
{
assert(fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)fd.type.syntaxCopy();
fd = new FuncDeclaration(fd.loc, fd.endloc, fd.ident, fd.storage_class, tf);
fd.parent = ti;
fd.inferRetType = true;
// Shouldn't run semantic on default arguments and return type.
for (size_t i = 0; i < tf.parameters.dim; i++)
(*tf.parameters)[i].defaultArg = null;
tf.next = null;
// Resolve parameter types and 'auto ref's.
tf.fargs = fargs;
uint olderrors = global.startGagging();
fd.type = tf.semantic(loc, paramscope);
if (global.endGagging(olderrors))
{
assert(fd.type.ty != Tfunction);
goto Lnomatch;
}
assert(fd.type.ty == Tfunction);
fd.originalType = fd.type; // for mangling
}
// TODO: dedtypes => ti->tiargs ?
if (!evaluateConstraint(ti, sc, paramscope, dedtypes, fd))
goto Lnomatch;
}
static if (LOGM)
{
// Print out the results
printf("--------------------------\n");
printf("template %s\n", toChars());
printf("instance %s\n", ti.toChars());
if (m > MATCHnomatch)
{
for (size_t i = 0; i < dedtypes_dim; i++)
{
TemplateParameter tp = (*parameters)[i];
RootObject oarg;
printf(" [%d]", i);
if (i < ti.tiargs.dim)
oarg = (*ti.tiargs)[i];
else
oarg = null;
tp.print(oarg, (*dedtypes)[i]);
}
}
else
goto Lnomatch;
}
static if (LOGM)
{
printf(" match = %d\n", m);
}
goto Lret;
Lnomatch:
static if (LOGM)
{
printf(" no match\n");
}
m = MATCHnomatch;
Lret:
paramscope.pop();
static if (LOGM)
{
printf("-TemplateDeclaration::matchWithInstance(this = %p, ti = %p) = %d\n", this, ti, m);
}
return m;
}
/********************************************
* Determine partial specialization order of 'this' vs td2.
* Returns:
* match this is at least as specialized as td2
* 0 td2 is more specialized than this
*/
MATCH leastAsSpecialized(Scope* sc, TemplateDeclaration td2, Expressions* fargs)
{
enum LOG_LEASTAS = 0;
static if (LOG_LEASTAS)
{
printf("%s.leastAsSpecialized(%s)\n", toChars(), td2.toChars());
}
/* This works by taking the template parameters to this template
* declaration and feeding them to td2 as if it were a template
* instance.
* If it works, then this template is at least as specialized
* as td2.
*/
scope TemplateInstance ti = new TemplateInstance(Loc(), ident); // create dummy template instance
// Set type arguments to dummy template instance to be types
// generated from the parameters to this template declaration
ti.tiargs = new Objects();
ti.tiargs.reserve(parameters.dim);
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (tp.dependent)
break;
RootObject p = cast(RootObject)tp.dummyArg();
if (!p)
break;
ti.tiargs.push(p);
}
// Temporary Array to hold deduced types
Objects dedtypes;
dedtypes.setDim(td2.parameters.dim);
// Attempt a type deduction
MATCH m = td2.matchWithInstance(sc, ti, &dedtypes, fargs, 1);
if (m > MATCHnomatch)
{
/* A non-variadic template is more specialized than a
* variadic one.
*/
TemplateTupleParameter tp = isVariadic();
if (tp && !tp.dependent && !td2.isVariadic())
goto L1;
static if (LOG_LEASTAS)
{
printf(" matches %d, so is least as specialized\n", m);
}
return m;
}
L1:
static if (LOG_LEASTAS)
{
printf(" doesn't match, so is not as specialized\n");
}
return MATCHnomatch;
}
/*************************************************
* Match function arguments against a specific template function.
* Input:
* ti
* sc instantiation scope
* fd
* tthis 'this' argument if !NULL
* fargs arguments to function
* Output:
* fd Partially instantiated function declaration
* ti->tdtypes Expression/Type deduced template arguments
* Returns:
* match level
* bit 0-3 Match template parameters by inferred template arguments
* bit 4-7 Match template parameters by initial template arguments
*/
MATCH deduceFunctionTemplateMatch(TemplateInstance ti, Scope* sc, ref FuncDeclaration fd, Type tthis, Expressions* fargs)
{
size_t nfparams;
size_t nfargs;
size_t ntargs; // array size of tiargs
size_t fptupindex = IDX_NOTFOUND;
MATCH match = MATCHexact;
MATCH matchTiargs = MATCHexact;
Parameters* fparameters; // function parameter list
int fvarargs; // function varargs
uint wildmatch = 0;
size_t inferStart = 0;
Loc instLoc = ti.loc;
Objects* tiargs = ti.tiargs;
auto dedargs = new Objects();
Objects* dedtypes = &ti.tdtypes; // for T:T*, the dedargs is the T*, dedtypes is the T
version (none)
{
printf("\nTemplateDeclaration::deduceFunctionTemplateMatch() %s\n", toChars());
for (size_t i = 0; i < (fargs ? fargs.dim : 0); i++)
{
Expression e = (*fargs)[i];
printf("\tfarg[%d] is %s, type is %s\n", i, e.toChars(), e.type.toChars());
}
printf("fd = %s\n", fd.toChars());
printf("fd->type = %s\n", fd.type.toChars());
if (tthis)
printf("tthis = %s\n", tthis.toChars());
}
assert(_scope);
dedargs.setDim(parameters.dim);
dedargs.zero();
dedtypes.setDim(parameters.dim);
dedtypes.zero();
if (errors || fd.errors)
return MATCHnomatch;
// Set up scope for parameters
auto paramsym = new ScopeDsymbol();
paramsym.parent = _scope.parent; // should use hasnestedArgs and enclosing?
Scope* paramscope = _scope.push(paramsym);
paramscope.tinst = ti;
paramscope.minst = sc.minst;
paramscope.callsc = sc;
paramscope.stc = 0;
TemplateTupleParameter tp = isVariadic();
Tuple declaredTuple = null;
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
printf("\tdedarg[%d] = ", i);
RootObject oarg = (*dedargs)[i];
if (oarg)
printf("%s", oarg.toChars());
printf("\n");
}
}
ntargs = 0;
if (tiargs)
{
// Set initial template arguments
ntargs = tiargs.dim;
size_t n = parameters.dim;
if (tp)
n--;
if (ntargs > n)
{
if (!tp)
goto Lnomatch;
/* The extra initial template arguments
* now form the tuple argument.
*/
auto t = new Tuple();
assert(parameters.dim);
(*dedargs)[parameters.dim - 1] = t;
t.objects.setDim(ntargs - n);
for (size_t i = 0; i < t.objects.dim; i++)
{
t.objects[i] = (*tiargs)[n + i];
}
declareParameter(paramscope, tp, t);
declaredTuple = t;
}
else
n = ntargs;
memcpy(dedargs.tdata(), tiargs.tdata(), n * (*dedargs.tdata()).sizeof);
for (size_t i = 0; i < n; i++)
{
assert(i < parameters.dim);
Declaration sparam = null;
MATCH m = (*parameters)[i].matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, &sparam);
//printf("\tdeduceType m = %d\n", m);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < matchTiargs)
matchTiargs = m;
sparam.semantic(paramscope);
if (!paramscope.insert(sparam))
goto Lnomatch;
}
if (n < parameters.dim && !declaredTuple)
{
inferStart = n;
}
else
inferStart = parameters.dim;
//printf("tiargs matchTiargs = %d\n", matchTiargs);
}
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
printf("\tdedarg[%d] = ", i);
RootObject oarg = (*dedargs)[i];
if (oarg)
printf("%s", oarg.toChars());
printf("\n");
}
}
fparameters = fd.getParameters(&fvarargs);
nfparams = Parameter.dim(fparameters); // number of function parameters
nfargs = fargs ? fargs.dim : 0; // number of function arguments
/* Check for match of function arguments with variadic template
* parameter, such as:
*
* void foo(T, A...)(T t, A a);
* void main() { foo(1,2,3); }
*/
if (tp) // if variadic
{
// TemplateTupleParameter always makes most lesser matching.
matchTiargs = MATCHconvert;
if (nfparams == 0 && nfargs != 0) // if no function parameters
{
if (!declaredTuple)
{
auto t = new Tuple();
//printf("t = %p\n", t);
(*dedargs)[parameters.dim - 1] = t;
declareParameter(paramscope, tp, t);
declaredTuple = t;
}
}
else
{
/* Figure out which of the function parameters matches
* the tuple template parameter. Do this by matching
* type identifiers.
* Set the index of this function parameter to fptupindex.
*/
for (fptupindex = 0; fptupindex < nfparams; fptupindex++)
{
Parameter fparam = (*fparameters)[fptupindex];
if (fparam.type.ty != Tident)
continue;
TypeIdentifier tid = cast(TypeIdentifier)fparam.type;
if (!tp.ident.equals(tid.ident) || tid.idents.dim)
continue;
if (fvarargs) // variadic function doesn't
goto Lnomatch;
// go with variadic template
goto L1;
}
fptupindex = IDX_NOTFOUND;
L1:
}
}
if (toParent().isModule() || (_scope.stc & STCstatic))
tthis = null;
if (tthis)
{
bool hasttp = false;
// Match 'tthis' to any TemplateThisParameter's
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateThisParameter ttp = (*parameters)[i].isTemplateThisParameter();
if (ttp)
{
hasttp = true;
Type t = new TypeIdentifier(Loc(), ttp.ident);
MATCH m = deduceType(tthis, paramscope, t, parameters, dedtypes);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m; // pick worst match
}
}
// Match attributes of tthis against attributes of fd
if (fd.type && !fd.isCtorDeclaration())
{
StorageClass stc = _scope.stc | fd.storage_class2;
// Propagate parent storage class (see bug 5504)
Dsymbol p = parent;
while (p.isTemplateDeclaration() || p.isTemplateInstance())
p = p.parent;
AggregateDeclaration ad = p.isAggregateDeclaration();
if (ad)
stc |= ad.storage_class;
ubyte mod = fd.type.mod;
if (stc & STCimmutable)
mod = MODimmutable;
else
{
if (stc & (STCshared | STCsynchronized))
mod |= MODshared;
if (stc & STCconst)
mod |= MODconst;
if (stc & STCwild)
mod |= MODwild;
}
ubyte thismod = tthis.mod;
if (hasttp)
mod = MODmerge(thismod, mod);
MATCH m = MODmethodConv(thismod, mod);
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
}
}
// Loop through the function parameters
{
//printf("%s\n\tnfargs = %d, nfparams = %d, tuple_dim = %d\n", toChars(), nfargs, nfparams, declaredTuple ? declaredTuple->objects.dim : 0);
//printf("\ttp = %p, fptupindex = %d, found = %d, declaredTuple = %s\n", tp, fptupindex, fptupindex != IDX_NOTFOUND, declaredTuple ? declaredTuple->toChars() : NULL);
size_t argi = 0;
size_t nfargs2 = nfargs; // nfargs + supplied defaultArgs
for (size_t parami = 0; parami < nfparams; parami++)
{
Parameter fparam = Parameter.getNth(fparameters, parami);
// Apply function parameter storage classes to parameter types
Type prmtype = fparam.type.addStorageClass(fparam.storageClass);
Expression farg;
/* See function parameters which wound up
* as part of a template tuple parameter.
*/
if (fptupindex != IDX_NOTFOUND && parami == fptupindex)
{
assert(prmtype.ty == Tident);
TypeIdentifier tid = cast(TypeIdentifier)prmtype;
if (!declaredTuple)
{
/* The types of the function arguments
* now form the tuple argument.
*/
declaredTuple = new Tuple();
(*dedargs)[parameters.dim - 1] = declaredTuple;
/* Count function parameters following a tuple parameter.
* void foo(U, T...)(int y, T, U, int) {} // rem == 2 (U, int)
*/
size_t rem = 0;
for (size_t j = parami + 1; j < nfparams; j++)
{
Parameter p = Parameter.getNth(fparameters, j);
if (!reliesOnTident(p.type, parameters, inferStart))
{
Type pt = p.type.syntaxCopy().semantic(fd.loc, paramscope);
rem += pt.ty == Ttuple ? (cast(TypeTuple)pt).arguments.dim : 1;
}
else
{
++rem;
}
}
if (nfargs2 - argi < rem)
goto Lnomatch;
declaredTuple.objects.setDim(nfargs2 - argi - rem);
for (size_t i = 0; i < declaredTuple.objects.dim; i++)
{
farg = (*fargs)[argi + i];
// Check invalid arguments to detect errors early.
if (farg.op == TOKerror || farg.type.ty == Terror)
goto Lnomatch;
if (!(fparam.storageClass & STClazy) && farg.type.ty == Tvoid)
goto Lnomatch;
Type tt;
MATCH m;
if (ubyte wm = deduceWildHelper(farg.type, &tt, tid))
{
wildmatch |= wm;
m = MATCHconst;
}
else
{
m = deduceTypeHelper(farg.type, &tt, tid);
}
if (m <= MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
/* Remove top const for dynamic array types and pointer types
*/
if ((tt.ty == Tarray || tt.ty == Tpointer) && !tt.isMutable() && (!(fparam.storageClass & STCref) || (fparam.storageClass & STCauto) && !farg.isLvalue()))
{
tt = tt.mutableOf();
}
declaredTuple.objects[i] = tt;
}
declareParameter(paramscope, tp, declaredTuple);
}
else
{
// Bugzilla 6810: If declared tuple is not a type tuple,
// it cannot be function parameter types.
for (size_t i = 0; i < declaredTuple.objects.dim; i++)
{
if (!isType(declaredTuple.objects[i]))
goto Lnomatch;
}
}
assert(declaredTuple);
argi += declaredTuple.objects.dim;
continue;
}
// If parameter type doesn't depend on inferred template parameters,
// semantic it to get actual type.
if (!reliesOnTident(prmtype, parameters, inferStart))
{
// should copy prmtype to avoid affecting semantic result
prmtype = prmtype.syntaxCopy().semantic(fd.loc, paramscope);
if (prmtype.ty == Ttuple)
{
TypeTuple tt = cast(TypeTuple)prmtype;
size_t tt_dim = tt.arguments.dim;
for (size_t j = 0; j < tt_dim; j++, ++argi)
{
Parameter p = (*tt.arguments)[j];
if (j == tt_dim - 1 && fvarargs == 2 && parami + 1 == nfparams && argi < nfargs)
{
prmtype = p.type;
goto Lvarargs;
}
if (argi >= nfargs)
{
if (p.defaultArg)
continue;
goto Lnomatch;
}
farg = (*fargs)[argi];
if (!farg.implicitConvTo(p.type))
goto Lnomatch;
}
continue;
}
}
if (argi >= nfargs) // if not enough arguments
{
if (!fparam.defaultArg)
goto Lvarargs;
/* Bugzilla 2803: Before the starting of type deduction from the function
* default arguments, set the already deduced parameters into paramscope.
* It's necessary to avoid breaking existing acceptable code. Cases:
*
* 1. Already deduced template parameters can appear in fparam->defaultArg:
* auto foo(A, B)(A a, B b = A.stringof);
* foo(1);
* // at fparam == 'B b = A.string', A is equivalent with the deduced type 'int'
*
* 2. If prmtype depends on default-specified template parameter, the
* default type should be preferred.
* auto foo(N = size_t, R)(R r, N start = 0)
* foo([1,2,3]);
* // at fparam `N start = 0`, N should be 'size_t' before
* // the deduction result from fparam->defaultArg.
*/
if (argi == nfargs)
{
for (size_t i = 0; i < dedtypes.dim; i++)
{
Type at = isType((*dedtypes)[i]);
if (at && at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
(*dedtypes)[i] = xt.tded; // 'unbox'
}
}
for (size_t i = ntargs; i < dedargs.dim; i++)
{
TemplateParameter tparam = (*parameters)[i];
RootObject oarg = (*dedargs)[i];
RootObject oded = (*dedtypes)[i];
if (!oarg)
{
if (oded)
{
if (tparam.specialization() || !tparam.isTemplateTypeParameter())
{
/* The specialization can work as long as afterwards
* the oded == oarg
*/
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(loc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
else
{
if (MATCHconvert < matchTiargs)
matchTiargs = MATCHconvert;
}
(*dedargs)[i] = declareParameter(paramscope, tparam, oded);
}
else
{
oded = tparam.defaultArg(loc, paramscope);
if (oded)
(*dedargs)[i] = declareParameter(paramscope, tparam, oded);
}
}
}
}
nfargs2 = argi + 1;
/* If prmtype does not depend on any template parameters:
*
* auto foo(T)(T v, double x = 0);
* foo("str");
* // at fparam == 'double x = 0'
*
* or, if all template parameters in the prmtype are already deduced:
*
* auto foo(R)(R range, ElementType!R sum = 0);
* foo([1,2,3]);
* // at fparam == 'ElementType!R sum = 0'
*
* Deducing prmtype from fparam->defaultArg is not necessary.
*/
if (prmtype.deco || prmtype.syntaxCopy().trySemantic(loc, paramscope))
{
++argi;
continue;
}
// Deduce prmtype from the defaultArg.
farg = fparam.defaultArg.syntaxCopy();
farg = farg.semantic(paramscope);
farg = resolveProperties(paramscope, farg);
}
else
{
farg = (*fargs)[argi];
}
{
// Check invalid arguments to detect errors early.
if (farg.op == TOKerror || farg.type.ty == Terror)
goto Lnomatch;
Lretry:
version (none)
{
printf("\tfarg->type = %s\n", farg.type.toChars());
printf("\tfparam->type = %s\n", prmtype.toChars());
}
Type argtype = farg.type;
if (!(fparam.storageClass & STClazy) && argtype.ty == Tvoid && farg.op != TOKfunction)
goto Lnomatch;
// Bugzilla 12876: optimize arugument to allow CT-known length matching
farg = farg.optimize(WANTvalue, (fparam.storageClass & (STCref | STCout)) != 0);
//printf("farg = %s %s\n", farg->type->toChars(), farg->toChars());
RootObject oarg = farg;
if ((fparam.storageClass & STCref) && (!(fparam.storageClass & STCauto) || farg.isLvalue()))
{
/* Allow expressions that have CT-known boundaries and type [] to match with [dim]
*/
Type taai;
if (argtype.ty == Tarray && (prmtype.ty == Tsarray || prmtype.ty == Taarray && (taai = (cast(TypeAArray)prmtype).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
if (farg.op == TOKstring)
{
StringExp se = cast(StringExp)farg;
argtype = se.type.nextOf().sarrayOf(se.len);
}
else if (farg.op == TOKarrayliteral)
{
ArrayLiteralExp ae = cast(ArrayLiteralExp)farg;
argtype = ae.type.nextOf().sarrayOf(ae.elements.dim);
}
else if (farg.op == TOKslice)
{
SliceExp se = cast(SliceExp)farg;
if (Type tsa = toStaticArrayType(se))
argtype = tsa;
}
}
oarg = argtype;
}
else if ((fparam.storageClass & STCout) == 0 && (argtype.ty == Tarray || argtype.ty == Tpointer) && templateParameterLookup(prmtype, parameters) != IDX_NOTFOUND && (cast(TypeIdentifier)prmtype).idents.dim == 0)
{
/* The farg passing to the prmtype always make a copy. Therefore,
* we can shrink the set of the deduced type arguments for prmtype
* by adjusting top-qualifier of the argtype.
*
* prmtype argtype ta
* T <- const(E)[] const(E)[]
* T <- const(E[]) const(E)[]
* qualifier(T) <- const(E)[] const(E[])
* qualifier(T) <- const(E[]) const(E[])
*/
Type ta = argtype.castMod(prmtype.mod ? argtype.nextOf().mod : 0);
if (ta != argtype)
{
Expression ea = farg.copy();
ea.type = ta;
oarg = ea;
}
}
if (fvarargs == 2 && parami + 1 == nfparams && argi + 1 < nfargs)
goto Lvarargs;
uint wm = 0;
MATCH m = deduceType(oarg, paramscope, prmtype, parameters, dedtypes, &wm, inferStart);
//printf("\tL%d deduceType m = %d, wm = x%x, wildmatch = x%x\n", __LINE__, m, wm, wildmatch);
wildmatch |= wm;
/* If no match, see if the argument can be matched by using
* implicit conversions.
*/
if (m == MATCHnomatch && prmtype.deco)
m = farg.implicitConvTo(prmtype);
if (m == MATCHnomatch)
{
AggregateDeclaration ad = isAggregate(farg.type);
if (ad && ad.aliasthis)
{
/* If a semantic error occurs while doing alias this,
* eg purity(bug 7295), just regard it as not a match.
*/
uint olderrors = global.startGagging();
Expression e = resolveAliasThis(sc, farg);
if (!global.endGagging(olderrors))
{
farg = e;
goto Lretry;
}
}
}
if (m > MATCHnomatch && (fparam.storageClass & (STCref | STCauto)) == STCref)
{
if (!farg.isLvalue())
{
if ((farg.op == TOKstring || farg.op == TOKslice) && (prmtype.ty == Tsarray || prmtype.ty == Taarray))
{
// Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
}
else
goto Lnomatch;
}
}
if (m > MATCHnomatch && (fparam.storageClass & STCout))
{
if (!farg.isLvalue())
goto Lnomatch;
if (!farg.type.isMutable()) // Bugzilla 11916
goto Lnomatch;
}
if (m == MATCHnomatch && (fparam.storageClass & STClazy) && prmtype.ty == Tvoid && farg.type.ty != Tvoid)
m = MATCHconvert;
if (m != MATCHnomatch)
{
if (m < match)
match = m; // pick worst match
argi++;
continue;
}
}
Lvarargs:
/* The following code for variadic arguments closely
* matches TypeFunction::callMatch()
*/
if (!(fvarargs == 2 && parami + 1 == nfparams))
goto Lnomatch;
/* Check for match with function parameter T...
*/
Type tb = prmtype.toBasetype();
switch (tb.ty)
{
// 6764 fix - TypeAArray may be TypeSArray have not yet run semantic().
case Tsarray:
case Taarray:
{
// Perhaps we can do better with this, see TypeFunction::callMatch()
if (tb.ty == Tsarray)
{
TypeSArray tsa = cast(TypeSArray)tb;
dinteger_t sz = tsa.dim.toInteger();
if (sz != nfargs - argi)
goto Lnomatch;
}
else if (tb.ty == Taarray)
{
TypeAArray taa = cast(TypeAArray)tb;
Expression dim = new IntegerExp(instLoc, nfargs - argi, Type.tsize_t);
size_t i = templateParameterLookup(taa.index, parameters);
if (i == IDX_NOTFOUND)
{
Expression e;
Type t;
Dsymbol s;
taa.index.resolve(instLoc, sc, &e, &t, &s);
if (!e)
goto Lnomatch;
e = e.ctfeInterpret();
e = e.implicitCastTo(sc, Type.tsize_t);
e = e.optimize(WANTvalue);
if (!dim.equals(e))
goto Lnomatch;
}
else
{
// This code matches code in TypeInstance::deduceType()
TemplateParameter tprm = (*parameters)[i];
TemplateValueParameter tvp = tprm.isTemplateValueParameter();
if (!tvp)
goto Lnomatch;
Expression e = cast(Expression)(*dedtypes)[i];
if (e)
{
if (!dim.equals(e))
goto Lnomatch;
}
else
{
Type vt = tvp.valType.semantic(Loc(), sc);
MATCH m = cast(MATCH)dim.implicitConvTo(vt);
if (m <= MATCHnomatch)
goto Lnomatch;
(*dedtypes)[i] = dim;
}
}
}
/* fall through */
}
case Tarray:
{
TypeArray ta = cast(TypeArray)tb;
Type tret = fparam.isLazyArray();
for (; argi < nfargs; argi++)
{
Expression arg = (*fargs)[argi];
assert(arg);
MATCH m;
/* If lazy array of delegates,
* convert arg(s) to delegate(s)
*/
if (tret)
{
if (ta.next.equals(arg.type))
{
m = MATCHexact;
}
else
{
m = arg.implicitConvTo(tret);
if (m == MATCHnomatch)
{
if (tret.toBasetype().ty == Tvoid)
m = MATCHconvert;
}
}
}
else
{
uint wm = 0;
m = deduceType(arg, paramscope, ta.next, parameters, dedtypes, &wm, inferStart);
wildmatch |= wm;
}
if (m == MATCHnomatch)
goto Lnomatch;
if (m < match)
match = m;
}
goto Lmatch;
}
case Tclass:
case Tident:
goto Lmatch;
default:
goto Lnomatch;
}
assert(0);
}
//printf("-> argi = %d, nfargs = %d, nfargs2 = %d\n", argi, nfargs, nfargs2);
if (argi != nfargs2 && !fvarargs)
goto Lnomatch;
}
Lmatch:
for (size_t i = 0; i < dedtypes.dim; i++)
{
Type at = isType((*dedtypes)[i]);
if (at)
{
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
at = xt.tded; // 'unbox'
}
(*dedtypes)[i] = at.merge2();
}
}
for (size_t i = ntargs; i < dedargs.dim; i++)
{
TemplateParameter tparam = (*parameters)[i];
//printf("tparam[%d] = %s\n", i, tparam->ident->toChars());
/* For T:T*, the dedargs is the T*, dedtypes is the T
* But for function templates, we really need them to match
*/
RootObject oarg = (*dedargs)[i];
RootObject oded = (*dedtypes)[i];
//printf("1dedargs[%d] = %p, dedtypes[%d] = %p\n", i, oarg, i, oded);
//if (oarg) printf("oarg: %s\n", oarg->toChars());
//if (oded) printf("oded: %s\n", oded->toChars());
if (!oarg)
{
if (oded)
{
if (tparam.specialization() || !tparam.isTemplateTypeParameter())
{
/* The specialization can work as long as afterwards
* the oded == oarg
*/
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
else
{
if (MATCHconvert < matchTiargs)
matchTiargs = MATCHconvert;
}
}
else
{
oded = tparam.defaultArg(instLoc, paramscope);
if (!oded)
{
// if tuple parameter and
// tuple parameter was not in function parameter list and
// we're one or more arguments short (i.e. no tuple argument)
if (tparam == tp && fptupindex == IDX_NOTFOUND && ntargs <= dedargs.dim - 1)
{
// make tuple argument an empty tuple
oded = cast(RootObject)new Tuple();
}
else
goto Lnomatch;
}
if (isError(oded))
goto Lerror;
ntargs++;
/* At the template parameter T, the picked default template argument
* X!int should be matched to T in order to deduce dependent
* template parameter A.
* auto foo(T : X!A = X!int, A...)() { ... }
* foo(); // T <-- X!int, A <-- (int)
*/
if (tparam.specialization())
{
(*dedargs)[i] = oded;
MATCH m2 = tparam.matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, null);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
if (m2 < matchTiargs)
matchTiargs = m2; // pick worst match
if (!(*dedtypes)[i].equals(oded))
error("specialization not allowed for deduced parameter %s", tparam.ident.toChars());
}
}
oded = declareParameter(paramscope, tparam, oded);
/* Bugzilla 7469: Normalize ti->tiargs for the correct mangling of template instance.
*/
Tuple va = isTuple(oded);
if (va && va.objects.dim)
{
dedargs.setDim(parameters.dim - 1 + va.objects.dim);
for (size_t j = 0; j < va.objects.dim; j++)
(*dedargs)[i + j] = va.objects[j];
i = dedargs.dim - 1;
}
else
(*dedargs)[i] = oded;
}
}
// Partially instantiate function for constraint and fd->leastAsSpecialized()
{
assert(paramsym);
Scope* sc2 = _scope;
sc2 = sc2.push(paramsym);
sc2 = sc2.push(ti);
sc2.parent = ti;
sc2.tinst = ti;
sc2.minst = sc.minst;
fd = doHeaderInstantiation(ti, sc2, fd, tthis, fargs);
sc2 = sc2.pop();
sc2 = sc2.pop();
if (!fd)
goto Lnomatch;
}
ti.tiargs = dedargs; // update to the normalized template arguments.
if (constraint)
{
if (!evaluateConstraint(ti, sc, paramscope, dedargs, fd))
goto Lnomatch;
}
version (none)
{
for (size_t i = 0; i < dedargs.dim; i++)
{
RootObject o = (*dedargs)[i];
printf("\tdedargs[%d] = %d, %s\n", i, o.dyncast(), o.toChars());
}
}
paramscope.pop();
//printf("\tmatch %d\n", match);
return cast(MATCH)(match | (matchTiargs << 4));
Lnomatch:
paramscope.pop();
//printf("\tnomatch\n");
return MATCHnomatch;
Lerror:
// todo: for the future improvement
paramscope.pop();
//printf("\terror\n");
return MATCHnomatch;
}
/**************************************************
* Declare template parameter tp with value o, and install it in the scope sc.
*/
RootObject declareParameter(Scope* sc, TemplateParameter tp, RootObject o)
{
//printf("TemplateDeclaration::declareParameter('%s', o = %p)\n", tp->ident->toChars(), o);
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
Declaration d;
VarDeclaration v = null;
if (ea && ea.op == TOKtype)
ta = ea.type;
else if (ea && ea.op == TOKscope)
sa = (cast(ScopeExp)ea).sds;
else if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
else if (ea && ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
}
if (ta)
{
//printf("type %s\n", ta->toChars());
d = new AliasDeclaration(Loc(), tp.ident, ta);
}
else if (sa)
{
//printf("Alias %s %s;\n", sa->ident->toChars(), tp->ident->toChars());
d = new AliasDeclaration(Loc(), tp.ident, sa);
}
else if (ea)
{
// tdtypes.data[i] always matches ea here
Initializer _init = new ExpInitializer(loc, ea);
TemplateValueParameter tvp = tp.isTemplateValueParameter();
Type t = tvp ? tvp.valType : null;
v = new VarDeclaration(loc, t, tp.ident, _init);
v.storage_class = STCmanifest | STCtemplateparameter;
d = v;
}
else if (va)
{
//printf("\ttuple\n");
d = new TupleDeclaration(loc, tp.ident, &va.objects);
}
else
{
debug
{
o.print();
}
assert(0);
}
d.storage_class |= STCtemplateparameter;
if (ta)
{
Type t = ta;
// consistent with Type::checkDeprecated()
while (t.ty != Tenum)
{
if (!t.nextOf())
break;
t = (cast(TypeNext)t).next;
}
if (Dsymbol s = t.toDsymbol(null))
{
if (s.isDeprecated())
d.storage_class |= STCdeprecated;
}
}
else if (sa)
{
if (sa.isDeprecated())
d.storage_class |= STCdeprecated;
}
if (!sc.insert(d))
error("declaration %s is already defined", tp.ident.toChars());
d.semantic(sc);
/* So the caller's o gets updated with the result of semantic() being run on o
*/
if (v)
o = v._init.toExpression();
return o;
}
/*************************************************
* Limited function template instantiation for using fd->leastAsSpecialized()
*/
FuncDeclaration doHeaderInstantiation(TemplateInstance ti, Scope* sc2, FuncDeclaration fd, Type tthis, Expressions* fargs)
{
assert(fd);
version (none)
{
printf("doHeaderInstantiation this = %s\n", toChars());
}
// function body and contracts are not need
if (fd.isCtorDeclaration())
fd = new CtorDeclaration(fd.loc, fd.endloc, fd.storage_class, fd.type.syntaxCopy());
else
fd = new FuncDeclaration(fd.loc, fd.endloc, fd.ident, fd.storage_class, fd.type.syntaxCopy());
fd.parent = ti;
assert(fd.type.ty == Tfunction);
TypeFunction tf = cast(TypeFunction)fd.type;
tf.fargs = fargs;
if (tthis)
{
// Match 'tthis' to any TemplateThisParameter's
bool hasttp = false;
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
TemplateThisParameter ttp = tp.isTemplateThisParameter();
if (ttp)
hasttp = true;
}
if (hasttp)
{
tf = cast(TypeFunction)tf.addSTC(ModToStc(tthis.mod));
assert(!tf.deco);
}
}
Scope* scx = sc2.push();
// Shouldn't run semantic on default arguments and return type.
for (size_t i = 0; i < tf.parameters.dim; i++)
(*tf.parameters)[i].defaultArg = null;
if (fd.isCtorDeclaration())
{
// For constructors, emitting return type is necessary for
// isolateReturn() in functionResolve.
scx.flags |= SCOPEctor;
Dsymbol parent = toParent2();
Type tret;
AggregateDeclaration ad = parent.isAggregateDeclaration();
if (!ad || parent.isUnionDeclaration())
{
tret = Type.tvoid;
}
else
{
tret = ad.handleType();
assert(tret);
tret = tret.addStorageClass(fd.storage_class | scx.stc);
tret = tret.addMod(tf.mod);
}
tf.next = tret;
if (ad && ad.isStructDeclaration())
tf.isref = 1;
//printf("tf = %s\n", tf->toChars());
}
else
tf.next = null;
fd.type = tf;
fd.type = fd.type.addSTC(scx.stc);
fd.type = fd.type.semantic(fd.loc, scx);
scx = scx.pop();
if (fd.type.ty != Tfunction)
return null;
fd.originalType = fd.type; // for mangling
//printf("\t[%s] fd->type = %s, mod = %x, ", loc.toChars(), fd->type->toChars(), fd->type->mod);
//printf("fd->needThis() = %d\n", fd->needThis());
return fd;
}
/****************************************************
* Given a new instance tithis of this TemplateDeclaration,
* see if there already exists an instance.
* If so, return that existing instance.
*/
TemplateInstance findExistingInstance(TemplateInstance tithis, Expressions* fargs)
{
tithis.fargs = fargs;
hash_t hash = tithis.hashCode();
if (!buckets.dim)
{
buckets.setDim(7);
buckets.zero();
}
size_t bi = hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
if (instances)
{
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
static if (LOG)
{
printf("\t%s: checking for match with instance %d (%p): '%s'\n", tithis.toChars(), i, ti, ti.toChars());
}
if (hash == ti.hash && tithis.compare(ti) == 0)
{
//printf("hash = %p yes %d n = %d\n", hash, instances->dim, numinstances);
return ti;
}
}
}
//printf("hash = %p no\n", hash);
return null; // didn't find a match
}
/********************************************
* Add instance ti to TemplateDeclaration's table of instances.
* Return a handle we can use to later remove it if it fails instantiation.
*/
TemplateInstance addInstance(TemplateInstance ti)
{
/* See if we need to rehash
*/
if (numinstances > buckets.dim * 4)
{
// rehash
//printf("rehash\n");
size_t newdim = buckets.dim * 2 + 1;
TemplateInstances** newp = cast(TemplateInstances**).calloc(newdim, (TemplateInstances*).sizeof);
assert(newp);
for (size_t bi = 0; bi < buckets.dim; ++bi)
{
TemplateInstances* instances = buckets[bi];
if (instances)
{
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti1 = (*instances)[i];
size_t newbi = ti1.hash % newdim;
TemplateInstances* newinstances = newp[newbi];
if (!newinstances)
newp[newbi] = newinstances = new TemplateInstances();
newinstances.push(ti1);
}
}
}
buckets.setDim(newdim);
memcpy(buckets.tdata(), newp, newdim * TemplateInstance.sizeof);
.free(newp);
}
// Insert ti into hash table
size_t bi = ti.hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
if (!instances)
buckets[bi] = instances = new TemplateInstances();
instances.push(ti);
++numinstances;
return ti;
}
/*******************************************
* Remove TemplateInstance from table of instances.
* Input:
* handle returned by addInstance()
*/
void removeInstance(TemplateInstance handle)
{
size_t bi = handle.hash % buckets.dim;
TemplateInstances* instances = buckets[bi];
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
if (handle == ti)
{
instances.remove(i);
break;
}
}
--numinstances;
}
override inout(TemplateDeclaration) isTemplateDeclaration() inout
{
return this;
}
TemplateTupleParameter isVariadic()
{
return .isVariadic(parameters);
}
/***********************************
* We can overload templates.
*/
override bool isOverloadable()
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
extern (C++) final class TypeDeduced : Type
{
public:
Type tded;
Expressions argexps; // corresponding expressions
Types tparams; // tparams[i]->mod
extern (D) this(Type tt, Expression e, Type tparam)
{
super(Tnone);
tded = tt;
argexps.push(e);
tparams.push(tparam);
}
void update(Expression e, Type tparam)
{
argexps.push(e);
tparams.push(tparam);
}
void update(Type tt, Expression e, Type tparam)
{
tded = tt;
argexps.push(e);
tparams.push(tparam);
}
MATCH matchAll(Type tt)
{
MATCH match = MATCHexact;
for (size_t j = 0; j < argexps.dim; j++)
{
Expression e = argexps[j];
assert(e);
if (e == emptyArrayElement)
continue;
Type t = tt.addMod(tparams[j].mod).substWildTo(MODconst);
MATCH m = e.implicitConvTo(t);
if (match > m)
match = m;
if (match <= MATCHnomatch)
break;
}
return match;
}
}
/**************************************
* Determine if TemplateDeclaration is variadic.
*/
extern (C++) TemplateTupleParameter isVariadic(TemplateParameters* parameters)
{
size_t dim = parameters.dim;
TemplateTupleParameter tp = null;
if (dim)
tp = (*parameters)[dim - 1].isTemplateTupleParameter();
return tp;
}
/*************************************************
* Given function arguments, figure out which template function
* to expand, and return matching result.
* Input:
* m matching result
* dstart the root of overloaded function templates
* loc instantiation location
* sc instantiation scope
* tiargs initial list of template arguments
* tthis if !NULL, the 'this' pointer argument
* fargs arguments to function
*/
extern (C++) void functionResolve(Match* m, Dsymbol dstart, Loc loc, Scope* sc, Objects* tiargs, Type tthis, Expressions* fargs)
{
version (none)
{
printf("functionResolve() dstart = %s\n", dstart.toChars());
printf(" tiargs:\n");
if (tiargs)
{
for (size_t i = 0; i < tiargs.dim; i++)
{
RootObject arg = (*tiargs)[i];
printf("\t%s\n", arg.toChars());
}
}
printf(" fargs:\n");
for (size_t i = 0; i < (fargs ? fargs.dim : 0); i++)
{
Expression arg = (*fargs)[i];
printf("\t%s %s\n", arg.type.toChars(), arg.toChars());
//printf("\tty = %d\n", arg->type->ty);
}
//printf("stc = %llx\n", dstart->scope->stc);
//printf("match:t/f = %d/%d\n", ta_last, m->last);
}
// results
int property = 0; // 0: unintialized
// 1: seen @property
// 2: not @property
size_t ov_index = 0;
TemplateDeclaration td_best;
TemplateInstance ti_best;
MATCH ta_last = m.last != MATCHnomatch ? MATCHexact : MATCHnomatch;
Type tthis_best;
int applyFunction(FuncDeclaration fd)
{
// skip duplicates
if (fd == m.lastf)
return 0;
// explicitly specified tiargs never match to non template function
if (tiargs && tiargs.dim > 0)
return 0;
if (fd.semanticRun == PASSinit && fd._scope)
{
Ungag ungag = fd.ungagSpeculative();
fd.semantic(fd._scope);
}
if (fd.semanticRun == PASSinit)
{
.error(loc, "forward reference to template %s", fd.toChars());
return 1;
}
//printf("fd = %s %s, fargs = %s\n", fd->toChars(), fd->type->toChars(), fargs->toChars());
m.anyf = fd;
auto tf = cast(TypeFunction)fd.type;
int prop = tf.isproperty ? 1 : 2;
if (property == 0)
property = prop;
else if (property != prop)
error(fd.loc, "cannot overload both property and non-property functions");
/* For constructors, qualifier check will be opposite direction.
* Qualified constructor always makes qualified object, then will be checked
* that it is implicitly convertible to tthis.
*/
Type tthis_fd = fd.needThis() ? tthis : null;
if (tthis_fd && fd.isCtorDeclaration())
{
//printf("%s tf->mod = x%x tthis_fd->mod = x%x %d\n", tf->toChars(),
// tf->mod, tthis_fd->mod, fd->isolateReturn());
if (MODimplicitConv(tf.mod, tthis_fd.mod) ||
tf.isWild() && tf.isShared() == tthis_fd.isShared() ||
fd.isolateReturn())
{
/* && tf->isShared() == tthis_fd->isShared()*/
// Uniquely constructed object can ignore shared qualifier.
// TODO: Is this appropriate?
tthis_fd = null;
}
else
return 0; // MATCHnomatch
}
MATCH mfa = tf.callMatch(tthis_fd, fargs);
//printf("test1: mfa = %d\n", mfa);
if (mfa > MATCHnomatch)
{
if (mfa > m.last) goto LfIsBetter;
if (mfa < m.last) goto LlastIsBetter;
/* See if one of the matches overrides the other.
*/
assert(m.lastf);
if (m.lastf.overrides(fd)) goto LlastIsBetter;
if (fd.overrides(m.lastf)) goto LfIsBetter;
/* Try to disambiguate using template-style partial ordering rules.
* In essence, if f() and g() are ambiguous, if f() can call g(),
* but g() cannot call f(), then pick f().
* This is because f() is "more specialized."
*/
{
MATCH c1 = fd.leastAsSpecialized(m.lastf);
MATCH c2 = m.lastf.leastAsSpecialized(fd);
//printf("c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2) goto LfIsBetter;
if (c1 < c2) goto LlastIsBetter;
}
/* If the two functions are the same function, like:
* int foo(int);
* int foo(int x) { ... }
* then pick the one with the body.
*/
if (tf.equals(m.lastf.type) &&
fd.storage_class == m.lastf.storage_class &&
fd.parent == m.lastf.parent &&
fd.protection == m.lastf.protection &&
fd.linkage == m.lastf.linkage)
{
if (fd.fbody && !m.lastf.fbody) goto LfIsBetter;
if (!fd.fbody && m.lastf.fbody) goto LlastIsBetter;
}
m.nextf = fd;
m.count++;
return 0;
LlastIsBetter:
return 0;
LfIsBetter:
td_best = null;
ti_best = null;
ta_last = MATCHexact;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = 0;
m.count = 1;
return 0;
}
return 0;
}
int applyTemplate(TemplateDeclaration td)
{
// skip duplicates
if (td == td_best)
return 0;
if (!sc)
sc = td._scope; // workaround for Type::aliasthisOf
if (td.semanticRun == PASSinit && td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
.error(loc, "forward reference to template %s", td.toChars());
Lerror:
m.lastf = null;
m.count = 0;
m.last = MATCHnomatch;
return 1;
}
//printf("td = %s\n", td->toChars());
auto f = td.onemember ? td.onemember.isFuncDeclaration() : null;
if (!f)
{
if (!tiargs)
tiargs = new Objects();
auto ti = new TemplateInstance(loc, td, tiargs);
Objects dedtypes;
dedtypes.setDim(td.parameters.dim);
assert(td.semanticRun != PASSinit);
MATCH mta = td.matchWithInstance(sc, ti, &dedtypes, fargs, 0);
//printf("matchWithInstance = %d\n", mta);
if (mta <= MATCHnomatch || mta < ta_last) // no match or less match
return 0;
ti.semantic(sc, fargs);
if (!ti.inst) // if template failed to expand
return 0;
Dsymbol s = ti.inst.toAlias();
FuncDeclaration fd;
if (auto tdx = s.isTemplateDeclaration())
{
Objects dedtypesX; // empty tiargs
// Bugzilla 11553: Check for recursive instantiation of tdx.
for (TemplatePrevious* p = tdx.previous; p; p = p.prev)
{
if (arrayObjectMatch(p.dedargs, &dedtypesX))
{
//printf("recursive, no match p->sc=%p %p %s\n", p->sc, this, this->toChars());
/* It must be a subscope of p->sc, other scope chains are not recursive
* instantiations.
*/
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
if (scx == p.sc)
{
error(loc, "recursive template expansion while looking for %s.%s", ti.toChars(), tdx.toChars());
goto Lerror;
}
}
}
/* BUG: should also check for ref param differences
*/
}
TemplatePrevious pr;
pr.prev = tdx.previous;
pr.sc = sc;
pr.dedargs = &dedtypesX;
tdx.previous = ≺ // add this to threaded list
fd = resolveFuncCall(loc, sc, s, null, tthis, fargs, 1);
tdx.previous = pr.prev; // unlink from threaded list
}
else if (s.isFuncDeclaration())
{
fd = resolveFuncCall(loc, sc, s, null, tthis, fargs, 1);
}
else
goto Lerror;
if (!fd)
return 0;
if (fd.type.ty != Tfunction)
{
m.lastf = fd; // to propagate "error match"
m.count = 1;
m.last = MATCHnomatch;
return 1;
}
Type tthis_fd = fd.needThis() && !fd.isCtorDeclaration() ? tthis : null;
auto tf = cast(TypeFunction)fd.type;
MATCH mfa = tf.callMatch(tthis_fd, fargs);
if (mfa < m.last)
return 0;
if (mta < ta_last) goto Ltd_best2;
if (mta > ta_last) goto Ltd2;
if (mfa < m.last) goto Ltd_best2;
if (mfa > m.last) goto Ltd2;
Lambig2: // td_best and td are ambiguous
//printf("Lambig2\n");
m.nextf = fd;
m.count++;
return 0;
Ltd_best2:
return 0;
Ltd2:
// td is the new best match
assert(td._scope);
td_best = td;
ti_best = null;
property = 0; // (backward compatibility)
ta_last = mta;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = 0;
m.nextf = null;
m.count = 1;
return 0;
}
//printf("td = %s\n", td->toChars());
for (size_t ovi = 0; f; f = f.overnext0, ovi++)
{
if (f.type.ty != Tfunction || f.errors)
goto Lerror;
/* This is a 'dummy' instance to evaluate constraint properly.
*/
auto ti = new TemplateInstance(loc, td, tiargs);
ti.parent = td.parent; // Maybe calculating valid 'enclosing' is unnecessary.
auto fd = f;
int x = td.deduceFunctionTemplateMatch(ti, sc, fd, tthis, fargs);
MATCH mta = cast(MATCH)(x >> 4);
MATCH mfa = cast(MATCH)(x & 0xF);
//printf("match:t/f = %d/%d\n", mta, mfa);
if (!fd || mfa == MATCHnomatch)
continue;
Type tthis_fd = fd.needThis() ? tthis : null;
if (fd.isCtorDeclaration())
{
// Constructor call requires additional check.
auto tf = cast(TypeFunction)fd.type;
if (tthis_fd)
{
assert(tf.next);
if (MODimplicitConv(tf.mod, tthis_fd.mod) ||
tf.isWild() && tf.isShared() == tthis_fd.isShared() ||
fd.isolateReturn())
{
tthis_fd = null;
}
else
continue; // MATCHnomatch
}
}
if (mta < ta_last) goto Ltd_best;
if (mta > ta_last) goto Ltd;
if (mfa < m.last) goto Ltd_best;
if (mfa > m.last) goto Ltd;
if (td_best)
{
// Disambiguate by picking the most specialized TemplateDeclaration
MATCH c1 = td.leastAsSpecialized(sc, td_best, fargs);
MATCH c2 = td_best.leastAsSpecialized(sc, td, fargs);
//printf("1: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2) goto Ltd;
if (c1 < c2) goto Ltd_best;
}
assert(fd && m.lastf);
{
// Disambiguate by tf->callMatch
auto tf1 = cast(TypeFunction)fd.type;
assert(tf1.ty == Tfunction);
auto tf2 = cast(TypeFunction)m.lastf.type;
assert(tf2.ty == Tfunction);
MATCH c1 = tf1.callMatch(tthis_fd, fargs);
MATCH c2 = tf2.callMatch(tthis_best, fargs);
//printf("2: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2) goto Ltd;
if (c1 < c2) goto Ltd_best;
}
{
// Disambiguate by picking the most specialized FunctionDeclaration
MATCH c1 = fd.leastAsSpecialized(m.lastf);
MATCH c2 = m.lastf.leastAsSpecialized(fd);
//printf("3: c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2) goto Ltd;
if (c1 < c2) goto Ltd_best;
}
m.nextf = fd;
m.count++;
continue;
Ltd_best: // td_best is the best match so far
//printf("Ltd_best\n");
continue;
Ltd: // td is the new best match
//printf("Ltd\n");
assert(td._scope);
td_best = td;
ti_best = ti;
property = 0; // (backward compatibility)
ta_last = mta;
m.last = mfa;
m.lastf = fd;
tthis_best = tthis_fd;
ov_index = ovi;
m.nextf = null;
m.count = 1;
continue;
}
return 0;
}
auto td = dstart.isTemplateDeclaration();
if (td && td.funcroot)
dstart = td.funcroot;
overloadApply(dstart, (Dsymbol s)
{
if (s.errors)
return 0;
if (auto fd = s.isFuncDeclaration())
return applyFunction(fd);
if (auto td = s.isTemplateDeclaration())
return applyTemplate(td);
return 0;
});
//printf("td_best = %p, m->lastf = %p\n", td_best, m.lastf);
if (td_best && ti_best && m.count == 1)
{
// Matches to template function
assert(td_best.onemember && td_best.onemember.isFuncDeclaration());
/* The best match is td_best with arguments tdargs.
* Now instantiate the template.
*/
assert(td_best._scope);
if (!sc)
sc = td_best._scope; // workaround for Type::aliasthisOf
auto ti = new TemplateInstance(loc, td_best, ti_best.tiargs);
ti.semantic(sc, fargs);
m.lastf = ti.toAlias().isFuncDeclaration();
if (!m.lastf)
goto Lnomatch;
if (ti.errors)
{
Lerror:
m.count = 1;
assert(m.lastf);
m.last = MATCHnomatch;
return;
}
// look forward instantiated overload function
// Dsymbol::oneMembers is alredy called in TemplateInstance::semantic.
// it has filled overnext0d
while (ov_index--)
{
m.lastf = m.lastf.overnext0;
assert(m.lastf);
}
tthis_best = m.lastf.needThis() && !m.lastf.isCtorDeclaration() ? tthis : null;
auto tf = cast(TypeFunction)m.lastf.type;
if (tf.ty == Terror)
goto Lerror;
assert(tf.ty == Tfunction);
if (!tf.callMatch(tthis_best, fargs))
goto Lnomatch;
/* As Bugzilla 3682 shows, a template instance can be matched while instantiating
* that same template. Thus, the function type can be incomplete. Complete it.
*
* Bugzilla 9208: For auto function, completion should be deferred to the end of
* its semantic3. Should not complete it in here.
*/
if (tf.next && !m.lastf.inferRetType)
{
m.lastf.type = tf.semantic(loc, sc);
}
}
else if (m.lastf)
{
// Matches to non template function,
// or found matches were ambiguous.
assert(m.count >= 1);
}
else
{
Lnomatch:
m.count = 0;
m.lastf = null;
m.last = MATCHnomatch;
}
}
/* ======================== Type ============================================ */
/****
* Given an identifier, figure out which TemplateParameter it is.
* Return IDX_NOTFOUND if not found.
*/
extern (C++) size_t templateIdentifierLookup(Identifier id, TemplateParameters* parameters)
{
for (size_t i = 0; i < parameters.dim; i++)
{
TemplateParameter tp = (*parameters)[i];
if (tp.ident.equals(id))
return i;
}
return IDX_NOTFOUND;
}
extern (C++) size_t templateParameterLookup(Type tparam, TemplateParameters* parameters)
{
if (tparam.ty == Tident)
{
TypeIdentifier tident = cast(TypeIdentifier)tparam;
//printf("\ttident = '%s'\n", tident->toChars());
return templateIdentifierLookup(tident.ident, parameters);
}
return IDX_NOTFOUND;
}
extern (C++) ubyte deduceWildHelper(Type t, Type* at, Type tparam)
{
if ((tparam.mod & MODwild) == 0)
return 0;
*at = null;
auto X(T, U)(T U, U T)
{
return (U << 4) | T;
}
switch (X(tparam.mod, t.mod))
{
case X(MODwild, 0):
case X(MODwild, MODconst):
case X(MODwild, MODshared):
case X(MODwild, MODshared | MODconst):
case X(MODwild, MODimmutable):
case X(MODwildconst, 0):
case X(MODwildconst, MODconst):
case X(MODwildconst, MODshared):
case X(MODwildconst, MODshared | MODconst):
case X(MODwildconst, MODimmutable):
case X(MODshared | MODwild, MODshared):
case X(MODshared | MODwild, MODshared | MODconst):
case X(MODshared | MODwild, MODimmutable):
case X(MODshared | MODwildconst, MODshared):
case X(MODshared | MODwildconst, MODshared | MODconst):
case X(MODshared | MODwildconst, MODimmutable):
{
ubyte wm = (t.mod & ~MODshared);
if (wm == 0)
wm = MODmutable;
ubyte m = (t.mod & (MODconst | MODimmutable)) | (tparam.mod & t.mod & MODshared);
*at = t.unqualify(m);
return wm;
}
case X(MODwild, MODwild):
case X(MODwild, MODwildconst):
case X(MODwild, MODshared | MODwild):
case X(MODwild, MODshared | MODwildconst):
case X(MODwildconst, MODwild):
case X(MODwildconst, MODwildconst):
case X(MODwildconst, MODshared | MODwild):
case X(MODwildconst, MODshared | MODwildconst):
case X(MODshared | MODwild, MODshared | MODwild):
case X(MODshared | MODwild, MODshared | MODwildconst):
case X(MODshared | MODwildconst, MODshared | MODwild):
case X(MODshared | MODwildconst, MODshared | MODwildconst):
{
*at = t.unqualify(tparam.mod & t.mod);
return MODwild;
}
default:
return 0;
}
}
extern (C++) MATCH deduceTypeHelper(Type t, Type* at, Type tparam)
{
// 9*9 == 81 cases
auto X(T, U)(T U, U T)
{
return (U << 4) | T;
}
switch (X(tparam.mod, t.mod))
{
case X(0, 0):
case X(0, MODconst):
case X(0, MODwild):
case X(0, MODwildconst):
case X(0, MODshared):
case X(0, MODshared | MODconst):
case X(0, MODshared | MODwild):
case X(0, MODshared | MODwildconst):
case X(0, MODimmutable):
// foo(U) T => T
// foo(U) const(T) => const(T)
// foo(U) inout(T) => inout(T)
// foo(U) inout(const(T)) => inout(const(T))
// foo(U) shared(T) => shared(T)
// foo(U) shared(const(T)) => shared(const(T))
// foo(U) shared(inout(T)) => shared(inout(T))
// foo(U) shared(inout(const(T))) => shared(inout(const(T)))
// foo(U) immutable(T) => immutable(T)
{
*at = t;
return MATCHexact;
}
case X(MODconst, MODconst):
case X(MODwild, MODwild):
case X(MODwildconst, MODwildconst):
case X(MODshared, MODshared):
case X(MODshared | MODconst, MODshared | MODconst):
case X(MODshared | MODwild, MODshared | MODwild):
case X(MODshared | MODwildconst, MODshared | MODwildconst):
case X(MODimmutable, MODimmutable):
// foo(const(U)) const(T) => T
// foo(inout(U)) inout(T) => T
// foo(inout(const(U))) inout(const(T)) => T
// foo(shared(U)) shared(T) => T
// foo(shared(const(U))) shared(const(T)) => T
// foo(shared(inout(U))) shared(inout(T)) => T
// foo(shared(inout(const(U)))) shared(inout(const(T))) => T
// foo(immutable(U)) immutable(T) => T
{
*at = t.mutableOf().unSharedOf();
return MATCHexact;
}
case X(MODconst, 0):
case X(MODconst, MODwild):
case X(MODconst, MODwildconst):
case X(MODconst, MODshared | MODconst):
case X(MODconst, MODshared | MODwild):
case X(MODconst, MODshared | MODwildconst):
case X(MODconst, MODimmutable):
case X(MODwild, MODshared | MODwild):
case X(MODwildconst, MODshared | MODwildconst):
case X(MODshared | MODconst, MODimmutable):
// foo(const(U)) T => T
// foo(const(U)) inout(T) => T
// foo(const(U)) inout(const(T)) => T
// foo(const(U)) shared(const(T)) => shared(T)
// foo(const(U)) shared(inout(T)) => shared(T)
// foo(const(U)) shared(inout(const(T))) => shared(T)
// foo(const(U)) immutable(T) => T
// foo(inout(U)) shared(inout(T)) => shared(T)
// foo(inout(const(U))) shared(inout(const(T))) => shared(T)
// foo(shared(const(U))) immutable(T) => T
{
*at = t.mutableOf();
return MATCHconst;
}
case X(MODconst, MODshared):
// foo(const(U)) shared(T) => shared(T)
{
*at = t;
return MATCHconst;
}
case X(MODshared, MODshared | MODconst):
case X(MODshared, MODshared | MODwild):
case X(MODshared, MODshared | MODwildconst):
case X(MODshared | MODconst, MODshared):
// foo(shared(U)) shared(const(T)) => const(T)
// foo(shared(U)) shared(inout(T)) => inout(T)
// foo(shared(U)) shared(inout(const(T))) => inout(const(T))
// foo(shared(const(U))) shared(T) => T
{
*at = t.unSharedOf();
return MATCHconst;
}
case X(MODwildconst, MODimmutable):
case X(MODshared | MODconst, MODshared | MODwildconst):
case X(MODshared | MODwildconst, MODimmutable):
case X(MODshared | MODwildconst, MODshared | MODwild):
// foo(inout(const(U))) immutable(T) => T
// foo(shared(const(U))) shared(inout(const(T))) => T
// foo(shared(inout(const(U)))) immutable(T) => T
// foo(shared(inout(const(U)))) shared(inout(T)) => T
{
*at = t.unSharedOf().mutableOf();
return MATCHconst;
}
case X(MODshared | MODconst, MODshared | MODwild):
// foo(shared(const(U))) shared(inout(T)) => T
{
*at = t.unSharedOf().mutableOf();
return MATCHconst;
}
case X(MODwild, 0):
case X(MODwild, MODconst):
case X(MODwild, MODwildconst):
case X(MODwild, MODimmutable):
case X(MODwild, MODshared):
case X(MODwild, MODshared | MODconst):
case X(MODwild, MODshared | MODwildconst):
case X(MODwildconst, 0):
case X(MODwildconst, MODconst):
case X(MODwildconst, MODwild):
case X(MODwildconst, MODshared):
case X(MODwildconst, MODshared | MODconst):
case X(MODwildconst, MODshared | MODwild):
case X(MODshared, 0):
case X(MODshared, MODconst):
case X(MODshared, MODwild):
case X(MODshared, MODwildconst):
case X(MODshared, MODimmutable):
case X(MODshared | MODconst, 0):
case X(MODshared | MODconst, MODconst):
case X(MODshared | MODconst, MODwild):
case X(MODshared | MODconst, MODwildconst):
case X(MODshared | MODwild, 0):
case X(MODshared | MODwild, MODconst):
case X(MODshared | MODwild, MODwild):
case X(MODshared | MODwild, MODwildconst):
case X(MODshared | MODwild, MODimmutable):
case X(MODshared | MODwild, MODshared):
case X(MODshared | MODwild, MODshared | MODconst):
case X(MODshared | MODwild, MODshared | MODwildconst):
case X(MODshared | MODwildconst, 0):
case X(MODshared | MODwildconst, MODconst):
case X(MODshared | MODwildconst, MODwild):
case X(MODshared | MODwildconst, MODwildconst):
case X(MODshared | MODwildconst, MODshared):
case X(MODshared | MODwildconst, MODshared | MODconst):
case X(MODimmutable, 0):
case X(MODimmutable, MODconst):
case X(MODimmutable, MODwild):
case X(MODimmutable, MODwildconst):
case X(MODimmutable, MODshared):
case X(MODimmutable, MODshared | MODconst):
case X(MODimmutable, MODshared | MODwild):
case X(MODimmutable, MODshared | MODwildconst):
// foo(inout(U)) T => nomatch
// foo(inout(U)) const(T) => nomatch
// foo(inout(U)) inout(const(T)) => nomatch
// foo(inout(U)) immutable(T) => nomatch
// foo(inout(U)) shared(T) => nomatch
// foo(inout(U)) shared(const(T)) => nomatch
// foo(inout(U)) shared(inout(const(T))) => nomatch
// foo(inout(const(U))) T => nomatch
// foo(inout(const(U))) const(T) => nomatch
// foo(inout(const(U))) inout(T) => nomatch
// foo(inout(const(U))) shared(T) => nomatch
// foo(inout(const(U))) shared(const(T)) => nomatch
// foo(inout(const(U))) shared(inout(T)) => nomatch
// foo(shared(U)) T => nomatch
// foo(shared(U)) const(T) => nomatch
// foo(shared(U)) inout(T) => nomatch
// foo(shared(U)) inout(const(T)) => nomatch
// foo(shared(U)) immutable(T) => nomatch
// foo(shared(const(U))) T => nomatch
// foo(shared(const(U))) const(T) => nomatch
// foo(shared(const(U))) inout(T) => nomatch
// foo(shared(const(U))) inout(const(T)) => nomatch
// foo(shared(inout(U))) T => nomatch
// foo(shared(inout(U))) const(T) => nomatch
// foo(shared(inout(U))) inout(T) => nomatch
// foo(shared(inout(U))) inout(const(T)) => nomatch
// foo(shared(inout(U))) immutable(T) => nomatch
// foo(shared(inout(U))) shared(T) => nomatch
// foo(shared(inout(U))) shared(const(T)) => nomatch
// foo(shared(inout(U))) shared(inout(const(T))) => nomatch
// foo(shared(inout(const(U)))) T => nomatch
// foo(shared(inout(const(U)))) const(T) => nomatch
// foo(shared(inout(const(U)))) inout(T) => nomatch
// foo(shared(inout(const(U)))) inout(const(T)) => nomatch
// foo(shared(inout(const(U)))) shared(T) => nomatch
// foo(shared(inout(const(U)))) shared(const(T)) => nomatch
// foo(immutable(U)) T => nomatch
// foo(immutable(U)) const(T) => nomatch
// foo(immutable(U)) inout(T) => nomatch
// foo(immutable(U)) inout(const(T)) => nomatch
// foo(immutable(U)) shared(T) => nomatch
// foo(immutable(U)) shared(const(T)) => nomatch
// foo(immutable(U)) shared(inout(T)) => nomatch
// foo(immutable(U)) shared(inout(const(T))) => nomatch
return MATCHnomatch;
default:
assert(0);
}
}
extern (C++) __gshared Expression emptyArrayElement = null;
/* These form the heart of template argument deduction.
* Given 'this' being the type argument to the template instance,
* it is matched against the template declaration parameter specialization
* 'tparam' to determine the type to be used for the parameter.
* Example:
* template Foo(T:T*) // template declaration
* Foo!(int*) // template instantiation
* Input:
* this = int*
* tparam = T*
* parameters = [ T:T* ] // Array of TemplateParameter's
* Output:
* dedtypes = [ int ] // Array of Expression/Type's
*/
extern (C++) MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, uint* wm = null, size_t inferStart = 0)
{
extern (C++) final class DeduceType : Visitor
{
alias visit = super.visit;
public:
Scope* sc;
Type tparam;
TemplateParameters* parameters;
Objects* dedtypes;
uint* wm;
size_t inferStart;
MATCH result;
extern (D) this(Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, uint* wm, size_t inferStart)
{
this.sc = sc;
this.tparam = tparam;
this.parameters = parameters;
this.dedtypes = dedtypes;
this.wm = wm;
this.inferStart = inferStart;
result = MATCHnomatch;
}
override void visit(Type t)
{
version (none)
{
printf("Type::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
if (!tparam)
goto Lnomatch;
if (t == tparam)
goto Lexact;
if (tparam.ty == Tident)
{
// Determine which parameter tparam is
size_t i = templateParameterLookup(tparam, parameters);
if (i == IDX_NOTFOUND)
{
if (!sc)
goto Lnomatch;
/* Need a loc to go with the semantic routine.
*/
Loc loc;
if (parameters.dim)
{
TemplateParameter tp = (*parameters)[0];
loc = tp.loc;
}
/* BUG: what if tparam is a template instance, that
* has as an argument another Tident?
*/
tparam = tparam.semantic(loc, sc);
assert(tparam.ty != Tident);
result = deduceType(t, sc, tparam, parameters, dedtypes, wm);
return;
}
TemplateParameter tp = (*parameters)[i];
TypeIdentifier tident = cast(TypeIdentifier)tparam;
if (tident.idents.dim > 0)
{
//printf("matching %s to %s\n", tparam->toChars(), t->toChars());
Dsymbol s = t.toDsymbol(sc);
for (size_t j = tident.idents.dim; j-- > 0;)
{
RootObject id = tident.idents[j];
if (id.dyncast() == DYNCAST_IDENTIFIER)
{
if (!s || !s.parent)
goto Lnomatch;
Dsymbol s2 = s.parent.search(Loc(), cast(Identifier)id);
if (!s2)
goto Lnomatch;
s2 = s2.toAlias();
//printf("[%d] s = %s %s, s2 = %s %s\n", j, s->kind(), s->toChars(), s2->kind(), s2->toChars());
if (s != s2)
{
if (Type tx = s2.getType())
{
if (s != tx.toDsymbol(sc))
goto Lnomatch;
}
else
goto Lnomatch;
}
s = s.parent;
}
else
goto Lnomatch;
}
//printf("[e] s = %s\n", s?s->toChars():"(null)");
if (tp.isTemplateTypeParameter())
{
Type tt = s.getType();
if (!tt)
goto Lnomatch;
Type at = cast(Type)(*dedtypes)[i];
if (at && at.ty == Tnone)
at = (cast(TypeDeduced)at).tded;
if (!at || tt.equals(at))
{
(*dedtypes)[i] = tt;
goto Lexact;
}
}
if (tp.isTemplateAliasParameter())
{
Dsymbol s2 = cast(Dsymbol)(*dedtypes)[i];
if (!s2 || s == s2)
{
(*dedtypes)[i] = s;
goto Lexact;
}
}
goto Lnomatch;
}
// Found the corresponding parameter tp
if (!tp.isTemplateTypeParameter())
goto Lnomatch;
Type at = cast(Type)(*dedtypes)[i];
Type tt;
if (ubyte wx = wm ? deduceWildHelper(t, &tt, tparam) : 0)
{
// type vs (none)
if (!at)
{
(*dedtypes)[i] = tt;
*wm |= wx;
result = MATCHconst;
return;
}
// type vs expressions
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
result = xt.matchAll(tt);
if (result > MATCHnomatch)
{
(*dedtypes)[i] = tt;
if (result > MATCHconst)
result = MATCHconst; // limit level for inout matches
}
return;
}
// type vs type
if (tt.equals(at))
{
(*dedtypes)[i] = tt; // Prefer current type match
goto Lconst;
}
if (tt.implicitConvTo(at.constOf()))
{
(*dedtypes)[i] = at.constOf().mutableOf();
*wm |= MODconst;
goto Lconst;
}
if (at.implicitConvTo(tt.constOf()))
{
(*dedtypes)[i] = tt.constOf().mutableOf();
*wm |= MODconst;
goto Lconst;
}
goto Lnomatch;
}
else if (MATCH m = deduceTypeHelper(t, &tt, tparam))
{
// type vs (none)
if (!at)
{
(*dedtypes)[i] = tt;
result = m;
return;
}
// type vs expressions
if (at.ty == Tnone)
{
TypeDeduced xt = cast(TypeDeduced)at;
result = xt.matchAll(tt);
if (result > MATCHnomatch)
{
(*dedtypes)[i] = tt;
}
return;
}
// type vs type
if (tt.equals(at))
{
goto Lexact;
}
if (tt.ty == Tclass && at.ty == Tclass)
{
result = tt.implicitConvTo(at);
return;
}
if (tt.ty == Tsarray && at.ty == Tarray && tt.nextOf().implicitConvTo(at.nextOf()) >= MATCHconst)
{
goto Lexact;
}
}
goto Lnomatch;
}
if (tparam.ty == Ttypeof)
{
/* Need a loc to go with the semantic routine.
*/
Loc loc;
if (parameters.dim)
{
TemplateParameter tp = (*parameters)[0];
loc = tp.loc;
}
tparam = tparam.semantic(loc, sc);
}
if (t.ty != tparam.ty)
{
if (Dsymbol sym = t.toDsymbol(sc))
{
if (sym.isforwardRef() && !tparam.deco)
goto Lnomatch;
}
MATCH m = t.implicitConvTo(tparam);
if (m == MATCHnomatch)
{
if (t.ty == Tclass)
{
TypeClass tc = cast(TypeClass)t;
if (tc.sym.aliasthis && !(tc.att & RECtracingDT))
{
tc.att = cast(AliasThisRec)(tc.att | RECtracingDT);
m = deduceType(t.aliasthisOf(), sc, tparam, parameters, dedtypes, wm);
tc.att = cast(AliasThisRec)(tc.att & ~RECtracingDT);
}
}
else if (t.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)t;
if (ts.sym.aliasthis && !(ts.att & RECtracingDT))
{
ts.att = cast(AliasThisRec)(ts.att | RECtracingDT);
m = deduceType(t.aliasthisOf(), sc, tparam, parameters, dedtypes, wm);
ts.att = cast(AliasThisRec)(ts.att & ~RECtracingDT);
}
}
}
result = m;
return;
}
if (t.nextOf())
{
if (tparam.deco && !tparam.hasWild())
{
result = t.implicitConvTo(tparam);
return;
}
Type tpn = tparam.nextOf();
if (wm && t.ty == Taarray && tparam.isWild())
{
// Bugzilla 12403: In IFTI, stop inout matching on transitive part of AA types.
tpn = tpn.substWildTo(MODmutable);
}
result = deduceType(t.nextOf(), sc, tpn, parameters, dedtypes, wm);
return;
}
Lexact:
result = MATCHexact;
return;
Lnomatch:
result = MATCHnomatch;
return;
Lconst:
result = MATCHconst;
}
override void visit(TypeVector t)
{
version (none)
{
printf("TypeVector::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
if (tparam.ty == Tvector)
{
TypeVector tp = cast(TypeVector)tparam;
result = deduceType(t.basetype, sc, tp.basetype, parameters, dedtypes, wm);
return;
}
visit(cast(Type)t);
}
override void visit(TypeDArray t)
{
version (none)
{
printf("TypeDArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
visit(cast(Type)t);
}
override void visit(TypeSArray t)
{
version (none)
{
printf("TypeSArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check that array dimensions must match
if (tparam)
{
if (tparam.ty == Tarray)
{
MATCH m = deduceType(t.next, sc, tparam.nextOf(), parameters, dedtypes, wm);
result = (m >= MATCHconst) ? MATCHconvert : MATCHnomatch;
return;
}
TemplateParameter tp = null;
Expression edim = null;
size_t i;
if (tparam.ty == Tsarray)
{
TypeSArray tsa = cast(TypeSArray)tparam;
if (tsa.dim.op == TOKvar && (cast(VarExp)tsa.dim).var.storage_class & STCtemplateparameter)
{
Identifier id = (cast(VarExp)tsa.dim).var.ident;
i = templateIdentifierLookup(id, parameters);
assert(i != IDX_NOTFOUND);
tp = (*parameters)[i];
}
else
edim = tsa.dim;
}
else if (tparam.ty == Taarray)
{
TypeAArray taa = cast(TypeAArray)tparam;
i = templateParameterLookup(taa.index, parameters);
if (i != IDX_NOTFOUND)
tp = (*parameters)[i];
else
{
Expression e;
Type tx;
Dsymbol s;
taa.index.resolve(Loc(), sc, &e, &tx, &s);
edim = s ? getValue(s) : getValue(e);
}
}
if (tp && tp.matchArg(sc, t.dim, i, parameters, dedtypes, null) || edim && edim.toInteger() == t.dim.toInteger())
{
result = deduceType(t.next, sc, tparam.nextOf(), parameters, dedtypes, wm);
return;
}
}
visit(cast(Type)t);
}
override void visit(TypeAArray t)
{
version (none)
{
printf("TypeAArray::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check that index type must match
if (tparam && tparam.ty == Taarray)
{
TypeAArray tp = cast(TypeAArray)tparam;
if (!deduceType(t.index, sc, tp.index, parameters, dedtypes))
{
result = MATCHnomatch;
return;
}
}
visit(cast(Type)t);
}
override void visit(TypeFunction t)
{
//printf("TypeFunction::deduceType()\n");
//printf("\tthis = %d, ", t->ty); t->print();
//printf("\ttparam = %d, ", tparam->ty); tparam->print();
// Extra check that function characteristics must match
if (tparam && tparam.ty == Tfunction)
{
TypeFunction tp = cast(TypeFunction)tparam;
if (t.varargs != tp.varargs || t.linkage != tp.linkage)
{
result = MATCHnomatch;
return;
}
size_t nfargs = Parameter.dim(t.parameters);
size_t nfparams = Parameter.dim(tp.parameters);
// bug 2579 fix: Apply function parameter storage classes to parameter types
for (size_t i = 0; i < nfparams; i++)
{
Parameter fparam = Parameter.getNth(tp.parameters, i);
fparam.type = fparam.type.addStorageClass(fparam.storageClass);
fparam.storageClass &= ~(STC_TYPECTOR | STCin);
}
//printf("\t-> this = %d, ", t->ty); t->print();
//printf("\t-> tparam = %d, ", tparam->ty); tparam->print();
/* See if tuple match
*/
if (nfparams > 0 && nfargs >= nfparams - 1)
{
/* See if 'A' of the template parameter matches 'A'
* of the type of the last function parameter.
*/
Parameter fparam = Parameter.getNth(tp.parameters, nfparams - 1);
assert(fparam);
assert(fparam.type);
if (fparam.type.ty != Tident)
goto L1;
TypeIdentifier tid = cast(TypeIdentifier)fparam.type;
if (tid.idents.dim)
goto L1;
/* Look through parameters to find tuple matching tid->ident
*/
size_t tupi = 0;
for (; 1; tupi++)
{
if (tupi == parameters.dim)
goto L1;
TemplateParameter tx = (*parameters)[tupi];
TemplateTupleParameter tup = tx.isTemplateTupleParameter();
if (tup && tup.ident.equals(tid.ident))
break;
}
/* The types of the function arguments [nfparams - 1 .. nfargs]
* now form the tuple argument.
*/
size_t tuple_dim = nfargs - (nfparams - 1);
/* See if existing tuple, and whether it matches or not
*/
RootObject o = (*dedtypes)[tupi];
if (o)
{
// Existing deduced argument must be a tuple, and must match
Tuple tup = isTuple(o);
if (!tup || tup.objects.dim != tuple_dim)
{
result = MATCHnomatch;
return;
}
for (size_t i = 0; i < tuple_dim; i++)
{
Parameter arg = Parameter.getNth(t.parameters, nfparams - 1 + i);
if (!arg.type.equals(tup.objects[i]))
{
result = MATCHnomatch;
return;
}
}
}
else
{
// Create new tuple
auto tup = new Tuple();
tup.objects.setDim(tuple_dim);
for (size_t i = 0; i < tuple_dim; i++)
{
Parameter arg = Parameter.getNth(t.parameters, nfparams - 1 + i);
tup.objects[i] = arg.type;
}
(*dedtypes)[tupi] = tup;
}
nfparams--; // don't consider the last parameter for type deduction
goto L2;
}
L1:
if (nfargs != nfparams)
{
result = MATCHnomatch;
return;
}
L2:
for (size_t i = 0; i < nfparams; i++)
{
Parameter a = Parameter.getNth(t.parameters, i);
Parameter ap = Parameter.getNth(tp.parameters, i);
if (a.storageClass != ap.storageClass || !deduceType(a.type, sc, ap.type, parameters, dedtypes))
{
result = MATCHnomatch;
return;
}
}
}
visit(cast(Type)t);
}
override void visit(TypeIdentifier t)
{
// Extra check
if (tparam && tparam.ty == Tident)
{
TypeIdentifier tp = cast(TypeIdentifier)tparam;
for (size_t i = 0; i < t.idents.dim; i++)
{
RootObject id1 = t.idents[i];
RootObject id2 = tp.idents[i];
if (!id1.equals(id2))
{
result = MATCHnomatch;
return;
}
}
}
visit(cast(Type)t);
}
override void visit(TypeInstance t)
{
version (none)
{
printf("TypeInstance::deduceType()\n");
printf("\tthis = %d, ", t.ty);
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
// Extra check
if (tparam && tparam.ty == Tinstance && t.tempinst.tempdecl)
{
TemplateDeclaration tempdecl = t.tempinst.tempdecl.isTemplateDeclaration();
assert(tempdecl);
TypeInstance tp = cast(TypeInstance)tparam;
//printf("tempinst->tempdecl = %p\n", tempdecl);
//printf("tp->tempinst->tempdecl = %p\n", tp->tempinst->tempdecl);
if (!tp.tempinst.tempdecl)
{
//printf("tp->tempinst->name = '%s'\n", tp->tempinst->name->toChars());
/* Handle case of:
* template Foo(T : sa!(T), alias sa)
*/
size_t i = templateIdentifierLookup(tp.tempinst.name, parameters);
if (i == IDX_NOTFOUND)
{
/* Didn't find it as a parameter identifier. Try looking
* it up and seeing if is an alias. See Bugzilla 1454
*/
auto tid = new TypeIdentifier(tp.loc, tp.tempinst.name);
Type tx;
Expression e;
Dsymbol s;
tid.resolve(tp.loc, sc, &e, &tx, &s);
if (tx)
{
s = tx.toDsymbol(sc);
if (TemplateInstance ti = s ? s.parent.isTemplateInstance() : null)
{
// Bugzilla 14290: Try to match with ti->tempecl,
// only when ti is an enclosing instance.
Dsymbol p = sc.parent;
while (p && p != ti)
p = p.parent;
if (p)
s = ti.tempdecl;
}
}
if (s)
{
s = s.toAlias();
TemplateDeclaration td = s.isTemplateDeclaration();
if (td)
{
if (td.overroot)
td = td.overroot;
for (; td; td = td.overnext)
{
if (td == tempdecl)
goto L2;
}
}
}
goto Lnomatch;
}
TemplateParameter tpx = (*parameters)[i];
if (!tpx.matchArg(sc, tempdecl, i, parameters, dedtypes, null))
goto Lnomatch;
}
else if (tempdecl != tp.tempinst.tempdecl)
goto Lnomatch;
L2:
for (size_t i = 0; 1; i++)
{
//printf("\ttest: tempinst->tiargs[%d]\n", i);
RootObject o1 = null;
if (i < t.tempinst.tiargs.dim)
o1 = (*t.tempinst.tiargs)[i];
else if (i < t.tempinst.tdtypes.dim && i < tp.tempinst.tiargs.dim)
{
// Pick up default arg
o1 = t.tempinst.tdtypes[i];
}
else if (i >= tp.tempinst.tiargs.dim)
break;
if (i >= tp.tempinst.tiargs.dim)
{
size_t dim = tempdecl.parameters.dim - (tempdecl.isVariadic() ? 1 : 0);
while (i < dim && ((*tempdecl.parameters)[i].dependent || (*tempdecl.parameters)[i].hasDefaultArg()))
{
i++;
}
if (i >= dim)
break;
// match if all remained parameters are dependent
goto Lnomatch;
}
RootObject o2 = (*tp.tempinst.tiargs)[i];
Type t2 = isType(o2);
size_t j;
if (t2 && t2.ty == Tident && i == tp.tempinst.tiargs.dim - 1 && (j = templateParameterLookup(t2, parameters), j != IDX_NOTFOUND) && j == parameters.dim - 1 && (*parameters)[j].isTemplateTupleParameter())
{
/* Given:
* struct A(B...) {}
* alias A!(int, float) X;
* static if (is(X Y == A!(Z), Z...)) {}
* deduce that Z is a tuple(int, float)
*/
/* Create tuple from remaining args
*/
auto vt = new Tuple();
size_t vtdim = (tempdecl.isVariadic() ? t.tempinst.tiargs.dim : t.tempinst.tdtypes.dim) - i;
vt.objects.setDim(vtdim);
for (size_t k = 0; k < vtdim; k++)
{
RootObject o;
if (k < t.tempinst.tiargs.dim)
o = (*t.tempinst.tiargs)[i + k];
else // Pick up default arg
o = t.tempinst.tdtypes[i + k];
vt.objects[k] = o;
}
Tuple v = cast(Tuple)(*dedtypes)[j];
if (v)
{
if (!match(v, vt))
goto Lnomatch;
}
else
(*dedtypes)[j] = vt;
break;
}
else if (!o1)
break;
Type t1 = isType(o1);
Dsymbol s1 = isDsymbol(o1);
Dsymbol s2 = isDsymbol(o2);
Expression e1 = s1 ? getValue(s1) : getValue(isExpression(o1));
Expression e2 = isExpression(o2);
version (none)
{
Tuple v1 = isTuple(o1);
Tuple v2 = isTuple(o2);
if (t1)
printf("t1 = %s\n", t1.toChars());
if (t2)
printf("t2 = %s\n", t2.toChars());
if (e1)
printf("e1 = %s\n", e1.toChars());
if (e2)
printf("e2 = %s\n", e2.toChars());
if (s1)
printf("s1 = %s\n", s1.toChars());
if (s2)
printf("s2 = %s\n", s2.toChars());
if (v1)
printf("v1 = %s\n", v1.toChars());
if (v2)
printf("v2 = %s\n", v2.toChars());
}
if (t1 && t2)
{
if (!deduceType(t1, sc, t2, parameters, dedtypes))
goto Lnomatch;
}
else if (e1 && e2)
{
Le:
e1 = e1.ctfeInterpret();
/* If it is one of the template parameters for this template,
* we should not attempt to interpret it. It already has a value.
*/
if (e2.op == TOKvar && ((cast(VarExp)e2).var.storage_class & STCtemplateparameter))
{
/*
* (T:Number!(e2), int e2)
*/
j = templateIdentifierLookup((cast(VarExp)e2).var.ident, parameters);
if (j != IDX_NOTFOUND)
goto L1;
// The template parameter was not from this template
// (it may be from a parent template, for example)
}
e2 = e2.semantic(sc); // Bugzilla 13417
e2 = e2.ctfeInterpret();
//printf("e1 = %s, type = %s %d\n", e1->toChars(), e1->type->toChars(), e1->type->ty);
//printf("e2 = %s, type = %s %d\n", e2->toChars(), e2->type->toChars(), e2->type->ty);
if (!e1.equals(e2))
{
if (!e2.implicitConvTo(e1.type))
goto Lnomatch;
e2 = e2.implicitCastTo(sc, e1.type);
e2 = e2.ctfeInterpret();
if (!e1.equals(e2))
goto Lnomatch;
}
}
else if (e1 && t2 && t2.ty == Tident)
{
j = templateParameterLookup(t2, parameters);
L1:
if (j == IDX_NOTFOUND)
{
t2.resolve((cast(TypeIdentifier)t2).loc, sc, &e2, &t2, &s2);
if (e2)
goto Le;
goto Lnomatch;
}
if (!(*parameters)[j].matchArg(sc, e1, j, parameters, dedtypes, null))
goto Lnomatch;
}
else if (s1 && s2)
{
Ls:
if (!s1.equals(s2))
goto Lnomatch;
}
else if (s1 && t2 && t2.ty == Tident)
{
j = templateParameterLookup(t2, parameters);
if (j == IDX_NOTFOUND)
{
t2.resolve((cast(TypeIdentifier)t2).loc, sc, &e2, &t2, &s2);
if (s2)
goto Ls;
goto Lnomatch;
}
if (!(*parameters)[j].matchArg(sc, s1, j, parameters, dedtypes, null))
goto Lnomatch;
}
else
goto Lnomatch;
}
}
visit(cast(Type)t);
return;
Lnomatch:
//printf("no match\n");
result = MATCHnomatch;
}
override void visit(TypeStruct t)
{
version (none)
{
printf("TypeStruct::deduceType()\n");
printf("\tthis->parent = %s, ", t.sym.parent.toChars());
t.print();
printf("\ttparam = %d, ", tparam.ty);
tparam.print();
}
/* If this struct is a template struct, and we're matching
* it against a template instance, convert the struct type
* to a template instance, too, and try again.
*/
TemplateInstance ti = t.sym.parent.isTemplateInstance();
if (tparam && tparam.ty == Tinstance)
{
if (ti && ti.toAlias() == t.sym)
{
auto tx = new TypeInstance(Loc(), ti);
result = deduceType(tx, sc, tparam, parameters, dedtypes, wm);
return;
}
/* Match things like:
* S!(T).foo
*/
TypeInstance tpi = cast(TypeInstance)tparam;
if (tpi.idents.dim)
{
RootObject id = tpi.idents[tpi.idents.dim - 1];
if (id.dyncast() == DYNCAST_IDENTIFIER && t.sym.ident.equals(cast(Identifier)id))
{
Type tparent = t.sym.parent.getType();
if (tparent)
{
/* Slice off the .foo in S!(T).foo
*/
tpi.idents.dim--;
result = deduceType(tparent, sc, tpi, parameters, dedtypes, wm);
tpi.idents.dim++;
return;
}
}
}
}
// Extra check
if (tparam && tparam.ty == Tstruct)
{
TypeStruct tp = cast(TypeStruct)tparam;
//printf("\t%d\n", (MATCH) t->implicitConvTo(tp));
if (wm && t.deduceWild(tparam, false))
{
result = MATCHconst;
return;
}
result = t.implicitConvTo(tp);
return;
}
visit(cast(Type)t);
}
override void visit(TypeEnum t)
{
// Extra check
if (tparam && tparam.ty == Tenum)
{
TypeEnum tp = cast(TypeEnum)tparam;
if (t.sym == tp.sym)
visit(cast(Type)t);
else
result = MATCHnomatch;
return;
}
Type tb = t.toBasetype();
if (tb.ty == tparam.ty || tb.ty == Tsarray && tparam.ty == Taarray)
{
result = deduceType(tb, sc, tparam, parameters, dedtypes, wm);
return;
}
visit(cast(Type)t);
}
/* Helper for TypeClass::deduceType().
* Classes can match with implicit conversion to a base class or interface.
* This is complicated, because there may be more than one base class which
* matches. In such cases, one or more parameters remain ambiguous.
* For example,
*
* interface I(X, Y) {}
* class C : I(uint, double), I(char, double) {}
* C x;
* foo(T, U)( I!(T, U) x)
*
* deduces that U is double, but T remains ambiguous (could be char or uint).
*
* Given a baseclass b, and initial deduced types 'dedtypes', this function
* tries to match tparam with b, and also tries all base interfaces of b.
* If a match occurs, numBaseClassMatches is incremented, and the new deduced
* types are ANDed with the current 'best' estimate for dedtypes.
*/
static void deduceBaseClassParameters(ref BaseClass b, Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, Objects* best, ref int numBaseClassMatches)
{
TemplateInstance parti = b.sym ? b.sym.parent.isTemplateInstance() : null;
if (parti)
{
// Make a temporary copy of dedtypes so we don't destroy it
auto tmpdedtypes = new Objects();
tmpdedtypes.setDim(dedtypes.dim);
memcpy(tmpdedtypes.tdata(), dedtypes.tdata(), dedtypes.dim * (void*).sizeof);
auto t = new TypeInstance(Loc(), parti);
MATCH m = deduceType(t, sc, tparam, parameters, tmpdedtypes);
if (m > MATCHnomatch)
{
// If this is the first ever match, it becomes our best estimate
if (numBaseClassMatches == 0)
memcpy(best.tdata(), tmpdedtypes.tdata(), tmpdedtypes.dim * (void*).sizeof);
else
for (size_t k = 0; k < tmpdedtypes.dim; ++k)
{
// If we've found more than one possible type for a parameter,
// mark it as unknown.
if ((*tmpdedtypes)[k] != (*best)[k])
(*best)[k] = (*dedtypes)[k];
}
++numBaseClassMatches;
}
}
// Now recursively test the inherited interfaces
foreach (ref bi; b.baseInterfaces)
{
deduceBaseClassParameters(bi, sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
}
}
override void visit(TypeClass t)
{
//printf("TypeClass::deduceType(this = %s)\n", t->toChars());
/* If this class is a template class, and we're matching
* it against a template instance, convert the class type
* to a template instance, too, and try again.
*/
TemplateInstance ti = t.sym.parent.isTemplateInstance();
if (tparam && tparam.ty == Tinstance)
{
if (ti && ti.toAlias() == t.sym)
{
auto tx = new TypeInstance(Loc(), ti);
MATCH m = deduceType(tx, sc, tparam, parameters, dedtypes, wm);
// Even if the match fails, there is still a chance it could match
// a base class.
if (m != MATCHnomatch)
{
result = m;
return;
}
}
/* Match things like:
* S!(T).foo
*/
TypeInstance tpi = cast(TypeInstance)tparam;
if (tpi.idents.dim)
{
RootObject id = tpi.idents[tpi.idents.dim - 1];
if (id.dyncast() == DYNCAST_IDENTIFIER && t.sym.ident.equals(cast(Identifier)id))
{
Type tparent = t.sym.parent.getType();
if (tparent)
{
/* Slice off the .foo in S!(T).foo
*/
tpi.idents.dim--;
result = deduceType(tparent, sc, tpi, parameters, dedtypes, wm);
tpi.idents.dim++;
return;
}
}
}
// If it matches exactly or via implicit conversion, we're done
visit(cast(Type)t);
if (result != MATCHnomatch)
return;
/* There is still a chance to match via implicit conversion to
* a base class or interface. Because there could be more than one such
* match, we need to check them all.
*/
int numBaseClassMatches = 0; // Have we found an interface match?
// Our best guess at dedtypes
auto best = new Objects();
best.setDim(dedtypes.dim);
ClassDeclaration s = t.sym;
while (s && s.baseclasses.dim > 0)
{
// Test the base class
deduceBaseClassParameters(*(*s.baseclasses)[0], sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
// Test the interfaces inherited by the base class
foreach (b; s.interfaces)
{
deduceBaseClassParameters(*b, sc, tparam, parameters, dedtypes, best, numBaseClassMatches);
}
s = (*s.baseclasses)[0].sym;
}
if (numBaseClassMatches == 0)
{
result = MATCHnomatch;
return;
}
// If we got at least one match, copy the known types into dedtypes
memcpy(dedtypes.tdata(), best.tdata(), best.dim * (void*).sizeof);
result = MATCHconvert;
return;
}
// Extra check
if (tparam && tparam.ty == Tclass)
{
TypeClass tp = cast(TypeClass)tparam;
//printf("\t%d\n", (MATCH) t->implicitConvTo(tp));
if (wm && t.deduceWild(tparam, false))
{
result = MATCHconst;
return;
}
result = t.implicitConvTo(tp);
return;
}
visit(cast(Type)t);
}
override void visit(Expression e)
{
//printf("Expression::deduceType(e = %s)\n", e->toChars());
size_t i = templateParameterLookup(tparam, parameters);
if (i == IDX_NOTFOUND || (cast(TypeIdentifier)tparam).idents.dim > 0)
{
if (e == emptyArrayElement && tparam.ty == Tarray)
{
Type tn = (cast(TypeNext)tparam).next;
result = deduceType(emptyArrayElement, sc, tn, parameters, dedtypes, wm);
return;
}
e.type.accept(this);
return;
}
TemplateTypeParameter tp = (*parameters)[i].isTemplateTypeParameter();
if (!tp)
return; // nomatch
if (e == emptyArrayElement)
{
if ((*dedtypes)[i])
{
result = MATCHexact;
return;
}
if (tp.defaultType)
{
tp.defaultType.accept(this);
return;
}
}
Type at = cast(Type)(*dedtypes)[i];
Type tt;
if (ubyte wx = deduceWildHelper(e.type, &tt, tparam))
{
*wm |= wx;
result = MATCHconst;
}
else if (MATCH m = deduceTypeHelper(e.type, &tt, tparam))
{
result = m;
}
else
return; // nomatch
// expression vs (none)
if (!at)
{
(*dedtypes)[i] = new TypeDeduced(tt, e, tparam);
return;
}
TypeDeduced xt = null;
if (at.ty == Tnone)
{
xt = cast(TypeDeduced)at;
at = xt.tded;
}
// From previous matched expressions to current deduced type
MATCH match1 = xt ? xt.matchAll(tt) : MATCHnomatch;
// From current expresssion to previous deduced type
Type pt = at.addMod(tparam.mod);
if (*wm)
pt = pt.substWildTo(*wm);
MATCH match2 = e.implicitConvTo(pt);
if (match1 > MATCHnomatch && match2 > MATCHnomatch)
{
if (at.implicitConvTo(tt) <= MATCHnomatch)
match1 = MATCHnomatch; // Prefer at
else if (tt.implicitConvTo(at) <= MATCHnomatch)
match2 = MATCHnomatch; // Prefer tt
else if (tt.isTypeBasic() && tt.ty == at.ty && tt.mod != at.mod)
{
if (!tt.isMutable() && !at.isMutable())
tt = tt.mutableOf().addMod(MODmerge(tt.mod, at.mod));
else if (tt.isMutable())
{
if (at.mod == 0) // Prefer unshared
match1 = MATCHnomatch;
else
match2 = MATCHnomatch;
}
else if (at.isMutable())
{
if (tt.mod == 0) // Prefer unshared
match2 = MATCHnomatch;
else
match1 = MATCHnomatch;
}
//printf("tt = %s, at = %s\n", tt->toChars(), at->toChars());
}
else
{
match1 = MATCHnomatch;
match2 = MATCHnomatch;
}
}
if (match1 > MATCHnomatch)
{
// Prefer current match: tt
if (xt)
xt.update(tt, e, tparam);
else
(*dedtypes)[i] = tt;
result = match1;
return;
}
if (match2 > MATCHnomatch)
{
// Prefer previous match: (*dedtypes)[i]
if (xt)
xt.update(e, tparam);
result = match2;
return;
}
/* Deduce common type
*/
if (Type t = rawTypeMerge(at, tt))
{
if (xt)
xt.update(t, e, tparam);
else
(*dedtypes)[i] = t;
pt = tt.addMod(tparam.mod);
if (*wm)
pt = pt.substWildTo(*wm);
result = e.implicitConvTo(pt);
return;
}
result = MATCHnomatch;
}
MATCH deduceEmptyArrayElement()
{
if (!emptyArrayElement)
{
emptyArrayElement = new IdentifierExp(Loc(), Id.p); // dummy
emptyArrayElement.type = Type.tvoid;
}
assert(tparam.ty == Tarray);
Type tn = (cast(TypeNext)tparam).next;
return deduceType(emptyArrayElement, sc, tn, parameters, dedtypes, wm);
}
override void visit(NullExp e)
{
if (tparam.ty == Tarray && e.type.ty == Tnull)
{
// tparam:T[] <- e:null (void[])
result = deduceEmptyArrayElement();
return;
}
visit(cast(Expression)e);
}
override void visit(StringExp e)
{
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
e.type.nextOf().sarrayOf(e.len).accept(this);
return;
}
visit(cast(Expression)e);
}
override void visit(ArrayLiteralExp e)
{
if ((!e.elements || !e.elements.dim) && e.type.toBasetype().nextOf().ty == Tvoid && tparam.ty == Tarray)
{
// tparam:T[] <- e:[] (void[])
result = deduceEmptyArrayElement();
return;
}
if (tparam.ty == Tarray && e.elements && e.elements.dim)
{
Type tn = (cast(TypeDArray)tparam).next;
result = MATCHexact;
if (e.basis)
{
MATCH m = deduceType(e.basis, sc, tn, parameters, dedtypes, wm);
if (m < result)
result = m;
}
for (size_t i = 0; i < e.elements.dim; i++)
{
if (result <= MATCHnomatch)
break;
auto el = (*e.elements)[i];
if (!el)
continue;
MATCH m = deduceType(el, sc, tn, parameters, dedtypes, wm);
if (m < result)
result = m;
}
return;
}
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
e.type.nextOf().sarrayOf(e.elements.dim).accept(this);
return;
}
visit(cast(Expression)e);
}
override void visit(AssocArrayLiteralExp e)
{
if (tparam.ty == Taarray && e.keys && e.keys.dim)
{
TypeAArray taa = cast(TypeAArray)tparam;
result = MATCHexact;
for (size_t i = 0; i < e.keys.dim; i++)
{
MATCH m1 = deduceType((*e.keys)[i], sc, taa.index, parameters, dedtypes, wm);
if (m1 < result)
result = m1;
if (result <= MATCHnomatch)
break;
MATCH m2 = deduceType((*e.values)[i], sc, taa.next, parameters, dedtypes, wm);
if (m2 < result)
result = m2;
if (result <= MATCHnomatch)
break;
}
return;
}
visit(cast(Expression)e);
}
override void visit(FuncExp e)
{
//printf("e->type = %s, tparam = %s\n", e->type->toChars(), tparam->toChars());
if (e.td)
{
Type to = tparam;
if (!to.nextOf() || to.nextOf().ty != Tfunction)
return;
TypeFunction tof = cast(TypeFunction)to.nextOf();
// Parameter types inference from 'tof'
assert(e.td._scope);
TypeFunction tf = cast(TypeFunction)e.fd.type;
//printf("\ttof = %s\n", tof->toChars());
//printf("\ttf = %s\n", tf->toChars());
size_t dim = Parameter.dim(tf.parameters);
if (Parameter.dim(tof.parameters) != dim || tof.varargs != tf.varargs)
return;
auto tiargs = new Objects();
tiargs.reserve(e.td.parameters.dim);
for (size_t i = 0; i < e.td.parameters.dim; i++)
{
TemplateParameter tp = (*e.td.parameters)[i];
size_t u = 0;
for (; u < dim; u++)
{
Parameter p = Parameter.getNth(tf.parameters, u);
if (p.type.ty == Tident && (cast(TypeIdentifier)p.type).ident == tp.ident)
{
break;
}
}
assert(u < dim);
Parameter pto = Parameter.getNth(tof.parameters, u);
if (!pto)
break;
Type t = pto.type.syntaxCopy(); // Bugzilla 11774
if (reliesOnTident(t, parameters, inferStart))
return;
t = t.semantic(e.loc, sc);
if (t.ty == Terror)
return;
tiargs.push(t);
}
// Set target of return type inference
if (!tf.next && tof.next)
e.fd.treq = tparam;
auto ti = new TemplateInstance(e.loc, e.td, tiargs);
Expression ex = (new ScopeExp(e.loc, ti)).semantic(e.td._scope);
// Reset inference target for the later re-semantic
e.fd.treq = null;
if (ex.op == TOKerror)
return;
if (ex.op != TOKfunction)
return;
visit(ex.type);
return;
}
Type t = e.type;
if (t.ty == Tdelegate && tparam.ty == Tpointer)
return;
// Allow conversion from implicit function pointer to delegate
if (e.tok == TOKreserved && t.ty == Tpointer && tparam.ty == Tdelegate)
{
TypeFunction tf = cast(TypeFunction)t.nextOf();
t = (new TypeDelegate(tf)).merge();
}
//printf("tparam = %s <= e->type = %s, t = %s\n", tparam->toChars(), e->type->toChars(), t->toChars());
visit(t);
}
override void visit(SliceExp e)
{
Type taai;
if (e.type.ty == Tarray && (tparam.ty == Tsarray || tparam.ty == Taarray && (taai = (cast(TypeAArray)tparam).index).ty == Tident && (cast(TypeIdentifier)taai).idents.dim == 0))
{
// Consider compile-time known boundaries
if (Type tsa = toStaticArrayType(e))
{
tsa.accept(this);
return;
}
}
visit(cast(Expression)e);
}
override void visit(CommaExp e)
{
(cast(CommaExp)e).e2.accept(this);
}
}
scope DeduceType v = new DeduceType(sc, tparam, parameters, dedtypes, wm, inferStart);
if (Type t = isType(o))
t.accept(v);
else
{
assert(isExpression(o) && wm);
(cast(Expression)o).accept(v);
}
return v.result;
}
/***********************************************************
* Check whether the type t representation relies on one or more the template parameters.
* Params:
* t = Tested type, if null, returns false.
* tparams = Template parameters.
* iStart = Start index of tparams to limit the tested parameters. If it's
* nonzero, tparams[0..iStart] will be excluded from the test target.
*/
extern (C++) bool reliesOnTident(Type t, TemplateParameters* tparams = null, size_t iStart = 0)
{
extern (C++) final class ReliesOnTident : Visitor
{
alias visit = super.visit;
public:
TemplateParameters* tparams;
size_t iStart;
bool result;
extern (D) this(TemplateParameters* tparams, size_t iStart)
{
this.tparams = tparams;
this.iStart = iStart;
}
override void visit(Type t)
{
}
override void visit(TypeNext t)
{
t.next.accept(this);
}
override void visit(TypeVector t)
{
t.basetype.accept(this);
}
override void visit(TypeAArray t)
{
visit(cast(TypeNext)t);
if (!result)
t.index.accept(this);
}
override void visit(TypeFunction t)
{
size_t dim = Parameter.dim(t.parameters);
for (size_t i = 0; i < dim; i++)
{
Parameter fparam = Parameter.getNth(t.parameters, i);
fparam.type.accept(this);
if (result)
return;
}
if (t.next)
t.next.accept(this);
}
override void visit(TypeIdentifier t)
{
for (size_t i = iStart; i < tparams.dim; i++)
{
TemplateParameter tp = (*tparams)[i];
if (tp.ident.equals(t.ident))
{
result = true;
return;
}
}
}
override void visit(TypeInstance t)
{
for (size_t i = iStart; i < tparams.dim; i++)
{
TemplateParameter tp = (*tparams)[i];
if (t.tempinst.name == tp.ident)
{
result = true;
return;
}
}
if (!t.tempinst.tiargs)
return;
for (size_t i = 0; i < t.tempinst.tiargs.dim; i++)
{
Type ta = isType((*t.tempinst.tiargs)[i]);
if (ta)
{
ta.accept(this);
if (result)
return;
}
}
}
override void visit(TypeTypeof t)
{
//printf("TypeTypeof::reliesOnTident('%s')\n", t.toChars());
t.exp.accept(this);
}
override void visit(TypeTuple t)
{
if (t.arguments)
{
for (size_t i = 0; i < t.arguments.dim; i++)
{
Parameter arg = (*t.arguments)[i];
arg.type.accept(this);
if (result)
return;
}
}
}
override void visit(Expression e)
{
//printf("Expression::reliesOnTident('%s')\n", e.toChars());
}
override void visit(IdentifierExp e)
{
//printf("IdentifierExp::reliesOnTident('%s')\n", e.toChars());
for (size_t i = iStart; i < tparams.dim; i++)
{
auto tp = (*tparams)[i];
if (e.ident == tp.ident)
{
result = true;
return;
}
}
}
override void visit(TupleExp e)
{
//printf("TupleExp::reliesOnTident('%s')\n", e.toChars());
if (e.exps)
{
foreach (ea; *e.exps)
{
ea.accept(this);
if (result)
return;
}
}
}
override void visit(ArrayLiteralExp e)
{
//printf("ArrayLiteralExp::reliesOnTident('%s')\n", e.toChars());
if (e.elements)
{
foreach (el; *e.elements)
{
el.accept(this);
if (result)
return;
}
}
}
override void visit(AssocArrayLiteralExp e)
{
//printf("AssocArrayLiteralExp::reliesOnTident('%s')\n", e.toChars());
foreach (ek; *e.keys)
{
ek.accept(this);
if (result)
return;
}
foreach (ev; *e.values)
{
ev.accept(this);
if (result)
return;
}
}
override void visit(StructLiteralExp e)
{
//printf("StructLiteralExp::reliesOnTident('%s')\n", e.toChars());
if (e.elements)
{
foreach (ea; *e.elements)
{
ea.accept(this);
if (result)
return;
}
}
}
override void visit(TypeExp e)
{
//printf("TypeExp::reliesOnTident('%s')\n", e.toChars());
e.type.accept(this);
}
override void visit(NewExp e)
{
//printf("NewExp::reliesOnTident('%s')\n", e.toChars());
if (e.thisexp)
e.thisexp.accept(this);
if (!result && e.newargs)
{
foreach (ea; *e.newargs)
{
ea.accept(this);
if (result)
return;
}
}
e.newtype.accept(this);
if (!result && e.arguments)
{
foreach (ea; *e.arguments)
{
ea.accept(this);
if (result)
return;
}
}
}
override void visit(NewAnonClassExp e)
{
//printf("NewAnonClassExp::reliesOnTident('%s')\n", e.toChars());
result = true;
}
override void visit(FuncExp e)
{
//printf("FuncExp::reliesOnTident('%s')\n", e.toChars());
result = true;
}
override void visit(TypeidExp e)
{
//printf("TypeidExp::reliesOnTident('%s')\n", e.toChars());
if (auto ea = isExpression(e.obj))
ea.accept(this);
else if (auto ta = isType(e.obj))
ta.accept(this);
}
override void visit(TraitsExp e)
{
//printf("TraitsExp::reliesOnTident('%s')\n", e.toChars());
if (e.args)
{
foreach (oa; *e.args)
{
if (auto ea = isExpression(oa))
ea.accept(this);
else if (auto ta = isType(oa))
ta.accept(this);
if (result)
return;
}
}
}
override void visit(IsExp e)
{
//printf("IsExp::reliesOnTident('%s')\n", e.toChars());
e.targ.accept(this);
}
override void visit(UnaExp e)
{
//printf("UnaExp::reliesOnTident('%s')\n", e.toChars());
e.e1.accept(this);
}
override void visit(DotTemplateInstanceExp e)
{
//printf("DotTemplateInstanceExp::reliesOnTident('%s')\n", e.toChars());
visit(cast(UnaExp)e);
if (!result && e.ti.tiargs)
{
foreach (oa; *e.ti.tiargs)
{
if (auto ea = isExpression(oa))
ea.accept(this);
else if (auto ta = isType(oa))
ta.accept(this);
if (result)
return;
}
}
}
override void visit(CallExp e)
{
//printf("CallExp::reliesOnTident('%s')\n", e.toChars());
visit(cast(UnaExp)e);
if (!result && e.arguments)
{
foreach (ea; *e.arguments)
{
ea.accept(this);
if (result)
return;
}
}
}
override void visit(CastExp e)
{
//printf("CallExp::reliesOnTident('%s')\n", e.toChars());
visit(cast(UnaExp)e);
if (!result)
e.to.accept(this);
}
override void visit(SliceExp e)
{
//printf("SliceExp::reliesOnTident('%s')\n", e.toChars());
visit(cast(UnaExp)e);
if (!result && e.lwr)
e.lwr.accept(this);
if (!result && e.upr)
e.upr.accept(this);
}
override void visit(IntervalExp e)
{
//printf("IntervalExp::reliesOnTident('%s')\n", e.toChars());
e.lwr.accept(this);
if (!result)
e.upr.accept(this);
}
override void visit(ArrayExp e)
{
//printf("ArrayExp::reliesOnTident('%s')\n", e.toChars());
visit(cast(UnaExp)e);
if (!result && e.arguments)
{
foreach (ea; *e.arguments)
ea.accept(this);
}
}
override void visit(BinExp e)
{
//printf("BinExp::reliesOnTident('%s')\n", e.toChars());
e.e1.accept(this);
if (!result)
e.e2.accept(this);
}
override void visit(CondExp e)
{
//printf("BinExp::reliesOnTident('%s')\n", e.toChars());
e.econd.accept(this);
if (!result)
visit(cast(BinExp)e);
}
}
if (!t)
return false;
assert(tparams);
scope ReliesOnTident v = new ReliesOnTident(tparams, iStart);
t.accept(v);
return v.result;
}
/***********************************************************
*/
extern (C++) class TemplateParameter
{
public:
Loc loc;
Identifier ident;
/* True if this is a part of precedent parameter specialization pattern.
*
* template A(T : X!TL, alias X, TL...) {}
* // X and TL are dependent template parameter
*
* A dependent template parameter should return MATCHexact in matchArg()
* to respect the match level of the corresponding precedent parameter.
*/
bool dependent;
/* ======================== TemplateParameter =============================== */
final extern (D) this(Loc loc, Identifier ident)
{
this.loc = loc;
this.ident = ident;
}
TemplateTypeParameter isTemplateTypeParameter()
{
return null;
}
TemplateValueParameter isTemplateValueParameter()
{
return null;
}
TemplateAliasParameter isTemplateAliasParameter()
{
return null;
}
TemplateThisParameter isTemplateThisParameter()
{
return null;
}
TemplateTupleParameter isTemplateTupleParameter()
{
return null;
}
abstract TemplateParameter syntaxCopy();
abstract bool declareParameter(Scope* sc);
abstract bool semantic(Scope* sc, TemplateParameters* parameters);
abstract void print(RootObject oarg, RootObject oded);
abstract RootObject specialization();
abstract RootObject defaultArg(Loc instLoc, Scope* sc);
abstract bool hasDefaultArg();
/*******************************************
* Match to a particular TemplateParameter.
* Input:
* instLoc location that the template is instantiated.
* tiargs[] actual arguments to template instance
* i i'th argument
* parameters[] template parameters
* dedtypes[] deduced arguments to template instance
* *psparam set to symbol declared and initialized to dedtypes[i]
*/
MATCH matchArg(Loc instLoc, Scope* sc, Objects* tiargs, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
RootObject oarg;
if (i < tiargs.dim)
oarg = (*tiargs)[i];
else
{
// Get default argument instead
oarg = defaultArg(instLoc, sc);
if (!oarg)
{
assert(i < dedtypes.dim);
// It might have already been deduced
oarg = (*dedtypes)[i];
if (!oarg)
goto Lnomatch;
}
}
return matchArg(sc, oarg, i, parameters, dedtypes, psparam);
Lnomatch:
if (psparam)
*psparam = null;
return MATCHnomatch;
}
abstract MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam);
/* Create dummy argument based on parameter.
*/
abstract void* dummyArg();
void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Syntax:
* ident : specType = defaultType
*/
extern (C++) class TemplateTypeParameter : TemplateParameter
{
public:
Type specType; // if !=null, this is the type specialization
Type defaultType;
extern (C++) static __gshared Type tdummy = null;
final extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType)
{
super(loc, ident);
this.ident = ident;
this.specType = specType;
this.defaultType = defaultType;
}
override final TemplateTypeParameter isTemplateTypeParameter()
{
return this;
}
override TemplateParameter syntaxCopy()
{
return new TemplateTypeParameter(loc, ident, specType ? specType.syntaxCopy() : null, defaultType ? defaultType.syntaxCopy() : null);
}
override final bool declareParameter(Scope* sc)
{
//printf("TemplateTypeParameter::declareParameter('%s')\n", ident->toChars());
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
override final bool semantic(Scope* sc, TemplateParameters* parameters)
{
//printf("TemplateTypeParameter::semantic('%s')\n", ident->toChars());
if (specType && !reliesOnTident(specType, parameters))
{
specType = specType.semantic(loc, sc);
}
version (none)
{
// Don't do semantic() until instantiation
if (defaultType)
{
defaultType = defaultType.semantic(loc, sc);
}
}
return !(specType && isError(specType));
}
override final void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Type t = isType(oarg);
Type ta = isType(oded);
assert(ta);
if (specType)
printf("\tSpecialization: %s\n", specType.toChars());
if (defaultType)
printf("\tDefault: %s\n", defaultType.toChars());
printf("\tParameter: %s\n", t ? t.toChars() : "NULL");
printf("\tDeduced Type: %s\n", ta.toChars());
}
override final RootObject specialization()
{
return specType;
}
override final RootObject defaultArg(Loc instLoc, Scope* sc)
{
Type t = defaultType;
if (t)
{
t = t.syntaxCopy();
t = t.semantic(loc, sc); // use the parameter loc
}
return t;
}
override final bool hasDefaultArg()
{
return defaultType !is null;
}
override final MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateTypeParameter::matchArg('%s')\n", ident->toChars());
MATCH m = MATCHexact;
Type ta = isType(oarg);
if (!ta)
{
//printf("%s %p %p %p\n", oarg->toChars(), isExpression(oarg), isDsymbol(oarg), isTuple(oarg));
goto Lnomatch;
}
//printf("ta is %s\n", ta->toChars());
if (specType)
{
if (!ta || ta == tdummy)
goto Lnomatch;
//printf("\tcalling deduceType(): ta is %s, specType is %s\n", ta->toChars(), specType->toChars());
MATCH m2 = deduceType(ta, sc, specType, parameters, dedtypes);
if (m2 <= MATCHnomatch)
{
//printf("\tfailed deduceType\n");
goto Lnomatch;
}
if (m2 < m)
m = m2;
if ((*dedtypes)[i])
{
Type t = cast(Type)(*dedtypes)[i];
if (dependent && !t.equals(ta)) // Bugzilla 14357
goto Lnomatch;
/* This is a self-dependent parameter. For example:
* template X(T : T*) {}
* template X(T : S!T, alias S) {}
*/
//printf("t = %s ta = %s\n", t->toChars(), ta->toChars());
ta = t;
}
}
else
{
if ((*dedtypes)[i])
{
// Must match already deduced type
Type t = cast(Type)(*dedtypes)[i];
if (!t.equals(ta))
{
//printf("t = %s ta = %s\n", t->toChars(), ta->toChars());
goto Lnomatch;
}
}
else
{
// So that matches with specializations are better
m = MATCHconvert;
}
}
(*dedtypes)[i] = ta;
if (psparam)
*psparam = new AliasDeclaration(loc, ident, ta);
//printf("\tm = %d\n", m);
return dependent ? MATCHexact : m;
Lnomatch:
if (psparam)
*psparam = null;
//printf("\tm = %d\n", MATCHnomatch);
return MATCHnomatch;
}
override final void* dummyArg()
{
Type t = specType;
if (!t)
{
// Use this for alias-parameter's too (?)
if (!tdummy)
tdummy = new TypeIdentifier(loc, ident);
t = tdummy;
}
return cast(void*)t;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Syntax:
* this ident : specType = defaultType
*/
extern (C++) final class TemplateThisParameter : TemplateTypeParameter
{
public:
extern (D) this(Loc loc, Identifier ident, Type specType, Type defaultType)
{
super(loc, ident, specType, defaultType);
}
override TemplateThisParameter isTemplateThisParameter()
{
return this;
}
override TemplateParameter syntaxCopy()
{
return new TemplateThisParameter(loc, ident, specType ? specType.syntaxCopy() : null, defaultType ? defaultType.syntaxCopy() : null);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Syntax:
* valType ident : specValue = defaultValue
*/
extern (C++) final class TemplateValueParameter : TemplateParameter
{
public:
Type valType;
Expression specValue;
Expression defaultValue;
extern (C++) static __gshared AA* edummies = null;
extern (D) this(Loc loc, Identifier ident, Type valType,
Expression specValue, Expression defaultValue)
{
super(loc, ident);
this.ident = ident;
this.valType = valType;
this.specValue = specValue;
this.defaultValue = defaultValue;
}
override TemplateValueParameter isTemplateValueParameter()
{
return this;
}
override TemplateParameter syntaxCopy()
{
return new TemplateValueParameter(loc, ident,
valType.syntaxCopy(),
specValue ? specValue.syntaxCopy() : null,
defaultValue ? defaultValue.syntaxCopy() : null);
}
override bool declareParameter(Scope* sc)
{
auto v = new VarDeclaration(loc, valType, ident, null);
v.storage_class = STCtemplateparameter;
return sc.insert(v) !is null;
}
override bool semantic(Scope* sc, TemplateParameters* parameters)
{
valType = valType.semantic(loc, sc);
version (none)
{
// defer semantic analysis to arg match
if (specValue)
{
Expression e = specValue;
sc = sc.startCTFE();
e = e.semantic(sc);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, valType);
e = e.ctfeInterpret();
if (e.op == TOKint64 || e.op == TOKfloat64 ||
e.op == TOKcomplex80 || e.op == TOKnull || e.op == TOKstring)
specValue = e;
}
if (defaultValue)
{
Expression e = defaultValue;
sc = sc.startCTFE();
e = e.semantic(sc);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, valType);
e = e.ctfeInterpret();
if (e.op == TOKint64)
defaultValue = e;
}
}
return !isError(valType);
}
override void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Expression ea = isExpression(oded);
if (specValue)
printf("\tSpecialization: %s\n", specValue.toChars());
printf("\tParameter Value: %s\n", ea ? ea.toChars() : "NULL");
}
override RootObject specialization()
{
return specValue;
}
override RootObject defaultArg(Loc instLoc, Scope* sc)
{
Expression e = defaultValue;
if (e)
{
e = e.syntaxCopy();
e = e.semantic(sc);
e = resolveProperties(sc, e);
e = e.resolveLoc(instLoc, sc); // use the instantiated loc
e = e.optimize(WANTvalue);
}
return e;
}
override bool hasDefaultArg()
{
return defaultValue !is null;
}
override MATCH matchArg(Scope* sc, RootObject oarg,
size_t i, TemplateParameters* parameters, Objects* dedtypes,
Declaration* psparam)
{
//printf("TemplateValueParameter::matchArg('%s')\n", ident.toChars());
MATCH m = MATCHexact;
Expression ei = isExpression(oarg);
Type vt;
if (!ei && oarg)
{
Dsymbol si = isDsymbol(oarg);
FuncDeclaration f = si ? si.isFuncDeclaration() : null;
if (!f || !f.fbody || f.needThis())
goto Lnomatch;
ei = new VarExp(loc, f);
ei = ei.semantic(sc);
/* If a function is really property-like, and then
* it's CTFEable, ei will be a literal expression.
*/
uint olderrors = global.startGagging();
ei = resolveProperties(sc, ei);
ei = ei.ctfeInterpret();
if (global.endGagging(olderrors) || ei.op == TOKerror)
goto Lnomatch;
/* Bugzilla 14520: A property-like function can match to both
* TemplateAlias and ValueParameter. But for template overloads,
* it should always prefer alias parameter to be consistent
* template match result.
*
* template X(alias f) { enum X = 1; }
* template X(int val) { enum X = 2; }
* int f1() { return 0; } // CTFEable
* int f2(); // body-less function is not CTFEable
* enum x1 = X!f1; // should be 1
* enum x2 = X!f2; // should be 1
*
* e.g. The x1 value must be same even if the f1 definition will be moved
* into di while stripping body code.
*/
m = MATCHconvert;
}
if (ei && ei.op == TOKvar)
{
// Resolve const variables that we had skipped earlier
ei = ei.ctfeInterpret();
}
//printf("\tvalType: %s, ty = %d\n", valType->toChars(), valType->ty);
vt = valType.semantic(loc, sc);
//printf("ei: %s, ei->type: %s\n", ei->toChars(), ei->type->toChars());
//printf("vt = %s\n", vt->toChars());
if (ei.type)
{
MATCH m2 = ei.implicitConvTo(vt);
//printf("m: %d\n", m);
if (m2 < m)
m = m2;
if (m <= MATCHnomatch)
goto Lnomatch;
ei = ei.implicitCastTo(sc, vt);
ei = ei.ctfeInterpret();
}
if (specValue)
{
if (!ei || cast(Expression)dmd_aaGetRvalue(edummies, cast(void*)ei.type) == ei)
goto Lnomatch;
Expression e = specValue;
sc = sc.startCTFE();
e = e.semantic(sc);
e = resolveProperties(sc, e);
sc = sc.endCTFE();
e = e.implicitCastTo(sc, vt);
e = e.ctfeInterpret();
ei = ei.syntaxCopy();
sc = sc.startCTFE();
ei = ei.semantic(sc);
sc = sc.endCTFE();
ei = ei.implicitCastTo(sc, vt);
ei = ei.ctfeInterpret();
//printf("\tei: %s, %s\n", ei->toChars(), ei->type->toChars());
//printf("\te : %s, %s\n", e->toChars(), e->type->toChars());
if (!ei.equals(e))
goto Lnomatch;
}
else
{
if ((*dedtypes)[i])
{
// Must match already deduced value
Expression e = cast(Expression)(*dedtypes)[i];
if (!ei || !ei.equals(e))
goto Lnomatch;
}
}
(*dedtypes)[i] = ei;
if (psparam)
{
Initializer _init = new ExpInitializer(loc, ei);
Declaration sparam = new VarDeclaration(loc, vt, ident, _init);
sparam.storage_class = STCmanifest;
*psparam = sparam;
}
return dependent ? MATCHexact : m;
Lnomatch:
//printf("\tno match\n");
if (psparam)
*psparam = null;
return MATCHnomatch;
}
override void* dummyArg()
{
Expression e = specValue;
if (!e)
{
// Create a dummy value
Expression* pe = cast(Expression*)dmd_aaGet(&edummies, cast(void*)valType);
if (!*pe)
*pe = valType.defaultInit();
e = *pe;
}
return cast(void*)e;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
extern (C++) RootObject aliasParameterSemantic(Loc loc, Scope* sc, RootObject o, TemplateParameters* parameters)
{
if (o)
{
Expression ea = isExpression(o);
Type ta = isType(o);
if (ta && (!parameters || !reliesOnTident(ta, parameters)))
{
Dsymbol s = ta.toDsymbol(sc);
if (s)
o = s;
else
o = ta.semantic(loc, sc);
}
else if (ea)
{
sc = sc.startCTFE();
ea = ea.semantic(sc);
sc = sc.endCTFE();
o = ea.ctfeInterpret();
}
}
return o;
}
/***********************************************************
* Syntax:
* specType ident : specAlias = defaultAlias
*/
extern (C++) final class TemplateAliasParameter : TemplateParameter
{
public:
Type specType;
RootObject specAlias;
RootObject defaultAlias;
extern (C++) static __gshared Dsymbol sdummy = null;
extern (D) this(Loc loc, Identifier ident, Type specType, RootObject specAlias, RootObject defaultAlias)
{
super(loc, ident);
this.ident = ident;
this.specType = specType;
this.specAlias = specAlias;
this.defaultAlias = defaultAlias;
}
override TemplateAliasParameter isTemplateAliasParameter()
{
return this;
}
override TemplateParameter syntaxCopy()
{
return new TemplateAliasParameter(loc, ident, specType ? specType.syntaxCopy() : null, objectSyntaxCopy(specAlias), objectSyntaxCopy(defaultAlias));
}
override bool declareParameter(Scope* sc)
{
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
override bool semantic(Scope* sc, TemplateParameters* parameters)
{
if (specType && !reliesOnTident(specType, parameters))
{
specType = specType.semantic(loc, sc);
}
specAlias = aliasParameterSemantic(loc, sc, specAlias, parameters);
version (none)
{
// Don't do semantic() until instantiation
if (defaultAlias)
defaultAlias = defaultAlias.semantic(loc, sc);
}
return !(specType && isError(specType)) && !(specAlias && isError(specAlias));
}
override void print(RootObject oarg, RootObject oded)
{
printf(" %s\n", ident.toChars());
Dsymbol sa = isDsymbol(oded);
assert(sa);
printf("\tParameter alias: %s\n", sa.toChars());
}
override RootObject specialization()
{
return specAlias;
}
override RootObject defaultArg(Loc instLoc, Scope* sc)
{
RootObject da = defaultAlias;
Type ta = isType(defaultAlias);
if (ta)
{
if (ta.ty == Tinstance)
{
// If the default arg is a template, instantiate for each type
da = ta.syntaxCopy();
}
}
RootObject o = aliasParameterSemantic(loc, sc, da, null); // use the parameter loc
return o;
}
override bool hasDefaultArg()
{
return defaultAlias !is null;
}
override MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateAliasParameter::matchArg('%s')\n", ident->toChars());
MATCH m = MATCHexact;
Type ta = isType(oarg);
RootObject sa = ta && !ta.deco ? null : getDsymbol(oarg);
Expression ea = isExpression(oarg);
if (ea && (ea.op == TOKthis || ea.op == TOKsuper))
sa = (cast(ThisExp)ea).var;
else if (ea && ea.op == TOKscope)
sa = (cast(ScopeExp)ea).sds;
if (sa)
{
if ((cast(Dsymbol)sa).isAggregateDeclaration())
m = MATCHconvert;
/* specType means the alias must be a declaration with a type
* that matches specType.
*/
if (specType)
{
Declaration d = (cast(Dsymbol)sa).isDeclaration();
if (!d)
goto Lnomatch;
if (!d.type.equals(specType))
goto Lnomatch;
}
}
else
{
sa = oarg;
if (ea)
{
if (specType)
{
if (!ea.type.equals(specType))
goto Lnomatch;
}
}
else if (ta && ta.ty == Tinstance && !specAlias)
{
/* Bugzilla xxxxx: Specialized parameter should be prefeerd
* match to the template type parameter.
* template X(alias a) {} // a == this
* template X(alias a : B!A, alias B, A...) {} // B!A => ta
*/
}
else if (sa && sa == TemplateTypeParameter.tdummy)
{
/* Bugzilla 2025: Aggregate Types should preferentially
* match to the template type parameter.
* template X(alias a) {} // a == this
* template X(T) {} // T => sa
*/
}
else
goto Lnomatch;
}
if (specAlias)
{
if (sa == sdummy)
goto Lnomatch;
Dsymbol sx = isDsymbol(sa);
if (sa != specAlias && sx)
{
Type talias = isType(specAlias);
if (!talias)
goto Lnomatch;
TemplateInstance ti = sx.isTemplateInstance();
if (!ti && sx.parent)
{
ti = sx.parent.isTemplateInstance();
if (ti && ti.name != sx.ident)
goto Lnomatch;
}
if (!ti)
goto Lnomatch;
Type t = new TypeInstance(Loc(), ti);
MATCH m2 = deduceType(t, sc, talias, parameters, dedtypes);
if (m2 <= MATCHnomatch)
goto Lnomatch;
}
}
else if ((*dedtypes)[i])
{
// Must match already deduced symbol
RootObject si = (*dedtypes)[i];
if (!sa || si != sa)
goto Lnomatch;
}
(*dedtypes)[i] = sa;
if (psparam)
{
if (Dsymbol s = isDsymbol(sa))
{
*psparam = new AliasDeclaration(loc, ident, s);
}
else if (Type t = isType(sa))
{
*psparam = new AliasDeclaration(loc, ident, t);
}
else
{
assert(ea);
// Declare manifest constant
Initializer _init = new ExpInitializer(loc, ea);
auto v = new VarDeclaration(loc, null, ident, _init);
v.storage_class = STCmanifest;
v.semantic(sc);
*psparam = v;
}
}
return dependent ? MATCHexact : m;
Lnomatch:
if (psparam)
*psparam = null;
//printf("\tm = %d\n", MATCHnomatch);
return MATCHnomatch;
}
override void* dummyArg()
{
RootObject s = specAlias;
if (!s)
{
if (!sdummy)
sdummy = new Dsymbol();
s = sdummy;
}
return cast(void*)s;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Syntax:
* ident ...
*/
extern (C++) final class TemplateTupleParameter : TemplateParameter
{
public:
extern (D) this(Loc loc, Identifier ident)
{
super(loc, ident);
this.ident = ident;
}
override TemplateTupleParameter isTemplateTupleParameter()
{
return this;
}
override TemplateParameter syntaxCopy()
{
return new TemplateTupleParameter(loc, ident);
}
override bool declareParameter(Scope* sc)
{
auto ti = new TypeIdentifier(loc, ident);
Declaration ad = new AliasDeclaration(loc, ident, ti);
return sc.insert(ad) !is null;
}
override bool semantic(Scope* sc, TemplateParameters* parameters)
{
return true;
}
override void print(RootObject oarg, RootObject oded)
{
printf(" %s... [", ident.toChars());
Tuple v = isTuple(oded);
assert(v);
//printf("|%d| ", v->objects.dim);
for (size_t i = 0; i < v.objects.dim; i++)
{
if (i)
printf(", ");
RootObject o = v.objects[i];
Dsymbol sa = isDsymbol(o);
if (sa)
printf("alias: %s", sa.toChars());
Type ta = isType(o);
if (ta)
printf("type: %s", ta.toChars());
Expression ea = isExpression(o);
if (ea)
printf("exp: %s", ea.toChars());
assert(!isTuple(o)); // no nested Tuple arguments
}
printf("]\n");
}
override RootObject specialization()
{
return null;
}
override RootObject defaultArg(Loc instLoc, Scope* sc)
{
return null;
}
override bool hasDefaultArg()
{
return false;
}
override MATCH matchArg(Loc instLoc, Scope* sc, Objects* tiargs, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
/* The rest of the actual arguments (tiargs[]) form the match
* for the variadic parameter.
*/
assert(i + 1 == dedtypes.dim); // must be the last one
Tuple ovar;
if (Tuple u = isTuple((*dedtypes)[i]))
{
// It has already been deduced
ovar = u;
}
else if (i + 1 == tiargs.dim && isTuple((*tiargs)[i]))
ovar = isTuple((*tiargs)[i]);
else
{
ovar = new Tuple();
//printf("ovar = %p\n", ovar);
if (i < tiargs.dim)
{
//printf("i = %d, tiargs->dim = %d\n", i, tiargs->dim);
ovar.objects.setDim(tiargs.dim - i);
for (size_t j = 0; j < ovar.objects.dim; j++)
ovar.objects[j] = (*tiargs)[i + j];
}
}
return matchArg(sc, ovar, i, parameters, dedtypes, psparam);
}
override MATCH matchArg(Scope* sc, RootObject oarg, size_t i, TemplateParameters* parameters, Objects* dedtypes, Declaration* psparam)
{
//printf("TemplateTupleParameter::matchArg('%s')\n", ident->toChars());
Tuple ovar = isTuple(oarg);
if (!ovar)
return MATCHnomatch;
if ((*dedtypes)[i])
{
Tuple tup = isTuple((*dedtypes)[i]);
if (!tup)
return MATCHnomatch;
if (!match(tup, ovar))
return MATCHnomatch;
}
(*dedtypes)[i] = ovar;
if (psparam)
*psparam = new TupleDeclaration(loc, ident, &ovar.objects);
return dependent ? MATCHexact : MATCHconvert;
}
override void* dummyArg()
{
return null;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Given:
* foo!(args) =>
* name = foo
* tiargs = args
*/
extern (C++) class TemplateInstance : ScopeDsymbol
{
public:
Identifier name;
// Array of Types/Expressions of template
// instance arguments [int*, char, 10*10]
Objects* tiargs;
// Array of Types/Expressions corresponding
// to TemplateDeclaration.parameters
// [int, char, 100]
Objects tdtypes;
Dsymbol tempdecl; // referenced by foo.bar.abc
Dsymbol enclosing; // if referencing local symbols, this is the context
Dsymbol aliasdecl; // !=null if instance is an alias for its sole member
TemplateInstance inst; // refer to existing instance
ScopeDsymbol argsym; // argument symbol table
int inuse; // for recursive expansion detection
int nest; // for recursive pretty printing detection
bool semantictiargsdone; // has semanticTiargs() been done?
bool havetempdecl; // if used second constructor
bool gagged; // if the instantiation is done with error gagging
hash_t hash; // cached result of hashCode()
Expressions* fargs; // for function template, these are the function arguments
TemplateInstances* deferred;
// Used to determine the instance needs code generation.
// Note that these are inaccurate until semantic analysis phase completed.
TemplateInstance tinst; // enclosing template instance
TemplateInstance tnext; // non-first instantiated instances
Module minst; // the top module that instantiated this instance
final extern (D) this(Loc loc, Identifier ident)
{
super(null);
static if (LOG)
{
printf("TemplateInstance(this = %p, ident = '%s')\n", this, ident ? ident.toChars() : "null");
}
this.loc = loc;
this.name = ident;
}
/*****************
* This constructor is only called when we figured out which function
* template to instantiate.
*/
final extern (D) this(Loc loc, TemplateDeclaration td, Objects* tiargs)
{
super(null);
static if (LOG)
{
printf("TemplateInstance(this = %p, tempdecl = '%s')\n", this, td.toChars());
}
this.loc = loc;
this.name = td.ident;
this.tiargs = tiargs;
this.tempdecl = td;
this.semantictiargsdone = true;
this.havetempdecl = true;
assert(tempdecl._scope);
}
final static Objects* arraySyntaxCopy(Objects* objs)
{
Objects* a = null;
if (objs)
{
a = new Objects();
a.setDim(objs.dim);
for (size_t i = 0; i < objs.dim; i++)
(*a)[i] = objectSyntaxCopy((*objs)[i]);
}
return a;
}
override Dsymbol syntaxCopy(Dsymbol s)
{
TemplateInstance ti = s ? cast(TemplateInstance)s : new TemplateInstance(loc, name);
ti.tiargs = arraySyntaxCopy(tiargs);
TemplateDeclaration td;
if (inst && tempdecl && (td = tempdecl.isTemplateDeclaration()) !is null)
td.ScopeDsymbol.syntaxCopy(ti);
else
ScopeDsymbol.syntaxCopy(ti);
return ti;
}
void semantic(Scope* sc, Expressions* fargs)
{
//printf("[%s] TemplateInstance::semantic('%s', this=%p, gag = %d, sc = %p)\n", loc.toChars(), toChars(), this, global.gag, sc);
version (none)
{
for (Dsymbol s = this; s; s = s.parent)
{
printf("\t%s\n", s.toChars());
}
printf("Scope\n");
for (Scope* scx = sc; scx; scx = scx.enclosing)
{
printf("\t%s parent %s\n", scx._module ? scx._module.toChars() : "null", scx.parent ? scx.parent.toChars() : "null");
}
}
static if (LOG)
{
printf("\n+TemplateInstance::semantic('%s', this=%p)\n", toChars(), this);
}
if (inst) // if semantic() was already run
{
static if (LOG)
{
printf("-TemplateInstance::semantic('%s', this=%p) already run\n", inst.toChars(), inst);
}
return;
}
if (semanticRun != PASSinit)
{
static if (LOG)
{
printf("Recursive template expansion\n");
}
auto ungag = Ungag(global.gag);
if (!gagged)
global.gag = 0;
error(loc, "recursive template expansion");
if (gagged)
semanticRun = PASSinit;
else
inst = this;
errors = true;
return;
}
// Get the enclosing template instance from the scope tinst
tinst = sc.tinst;
// Get the instantiating module from the scope minst
minst = sc.minst;
// Bugzilla 10920: If the enclosing function is non-root symbol,
// this instance should be speculative.
if (!tinst && sc.func && sc.func.inNonRoot())
{
minst = null;
}
gagged = (global.gag > 0);
semanticRun = PASSsemantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
/* Find template declaration first,
* then run semantic on each argument (place results in tiargs[]),
* last find most specialized template from overload list/set.
*/
if (!findTempDecl(sc, null) || !semanticTiargs(sc) || !findBestMatch(sc, fargs))
{
Lerror:
if (gagged)
{
// Bugzilla 13220: Rollback status for later semantic re-running.
semanticRun = PASSinit;
}
else
inst = this;
errors = true;
return;
}
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
// If tempdecl is a mixin, disallow it
if (tempdecl.ismixin)
{
error("mixin templates are not regular templates");
goto Lerror;
}
hasNestedArgs(tiargs, tempdecl.isstatic);
if (errors)
goto Lerror;
/* See if there is an existing TemplateInstantiation that already
* implements the typeargs. If so, just refer to that one instead.
*/
inst = tempdecl.findExistingInstance(this, fargs);
TemplateInstance errinst = null;
if (!inst)
{
// So, we need to implement 'this' instance.
}
else if (inst.gagged && !gagged && inst.errors)
{
// If the first instantiation had failed, re-run semantic,
// so that error messages are shown.
errinst = inst;
}
else
{
// It's a match
parent = inst.parent;
errors = inst.errors;
// If both this and the previous instantiation were gagged,
// use the number of errors that happened last time.
global.errors += errors;
global.gaggedErrors += errors;
// If the first instantiation was gagged, but this is not:
if (inst.gagged)
{
// It had succeeded, mark it is a non-gagged instantiation,
// and reuse it.
inst.gagged = gagged;
}
this.tnext = inst.tnext;
inst.tnext = this;
/* A module can have explicit template instance and its alias
* in module scope (e,g, `alias Base64 = Base64Impl!('+', '/');`).
* If the first instantiation 'inst' had happened in non-root module,
* compiler can assume that its instantiated code would be included
* in the separately compiled obj/lib file (e.g. phobos.lib).
*
* However, if 'this' second instantiation happened in root module,
* compiler might need to invoke its codegen (Bugzilla 2500 & 2644).
* But whole import graph is not determined until all semantic pass finished,
* so 'inst' should conservatively finish the semantic3 pass for the codegen.
*/
if (minst && minst.isRoot() && !(inst.minst && inst.minst.isRoot()))
{
/* Swap the position of 'inst' and 'this' in the instantiation graph.
* Then, the primary instance `inst` will be changed to a root instance.
*
* Before:
* non-root -> A!() -> B!()[inst] -> C!()
* |
* root -> D!() -> B!()[this]
*
* After:
* non-root -> A!() -> B!()[this]
* |
* root -> D!() -> B!()[inst] -> C!()
*/
Module mi = minst;
TemplateInstance ti = tinst;
minst = inst.minst;
tinst = inst.tinst;
inst.minst = mi;
inst.tinst = ti;
if (minst) // if inst was not speculative
{
/* Add 'inst' once again to the root module members[], then the
* instance members will get codegen chances.
*/
inst.appendToModuleMember();
}
}
static if (LOG)
{
printf("\tit's a match with instance %p, %d\n", inst, inst.semanticRun);
}
return;
}
static if (LOG)
{
printf("\timplement template instance %s '%s'\n", tempdecl.parent.toChars(), toChars());
printf("\ttempdecl %s\n", tempdecl.toChars());
}
uint errorsave = global.errors;
inst = this;
parent = enclosing ? enclosing : tempdecl.parent;
//printf("parent = '%s'\n", parent->kind());
TemplateInstance tempdecl_instance_idx = tempdecl.addInstance(this);
//getIdent();
// Store the place we added it to in target_symbol_list(_idx) so we can
// remove it later if we encounter an error.
Dsymbols* target_symbol_list = appendToModuleMember();
size_t target_symbol_list_idx = target_symbol_list ? target_symbol_list.dim - 1 : 0;
// Copy the syntax trees from the TemplateDeclaration
members = Dsymbol.arraySyntaxCopy(tempdecl.members);
// resolve TemplateThisParameter
for (size_t i = 0; i < tempdecl.parameters.dim; i++)
{
if ((*tempdecl.parameters)[i].isTemplateThisParameter() is null)
continue;
Type t = isType((*tiargs)[i]);
assert(t);
if (StorageClass stc = ModToStc(t.mod))
{
//printf("t = %s, stc = x%llx\n", t->toChars(), stc);
auto s = new Dsymbols();
s.push(new StorageClassDeclaration(stc, members));
members = s;
}
break;
}
// Create our own scope for the template parameters
Scope* _scope = tempdecl._scope;
if (tempdecl.semanticRun == PASSinit)
{
error("template instantiation %s forward references template declaration %s", toChars(), tempdecl.toChars());
return;
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", toChars());
}
argsym = new ScopeDsymbol();
argsym.parent = _scope.parent;
_scope = _scope.push(argsym);
_scope.tinst = this;
_scope.minst = minst;
//scope->stc = 0;
// Declare each template parameter as an alias for the argument type
Scope* paramscope = _scope.push();
paramscope.stc = 0;
paramscope.protection = Prot(PROTpublic); // Bugzilla 14169: template parameters should be public
declareParameters(paramscope);
paramscope.pop();
// Add members of template instance to template instance symbol table
// parent = scope->scopesym;
symtab = new DsymbolTable();
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
static if (LOG)
{
printf("\t[%d] adding member '%s' %p kind %s to '%s'\n", i, s.toChars(), s, s.kind(), this.toChars());
}
s.addMember(_scope, this);
}
static if (LOG)
{
printf("adding members done\n");
}
/* See if there is only one member of template instance, and that
* member has the same name as the template instance.
* If so, this template instance becomes an alias for that member.
*/
//printf("members->dim = %d\n", members->dim);
if (members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, tempdecl.ident) && s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl\n");
aliasdecl = s;
}
}
/* If function template declaration
*/
if (fargs && aliasdecl)
{
FuncDeclaration fd = aliasdecl.isFuncDeclaration();
if (fd)
{
/* Transmit fargs to type so that TypeFunction::semantic() can
* resolve any "auto ref" storage classes.
*/
TypeFunction tf = cast(TypeFunction)fd.type;
if (tf && tf.ty == Tfunction)
tf.fargs = fargs;
}
}
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", toChars());
}
Scope* sc2;
sc2 = _scope.push(this);
//printf("enclosing = %d, sc->parent = %s\n", enclosing, sc->parent->toChars());
sc2.parent = this;
sc2.tinst = this;
sc2.minst = minst;
tryExpandMembers(sc2);
semanticRun = PASSsemanticdone;
/* ConditionalDeclaration may introduce eponymous declaration,
* so we should find it once again after semantic.
*/
if (members.dim)
{
Dsymbol s;
if (Dsymbol.oneMembers(members, &s, tempdecl.ident) && s)
{
if (!aliasdecl || aliasdecl != s)
{
//printf("tempdecl.ident = %s, s = '%s'\n", tempdecl.ident.toChars(), s.kind(), s.toPrettyChars());
//printf("setting aliasdecl 2\n");
aliasdecl = s;
}
}
}
if (global.errors != errorsave)
goto Laftersemantic;
/* If any of the instantiation members didn't get semantic() run
* on them due to forward references, we cannot run semantic2()
* or semantic3() yet.
*/
{
bool found_deferred_ad = false;
for (size_t i = 0; i < Module.deferred.dim; i++)
{
Dsymbol sd = Module.deferred[i];
AggregateDeclaration ad = sd.isAggregateDeclaration();
if (ad && ad.parent && ad.parent.isTemplateInstance())
{
//printf("deferred template aggregate: %s %s\n",
// sd->parent->toChars(), sd->toChars());
found_deferred_ad = true;
if (ad.parent == this)
{
ad.deferred = this;
break;
}
}
}
if (found_deferred_ad || Module.deferred.dim)
goto Laftersemantic;
}
/* The problem is when to parse the initializer for a variable.
* Perhaps VarDeclaration::semantic() should do it like it does
* for initializers inside a function.
*/
//if (sc->parent->isFuncDeclaration())
{
/* BUG 782: this has problems if the classes this depends on
* are forward referenced. Find a way to defer semantic()
* on this template.
*/
semantic2(sc2);
}
if (global.errors != errorsave)
goto Laftersemantic;
if (sc.func && !tinst)
{
/* If a template is instantiated inside function, the whole instantiation
* should be done at that position. But, immediate running semantic3 of
* dependent templates may cause unresolved forward reference (Bugzilla 9050).
* To avoid the issue, don't run semantic3 until semantic and semantic2 done.
*/
TemplateInstances deferred;
this.deferred = &deferred;
//printf("Run semantic3 on %s\n", toChars());
trySemantic3(sc2);
for (size_t i = 0; i < deferred.dim; i++)
{
//printf("+ run deferred semantic3 on %s\n", deferred[i]->toChars());
deferred[i].semantic3(null);
}
this.deferred = null;
}
else if (tinst)
{
bool doSemantic3 = false;
if (sc.func && aliasdecl && aliasdecl.toAlias().isFuncDeclaration())
{
/* Template function instantiation should run semantic3 immediately
* for attribute inference.
*/
doSemantic3 = true;
}
else if (sc.func)
{
/* A lambda function in template arguments might capture the
* instantiated scope context. For the correct context inference,
* all instantiated functions should run the semantic3 immediately.
* See also compilable/test14973.d
*/
foreach (oarg; tdtypes)
{
auto s = getDsymbol(oarg);
if (!s)
continue;
if (auto td = s.isTemplateDeclaration())
{
if (!td.literal)
continue;
assert(td.members && td.members.dim == 1);
s = (*td.members)[0];
}
if (auto fld = s.isFuncLiteralDeclaration())
{
if (fld.tok == TOKreserved)
{
doSemantic3 = true;
break;
}
}
}
//printf("[%s] %s doSemantic3 = %d\n", loc.toChars(), toChars(), doSemantic3);
}
if (doSemantic3)
trySemantic3(sc2);
TemplateInstance ti = tinst;
int nest = 0;
while (ti && !ti.deferred && ti.tinst)
{
ti = ti.tinst;
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
}
if (ti && ti.deferred)
{
//printf("deferred semantic3 of %p %s, ti = %s, ti->deferred = %p\n", this, toChars(), ti->toChars());
for (size_t i = 0;; i++)
{
if (i == ti.deferred.dim)
{
ti.deferred.push(this);
break;
}
if ((*ti.deferred)[i] == this)
break;
}
}
}
if (aliasdecl)
{
/* Bugzilla 13816: AliasDeclaration tries to resolve forward reference
* twice (See inuse check in AliasDeclaration::toAlias()). It's
* necessary to resolve mutual references of instantiated symbols, but
* it will left a true recursive alias in tuple declaration - an
* AliasDeclaration A refers TupleDeclaration B, and B contains A
* in its elements. To correctly make it an error, we strictly need to
* resolve the alias of eponymous member.
*/
aliasdecl = aliasdecl.toAlias2();
}
Laftersemantic:
sc2.pop();
_scope.pop();
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
if (gagged)
{
// Errors are gagged, so remove the template instance from the
// instance/symbol lists we added it to and reset our state to
// finish clean and so we can try to instantiate it again later
// (see bugzilla 4302 and 6602).
tempdecl.removeInstance(tempdecl_instance_idx);
if (target_symbol_list)
{
// Because we added 'this' in the last position above, we
// should be able to remove it without messing other indices up.
assert((*target_symbol_list)[target_symbol_list_idx] == this);
target_symbol_list.remove(target_symbol_list_idx);
}
semanticRun = PASSinit;
inst = null;
symtab = null;
}
}
else if (errinst)
{
/* Bugzilla 14541: If the previous gagged instance had failed by
* circular references, currrent "error reproduction instantiation"
* might succeed, because of the difference of instantiated context.
* On such case, the cached error instance needs to be overridden by the
* succeeded instance.
*/
size_t bi = hash % tempdecl.buckets.dim;
TemplateInstances* instances = tempdecl.buckets[bi];
assert(instances);
for (size_t i = 0; i < instances.dim; i++)
{
TemplateInstance ti = (*instances)[i];
if (ti == errinst)
{
(*instances)[i] = this; // override
break;
}
}
}
static if (LOG)
{
printf("-TemplateInstance::semantic('%s', this=%p)\n", toChars(), this);
}
}
override void semantic(Scope* sc)
{
semantic(sc, null);
}
override void semantic2(Scope* sc)
{
if (semanticRun >= PASSsemantic2)
return;
semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateInstance::semantic2('%s')\n", toChars());
}
if (!errors && members)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
assert(sc);
sc = sc.push(argsym);
sc = sc.push(this);
sc.tinst = this;
sc.minst = minst;
int needGagging = (gagged && !global.gag);
uint olderrors = global.errors;
int oldGaggedErrors = -1; // dead-store to prevent spurious warning
if (needGagging)
oldGaggedErrors = global.startGagging();
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
if (gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
static if (LOG)
{
printf("-TemplateInstance::semantic2('%s')\n", toChars());
}
}
override void semantic3(Scope* sc)
{
static if (LOG)
{
printf("TemplateInstance::semantic3('%s'), semanticRun = %d\n", toChars(), semanticRun);
}
//if (toChars()[0] == 'D') *(char*)0=0;
if (semanticRun >= PASSsemantic3)
return;
semanticRun = PASSsemantic3;
if (!errors && members)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
sc = tempdecl._scope;
sc = sc.push(argsym);
sc = sc.push(this);
sc.tinst = this;
sc.minst = minst;
int needGagging = (gagged && !global.gag);
uint olderrors = global.errors;
int oldGaggedErrors = -1; // dead-store to prevent spurious warning
/* If this is a gagged instantiation, gag errors.
* Future optimisation: If the results are actually needed, errors
* would already be gagged, so we don't really need to run semantic
* on the members.
*/
if (needGagging)
oldGaggedErrors = global.startGagging();
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic3(sc);
if (gagged && global.errors != olderrors)
break;
}
if (global.errors != olderrors)
{
if (!errors)
{
if (!tempdecl.literal)
error(loc, "error instantiating");
if (tinst)
tinst.printInstantiationTrace();
}
errors = true;
}
if (needGagging)
global.endGagging(oldGaggedErrors);
sc = sc.pop();
sc.pop();
}
}
// resolve real symbol
override final Dsymbol toAlias()
{
static if (LOG)
{
printf("TemplateInstance::toAlias()\n");
}
if (!inst)
{
// Maybe we can resolve it
if (_scope)
{
semantic(_scope);
}
if (!inst)
{
error("cannot resolve forward reference");
errors = true;
return this;
}
}
if (inst != this)
return inst.toAlias();
if (aliasdecl)
{
return aliasdecl.toAlias();
}
return inst;
}
override const(char)* kind() const
{
return "template instance";
}
override bool oneMember(Dsymbol* ps, Identifier ident)
{
*ps = null;
return true;
}
override const(char)* toChars()
{
OutBuffer buf;
toCBufferInstance(this, &buf);
return buf.extractString();
}
override final char* toPrettyCharsHelper()
{
OutBuffer buf;
toCBufferInstance(this, &buf, true);
return buf.extractString();
}
/**************************************
* Given an error instantiating the TemplateInstance,
* give the nested TemplateInstance instantiations that got
* us here. Those are a list threaded into the nested scopes.
*/
final void printInstantiationTrace()
{
if (global.gag)
return;
const(uint) max_shown = 6;
const(char)* format = "instantiated from here: %s";
// determine instantiation depth and number of recursive instantiations
int n_instantiations = 1;
int n_totalrecursions = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
++n_instantiations;
// If two instantiations use the same declaration, they are recursive.
// (this works even if they are instantiated from different places in the
// same template).
// In principle, we could also check for multiple-template recursion, but it's
// probably not worthwhile.
if (cur.tinst && cur.tempdecl && cur.tinst.tempdecl && cur.tempdecl.loc.equals(cur.tinst.tempdecl.loc))
++n_totalrecursions;
}
// show full trace only if it's short or verbose is on
if (n_instantiations <= max_shown || global.params.verbose)
{
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
errorSupplemental(cur.loc, format, cur.toChars());
}
}
else if (n_instantiations - n_totalrecursions <= max_shown)
{
// By collapsing recursive instantiations into a single line,
// we can stay under the limit.
int recursionDepth = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
if (cur.tinst && cur.tempdecl && cur.tinst.tempdecl && cur.tempdecl.loc.equals(cur.tinst.tempdecl.loc))
{
++recursionDepth;
}
else
{
if (recursionDepth)
errorSupplemental(cur.loc, "%d recursive instantiations from here: %s", recursionDepth + 2, cur.toChars());
else
errorSupplemental(cur.loc, format, cur.toChars());
recursionDepth = 0;
}
}
}
else
{
// Even after collapsing the recursions, the depth is too deep.
// Just display the first few and last few instantiations.
uint i = 0;
for (TemplateInstance cur = this; cur; cur = cur.tinst)
{
cur.errors = true;
if (i == max_shown / 2)
errorSupplemental(cur.loc, "... (%d instantiations, -v to show) ...", n_instantiations - max_shown);
if (i < max_shown / 2 || i >= n_instantiations - max_shown + max_shown / 2)
errorSupplemental(cur.loc, format, cur.toChars());
++i;
}
}
}
/*************************************
* Lazily generate identifier for template instance.
* This is because 75% of the ident's are never needed.
*/
override final Identifier getIdent()
{
if (!ident && inst && !errors)
ident = genIdent(tiargs); // need an identifier for name mangling purposes.
return ident;
}
override final int compare(RootObject o)
{
TemplateInstance ti = cast(TemplateInstance)o;
//printf("this = %p, ti = %p\n", this, ti);
assert(tdtypes.dim == ti.tdtypes.dim);
// Nesting must match
if (enclosing != ti.enclosing)
{
//printf("test2 enclosing %s ti->enclosing %s\n", enclosing ? enclosing->toChars() : "", ti->enclosing ? ti->enclosing->toChars() : "");
goto Lnotequals;
}
//printf("parent = %s, ti->parent = %s\n", parent->toPrettyChars(), ti->parent->toPrettyChars());
if (!arrayObjectMatch(&tdtypes, &ti.tdtypes))
goto Lnotequals;
/* Template functions may have different instantiations based on
* "auto ref" parameters.
*/
if (auto fd = ti.toAlias().isFuncDeclaration())
{
if (!fd.errors)
{
auto fparameters = fd.getParameters(null);
size_t nfparams = Parameter.dim(fparameters); // Num function parameters
for (size_t j = 0; j < nfparams; j++)
{
Parameter fparam = Parameter.getNth(fparameters, j);
if (fparam.storageClass & STCautoref) // if "auto ref"
{
if (!fargs)
goto Lnotequals;
if (fargs.dim <= j)
break;
Expression farg = (*fargs)[j];
if (farg.isLvalue())
{
if (!(fparam.storageClass & STCref))
goto Lnotequals;
// auto ref's don't match
}
else
{
if (fparam.storageClass & STCref)
goto Lnotequals;
// auto ref's don't match
}
}
}
}
}
return 0;
Lnotequals:
return 1;
}
final hash_t hashCode()
{
if (!hash)
{
hash = cast(size_t)cast(void*)enclosing;
hash += arrayObjectHash(&tdtypes);
}
return hash;
}
/***********************************************
* Returns true if this is not instantiated in non-root module, and
* is a part of non-speculative instantiatiation.
*
* Note: minst does not stabilize until semantic analysis is completed,
* so don't call this function during semantic analysis to return precise result.
*/
final bool needsCodegen()
{
// Now -allInst is just for the backward compatibility.
if (global.params.allInst)
{
//printf("%s minst = %s, enclosing (%s)->isNonRoot = %d\n",
// toPrettyChars(), minst ? minst->toChars() : NULL,
// enclosing ? enclosing->toPrettyChars() : NULL, enclosing && enclosing->inNonRoot());
if (enclosing)
{
// Bugzilla 14588: If the captured context is not a function
// (e.g. class), the instance layout determination is guaranteed,
// because the semantic/semantic2 pass will be executed
// even for non-root instances.
if (!enclosing.isFuncDeclaration())
return true;
// Bugzilla 14834: If the captured context is a function,
// this excessive instantiation may cause ODR violation, because
// -allInst and others doesn't guarantee the semantic3 execution
// for that function.
// If the enclosing is also an instantiated function,
// we have to rely on the ancestor's needsCodegen() result.
if (TemplateInstance ti = enclosing.isInstantiated())
return ti.needsCodegen();
// Bugzilla 13415: If and only if the enclosing scope needs codegen,
// this nested templates would also need code generation.
return !enclosing.inNonRoot();
}
return true;
}
if (!minst)
{
// If this is a speculative instantiation,
// 1. do codegen if ancestors really needs codegen.
// 2. become non-speculative if siblings are not speculative
TemplateInstance tnext = this.tnext;
TemplateInstance tinst = this.tinst;
// At first, disconnect chain first to prevent infinite recursion.
this.tnext = null;
this.tinst = null;
// Determine necessity of tinst before tnext.
if (tinst && tinst.needsCodegen())
{
minst = tinst.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
if (tnext && (tnext.needsCodegen() || tnext.minst))
{
minst = tnext.minst; // cache result
assert(minst);
return minst.isRoot() || minst.rootImports();
}
// Elide codegen because this is really speculative.
return false;
}
/* Even when this is reached to the codegen pass,
* a non-root nested template should not generate code,
* due to avoid ODR violation.
*/
if (enclosing && enclosing.inNonRoot())
{
if (tinst)
{
auto r = tinst.needsCodegen();
minst = tinst.minst; // cache result
return r;
}
if (tnext)
{
auto r = tnext.needsCodegen();
minst = tnext.minst; // cache result
return r;
}
return false;
}
/* The issue is that if the importee is compiled with a different -debug
* setting than the importer, the importer may believe it exists
* in the compiled importee when it does not, when the instantiation
* is behind a conditional debug declaration.
*/
// workaround for Bugzilla 11239
if (global.params.useUnitTests ||
global.params.debuglevel)
{
// Prefer instantiations from root modules, to maximize link-ability.
if (minst.isRoot())
return true;
TemplateInstance tnext = this.tnext;
TemplateInstance tinst = this.tinst;
this.tnext = null;
this.tinst = null;
if (tinst && tinst.needsCodegen())
{
minst = tinst.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
if (tnext && tnext.needsCodegen())
{
minst = tnext.minst; // cache result
assert(minst);
assert(minst.isRoot() || minst.rootImports());
return true;
}
// Bugzilla 2500 case
if (minst.rootImports())
return true;
// Elide codegen because this is not included in root instances.
return false;
}
else
{
// Prefer instantiations from non-root module, to minimize object code size.
/* If a TemplateInstance is ever instantiated by non-root modules,
* we do not have to generate code for it,
* because it will be generated when the non-root module is compiled.
*
* But, if the non-root 'minst' imports any root modules, it might still need codegen.
*
* The problem is if A imports B, and B imports A, and both A
* and B instantiate the same template, does the compilation of A
* or the compilation of B do the actual instantiation?
*
* See Bugzilla 2500.
*/
if (!minst.isRoot() && !minst.rootImports())
return false;
TemplateInstance tnext = this.tnext;
this.tnext = null;
if (tnext && !tnext.needsCodegen() && tnext.minst)
{
minst = tnext.minst; // cache result
assert(!minst.isRoot());
return false;
}
// Do codegen because this is not included in non-root instances.
return true;
}
}
/**********************************************
* Find template declaration corresponding to template instance.
*
* Returns:
* false if finding fails.
* Note:
* This function is reentrant against error occurrence. If returns false,
* any members of this object won't be modified, and repetition call will
* reproduce same error.
*/
final bool findTempDecl(Scope* sc, WithScopeSymbol* pwithsym)
{
if (pwithsym)
*pwithsym = null;
if (havetempdecl)
return true;
//printf("TemplateInstance::findTempDecl() %s\n", toChars());
if (!tempdecl)
{
/* Given:
* foo!( ... )
* figure out which TemplateDeclaration foo refers to.
*/
Identifier id = name;
Dsymbol scopesym;
Dsymbol s = sc.search(loc, id, &scopesym);
if (!s)
{
s = sc.search_correct(id);
if (s)
error("template '%s' is not defined, did you mean %s?", id.toChars(), s.toChars());
else
error("template '%s' is not defined", id.toChars());
return false;
}
static if (LOG)
{
printf("It's an instance of '%s' kind '%s'\n", s.toChars(), s.kind());
if (s.parent)
printf("s->parent = '%s'\n", s.parent.toChars());
}
if (pwithsym)
*pwithsym = scopesym.isWithScopeSymbol();
/* We might have found an alias within a template when
* we really want the template.
*/
TemplateInstance ti;
if (s.parent && (ti = s.parent.isTemplateInstance()) !is null)
{
if (ti.tempdecl && ti.tempdecl.ident == id)
{
/* This is so that one can refer to the enclosing
* template, even if it has the same name as a member
* of the template, if it has a !(arguments)
*/
TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration();
assert(td);
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
s = td;
}
}
if (!updateTempDecl(sc, s))
{
return false;
}
}
assert(tempdecl);
// Look for forward references
auto tovers = tempdecl.isOverloadSet();
foreach (size_t oi; 0 .. tovers ? tovers.a.dim : 1)
{
Dsymbol dstart = tovers ? tovers.a[oi] : tempdecl;
int r = overloadApply(dstart, (Dsymbol s)
{
auto td = s.isTemplateDeclaration();
if (!td)
return 0;
if (td.semanticRun == PASSinit)
{
if (td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
error("%s forward references template declaration %s",
toChars(), td.toChars());
return 1;
}
}
return 0;
});
if (r)
return false;
}
return true;
}
/**********************************************
* Confirm s is a valid template, then store it.
* Input:
* sc
* s candidate symbol of template. It may be:
* TemplateDeclaration
* FuncDeclaration with findTemplateDeclRoot() != NULL
* OverloadSet which contains candidates
* Returns:
* true if updating succeeds.
*/
final bool updateTempDecl(Scope* sc, Dsymbol s)
{
if (s)
{
Identifier id = name;
s = s.toAlias();
/* If an OverloadSet, look for a unique member that is a template declaration
*/
OverloadSet os = s.isOverloadSet();
if (os)
{
s = null;
for (size_t i = 0; i < os.a.dim; i++)
{
Dsymbol s2 = os.a[i];
if (FuncDeclaration f = s2.isFuncDeclaration())
s2 = f.findTemplateDeclRoot();
else
s2 = s2.isTemplateDeclaration();
if (s2)
{
if (s)
{
tempdecl = os;
return true;
}
s = s2;
}
}
if (!s)
{
error("template '%s' is not defined", id.toChars());
return false;
}
}
OverDeclaration od = s.isOverDeclaration();
if (od)
{
tempdecl = od; // TODO: more strict check
return true;
}
/* It should be a TemplateDeclaration, not some other symbol
*/
if (FuncDeclaration f = s.isFuncDeclaration())
tempdecl = f.findTemplateDeclRoot();
else
tempdecl = s.isTemplateDeclaration();
if (!tempdecl)
{
if (!s.parent && global.errors)
return false;
if (!s.parent && s.getType())
{
Dsymbol s2 = s.getType().toDsymbol(sc);
if (!s2)
{
error("%s is not a template declaration, it is a %s", id.toChars(), s.kind());
return false;
}
s = s2;
}
debug
{
//if (!s->parent) printf("s = %s %s\n", s->kind(), s->toChars());
}
//assert(s->parent);
TemplateInstance ti = s.parent ? s.parent.isTemplateInstance() : null;
if (ti && (ti.name == s.ident || ti.toAlias().ident == s.ident) && ti.tempdecl)
{
/* This is so that one can refer to the enclosing
* template, even if it has the same name as a member
* of the template, if it has a !(arguments)
*/
TemplateDeclaration td = ti.tempdecl.isTemplateDeclaration();
assert(td);
if (td.overroot) // if not start of overloaded list of TemplateDeclaration's
td = td.overroot; // then get the start
tempdecl = td;
}
else
{
error("%s is not a template declaration, it is a %s", id.toChars(), s.kind());
return false;
}
}
}
return (tempdecl !is null);
}
/**********************************
* Run semantic of tiargs as arguments of template.
* Input:
* loc
* sc
* tiargs array of template arguments
* flags 1: replace const variables with their initializers
* 2: don't devolve Parameter to Type
* Returns:
* false if one or more arguments have errors.
*/
final static bool semanticTiargs(Loc loc, Scope* sc, Objects* tiargs, int flags)
{
// Run semantic on each argument, place results in tiargs[]
//printf("+TemplateInstance::semanticTiargs()\n");
if (!tiargs)
return true;
bool err = false;
for (size_t j = 0; j < tiargs.dim; j++)
{
RootObject o = (*tiargs)[j];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
//printf("1: (*tiargs)[%d] = %p, s=%p, v=%p, ea=%p, ta=%p\n", j, o, isDsymbol(o), isTuple(o), ea, ta);
if (ta)
{
//printf("type %s\n", ta->toChars());
// It might really be an Expression or an Alias
ta.resolve(loc, sc, &ea, &ta, &sa);
if (ea)
goto Lexpr;
if (sa)
goto Ldsym;
if (ta is null)
{
assert(global.errors);
ta = Type.terror;
}
Ltype:
if (ta.ty == Ttuple)
{
// Expand tuple
TypeTuple tt = cast(TypeTuple)ta;
size_t dim = tt.arguments.dim;
tiargs.remove(j);
if (dim)
{
tiargs.reserve(dim);
for (size_t i = 0; i < dim; i++)
{
Parameter arg = (*tt.arguments)[i];
if (flags & 2 && arg.ident)
tiargs.insert(j + i, arg);
else
tiargs.insert(j + i, arg.type);
}
}
j--;
continue;
}
if (ta.ty == Terror)
{
err = true;
continue;
}
(*tiargs)[j] = ta.merge2();
}
else if (ea)
{
Lexpr:
//printf("+[%d] ea = %s %s\n", j, Token::toChars(ea->op), ea->toChars());
if (flags & 1) // only used by __traits
{
ea = ea.semantic(sc);
// must not interpret the args, excepting template parameters
if (ea.op != TOKvar || ((cast(VarExp)ea).var.storage_class & STCtemplateparameter))
{
ea = ea.optimize(WANTvalue);
}
}
else
{
sc = sc.startCTFE();
ea = ea.semantic(sc);
sc = sc.endCTFE();
if (ea.op == TOKvar)
{
/* This test is to skip substituting a const var with
* its initializer. The problem is the initializer won't
* match with an 'alias' parameter. Instead, do the
* const substitution in TemplateValueParameter::matchArg().
*/
}
else if (definitelyValueParameter(ea))
{
if (ea.checkValue()) // check void expression
ea = new ErrorExp();
uint olderrs = global.errors;
ea = ea.ctfeInterpret();
if (global.errors != olderrs)
ea = new ErrorExp();
}
}
//printf("-[%d] ea = %s %s\n", j, Token::toChars(ea->op), ea->toChars());
if (ea.op == TOKtuple)
{
// Expand tuple
TupleExp te = cast(TupleExp)ea;
size_t dim = te.exps.dim;
tiargs.remove(j);
if (dim)
{
tiargs.reserve(dim);
for (size_t i = 0; i < dim; i++)
tiargs.insert(j + i, (*te.exps)[i]);
}
j--;
continue;
}
if (ea.op == TOKerror)
{
err = true;
continue;
}
(*tiargs)[j] = ea;
if (ea.op == TOKtype)
{
ta = ea.type;
goto Ltype;
}
if (ea.op == TOKscope)
{
sa = (cast(ScopeExp)ea).sds;
goto Ldsym;
}
if (ea.op == TOKfunction)
{
FuncExp fe = cast(FuncExp)ea;
/* A function literal, that is passed to template and
* already semanticed as function pointer, never requires
* outer frame. So convert it to global function is valid.
*/
if (fe.fd.tok == TOKreserved && fe.type.ty == Tpointer)
{
// change to non-nested
fe.fd.tok = TOKfunction;
fe.fd.vthis = null;
}
else if (fe.td)
{
/* If template argument is a template lambda,
* get template declaration itself. */
//sa = fe->td;
//goto Ldsym;
}
}
if (ea.op == TOKdotvar)
{
// translate expression to dsymbol.
sa = (cast(DotVarExp)ea).var;
goto Ldsym;
}
if (ea.op == TOKtemplate)
{
sa = (cast(TemplateExp)ea).td;
goto Ldsym;
}
if (ea.op == TOKdottd)
{
// translate expression to dsymbol.
sa = (cast(DotTemplateExp)ea).td;
goto Ldsym;
}
}
else if (sa)
{
Ldsym:
//printf("dsym %s %s\n", sa->kind(), sa->toChars());
if (sa.errors)
{
err = true;
continue;
}
TupleDeclaration d = sa.toAlias().isTupleDeclaration();
if (d)
{
// Expand tuple
tiargs.remove(j);
tiargs.insert(j, d.objects);
j--;
continue;
}
if (FuncAliasDeclaration fa = sa.isFuncAliasDeclaration())
{
FuncDeclaration f = fa.toAliasFunc();
if (!fa.hasOverloads && f.isUnique())
{
// Strip FuncAlias only when the aliased function
// does not have any overloads.
sa = f;
}
}
(*tiargs)[j] = sa;
TemplateDeclaration td = sa.isTemplateDeclaration();
if (td && td.semanticRun == PASSinit && td.literal)
{
td.semantic(sc);
}
FuncDeclaration fd = sa.isFuncDeclaration();
if (fd)
fd.functionSemantic();
}
else if (isParameter(o))
{
}
else
{
assert(0);
}
//printf("1: (*tiargs)[%d] = %p\n", j, (*tiargs)[j]);
}
version (none)
{
printf("-TemplateInstance::semanticTiargs()\n");
for (size_t j = 0; j < tiargs.dim; j++)
{
RootObject o = (*tiargs)[j];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
printf("\ttiargs[%d] = ta %p, ea %p, sa %p, va %p\n", j, ta, ea, sa, va);
}
}
return !err;
}
/**********************************
* Run semantic on the elements of tiargs.
* Input:
* sc
* Returns:
* false if one or more arguments have errors.
* Note:
* This function is reentrant against error occurrence. If returns false,
* all elements of tiargs won't be modified.
*/
final bool semanticTiargs(Scope* sc)
{
//printf("+TemplateInstance::semanticTiargs() %s\n", toChars());
if (semantictiargsdone)
return true;
if (semanticTiargs(loc, sc, tiargs, 0))
{
// cache the result iff semantic analysis succeeded entirely
semantictiargsdone = 1;
return true;
}
return false;
}
final bool findBestMatch(Scope* sc, Expressions* fargs)
{
if (havetempdecl)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
assert(tempdecl._scope);
// Deduce tdtypes
tdtypes.setDim(tempdecl.parameters.dim);
if (!tempdecl.matchWithInstance(sc, this, &tdtypes, fargs, 2))
{
error("incompatible arguments for template instantiation");
return false;
}
// TODO: Normalizing tiargs for bugzilla 7469 is necessary?
return true;
}
static if (LOG)
{
printf("TemplateInstance::findBestMatch()\n");
}
uint errs = global.errors;
TemplateDeclaration td_last = null;
Objects dedtypes;
/* Since there can be multiple TemplateDeclaration's with the same
* name, look for the best match.
*/
auto tovers = tempdecl.isOverloadSet();
foreach (size_t oi; 0 .. tovers ? tovers.a.dim : 1)
{
TemplateDeclaration td_best;
TemplateDeclaration td_ambig;
MATCH m_best = MATCHnomatch;
Dsymbol dstart = tovers ? tovers.a[oi] : tempdecl;
overloadApply(dstart, (Dsymbol s)
{
auto td = s.isTemplateDeclaration();
if (!td || td == td_best) // skip duplicates
return 0;
//printf("td = %s\n", td->toPrettyChars());
// If more arguments than parameters,
// then this is no match.
if (td.parameters.dim < tiargs.dim)
{
if (!td.isVariadic())
return 0;
}
dedtypes.setDim(td.parameters.dim);
dedtypes.zero();
assert(td.semanticRun != PASSinit);
MATCH m = td.matchWithInstance(sc, this, &dedtypes, fargs, 0);
//printf("matchWithInstance = %d\n", m);
if (m <= MATCHnomatch) // no match at all
return 0;
if (m < m_best) goto Ltd_best;
if (m > m_best) goto Ltd;
// Disambiguate by picking the most specialized TemplateDeclaration
{
MATCH c1 = td.leastAsSpecialized(sc, td_best, fargs);
MATCH c2 = td_best.leastAsSpecialized(sc, td, fargs);
//printf("c1 = %d, c2 = %d\n", c1, c2);
if (c1 > c2) goto Ltd;
if (c1 < c2) goto Ltd_best;
}
td_ambig = td;
return 0;
Ltd_best:
// td_best is the best match so far
td_ambig = null;
return 0;
Ltd:
// td is the new best match
td_ambig = null;
td_best = td;
m_best = m;
tdtypes.setDim(dedtypes.dim);
memcpy(tdtypes.tdata(), dedtypes.tdata(), tdtypes.dim * (void*).sizeof);
return 0;
});
if (td_ambig)
{
.error(loc, "%s %s.%s matches more than one template declaration:\n%s: %s\nand\n%s: %s",
td_best.kind(), td_best.parent.toPrettyChars(), td_best.ident.toChars(),
td_best.loc.toChars(), td_best.toChars(),
td_ambig.loc.toChars(), td_ambig.toChars());
return false;
}
if (td_best)
{
if (!td_last)
td_last = td_best;
else if (td_last != td_best)
{
ScopeDsymbol.multiplyDefined(loc, td_last, td_best);
return false;
}
}
}
if (td_last)
{
/* Bugzilla 7469: Normalize tiargs by using corresponding deduced
* template value parameters and tuples for the correct mangling.
*
* By doing this before hasNestedArgs, CTFEable local variable will be
* accepted as a value parameter. For example:
*
* void foo() {
* struct S(int n) {} // non-global template
* const int num = 1; // CTFEable local variable
* S!num s; // S!1 is instantiated, not S!num
* }
*/
size_t dim = td_last.parameters.dim - (td_last.isVariadic() ? 1 : 0);
for (size_t i = 0; i < dim; i++)
{
if (tiargs.dim <= i)
tiargs.push(tdtypes[i]);
assert(i < tiargs.dim);
auto tvp = (*td_last.parameters)[i].isTemplateValueParameter();
if (!tvp)
continue;
assert(tdtypes[i]);
// tdtypes[i] is already normalized to the required type in matchArg
(*tiargs)[i] = tdtypes[i];
}
if (td_last.isVariadic() && tiargs.dim == dim && tdtypes[dim])
{
Tuple va = isTuple(tdtypes[dim]);
assert(va);
for (size_t i = 0; i < va.objects.dim; i++)
tiargs.push(va.objects[i]);
}
}
else if (errors && inst)
{
// instantiation was failed with error reporting
assert(global.errors);
return false;
}
else
{
auto tdecl = tempdecl.isTemplateDeclaration();
if (errs != global.errors)
errorSupplemental(loc, "while looking for match for %s", toChars());
else if (tdecl && !tdecl.overnext)
{
// Only one template, so we can give better error message
error("does not match template declaration %s", tdecl.toChars());
}
else
.error(loc, "%s %s.%s does not match any template declaration", tempdecl.kind(), tempdecl.parent.toPrettyChars(), tempdecl.ident.toChars());
return false;
}
/* The best match is td_last
*/
tempdecl = td_last;
static if (LOG)
{
printf("\tIt's a match with template declaration '%s'\n", tempdecl.toChars());
}
return (errs == global.errors);
}
/*****************************************************
* Determine if template instance is really a template function,
* and that template function needs to infer types from the function
* arguments.
*
* Like findBestMatch, iterate possible template candidates,
* but just looks only the necessity of type inference.
*/
final bool needsTypeInference(Scope* sc, int flag = 0)
{
//printf("TemplateInstance::needsTypeInference() %s\n", toChars());
if (semanticRun != PASSinit)
return false;
uint olderrs = global.errors;
Objects dedtypes;
size_t count = 0;
auto tovers = tempdecl.isOverloadSet();
foreach (size_t oi; 0 .. tovers ? tovers.a.dim : 1)
{
Dsymbol dstart = tovers ? tovers.a[oi] : tempdecl;
int r = overloadApply(dstart, (Dsymbol s)
{
auto td = s.isTemplateDeclaration();
if (!td)
return 0;
/* If any of the overloaded template declarations need inference,
* then return true
*/
if (!td.onemember)
return 0;
if (auto td2 = td.onemember.isTemplateDeclaration())
{
if (!td2.onemember || !td2.onemember.isFuncDeclaration())
return 0;
if (tiargs.dim > td.parameters.dim && !td.isVariadic())
return 0;
return 1;
}
auto fd = td.onemember.isFuncDeclaration();
if (!fd || fd.type.ty != Tfunction)
return 0;
foreach (tp; *td.parameters)
{
if (tp.isTemplateThisParameter())
return 1;
}
/* Determine if the instance arguments, tiargs, are all that is necessary
* to instantiate the template.
*/
//printf("tp = %p, td->parameters->dim = %d, tiargs->dim = %d\n", tp, td->parameters->dim, tiargs->dim);
auto tf = cast(TypeFunction)fd.type;
if (size_t dim = Parameter.dim(tf.parameters))
{
auto tp = td.isVariadic();
if (tp && td.parameters.dim > 1)
return 1;
if (!tp && tiargs.dim < td.parameters.dim)
{
// Can remain tiargs be filled by default arguments?
foreach (size_t i; tiargs.dim .. td.parameters.dim)
{
if (!(*td.parameters)[i].hasDefaultArg())
return 1;
}
}
foreach (size_t i; 0 .. dim)
{
// 'auto ref' needs inference.
if (Parameter.getNth(tf.parameters, i).storageClass & STCauto)
return 1;
}
}
if (!flag)
{
/* Calculate the need for overload resolution.
* When only one template can match with tiargs, inference is not necessary.
*/
dedtypes.setDim(td.parameters.dim);
dedtypes.zero();
if (td.semanticRun == PASSinit)
{
if (td._scope)
{
// Try to fix forward reference. Ungag errors while doing so.
Ungag ungag = td.ungagSpeculative();
td.semantic(td._scope);
}
if (td.semanticRun == PASSinit)
{
error("%s forward references template declaration %s", toChars(), td.toChars());
return 1;
}
}
MATCH m = td.matchWithInstance(sc, this, &dedtypes, null, 0);
if (m <= MATCHnomatch)
return 0;
}
/* If there is more than one function template which matches, we may
* need type inference (see Bugzilla 4430)
*/
return ++count > 1 ? 1 : 0;
});
if (r)
return true;
}
if (olderrs != global.errors)
{
if (!global.gag)
{
errorSupplemental(loc, "while looking for match for %s", toChars());
semanticRun = PASSsemanticdone;
inst = this;
}
errors = true;
}
//printf("false\n");
return false;
}
/*****************************************
* Determines if a TemplateInstance will need a nested
* generation of the TemplateDeclaration.
* Sets enclosing property if so, and returns != 0;
*/
final bool hasNestedArgs(Objects* args, bool isstatic)
{
int nested = 0;
//printf("TemplateInstance::hasNestedArgs('%s')\n", tempdecl->ident->toChars());
version (none)
{
if (!enclosing)
{
if (TemplateInstance ti = tempdecl.isInstantiated())
enclosing = ti.enclosing;
}
}
/* A nested instance happens when an argument references a local
* symbol that is on the stack.
*/
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
if (ea)
{
if (ea.op == TOKvar)
{
sa = (cast(VarExp)ea).var;
goto Lsa;
}
if (ea.op == TOKthis)
{
sa = (cast(ThisExp)ea).var;
goto Lsa;
}
if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
goto Lsa;
}
// Emulate Expression::toMangleBuffer call that had exist in TemplateInstance::genIdent.
if (ea.op != TOKint64 && ea.op != TOKfloat64 && ea.op != TOKcomplex80 && ea.op != TOKnull && ea.op != TOKstring && ea.op != TOKarrayliteral && ea.op != TOKassocarrayliteral && ea.op != TOKstructliteral)
{
ea.error("expression %s is not a valid template value argument", ea.toChars());
errors = true;
}
}
else if (sa)
{
Lsa:
sa = sa.toAlias();
TemplateDeclaration td = sa.isTemplateDeclaration();
if (td)
{
TemplateInstance ti = sa.toParent().isTemplateInstance();
if (ti && ti.enclosing)
sa = ti;
}
TemplateInstance ti = sa.isTemplateInstance();
Declaration d = sa.isDeclaration();
if ((td && td.literal) || (ti && ti.enclosing) || (d && !d.isDataseg() && !(d.storage_class & STCmanifest) && (!d.isFuncDeclaration() || d.isFuncDeclaration().isNested()) && !isTemplateMixin()))
{
// if module level template
if (isstatic)
{
Dsymbol dparent = sa.toParent2();
if (!enclosing)
enclosing = dparent;
else if (enclosing != dparent)
{
/* Select the more deeply nested of the two.
* Error if one is not nested inside the other.
*/
for (Dsymbol p = enclosing; p; p = p.parent)
{
if (p == dparent)
goto L1;
// enclosing is most nested
}
for (Dsymbol p = dparent; p; p = p.parent)
{
if (p == enclosing)
{
enclosing = dparent;
goto L1;
// dparent is most nested
}
}
error("%s is nested in both %s and %s", toChars(), enclosing.toChars(), dparent.toChars());
errors = true;
}
L1:
//printf("\tnested inside %s\n", enclosing->toChars());
nested |= 1;
}
else
{
error("cannot use local '%s' as parameter to non-global template %s", sa.toChars(), tempdecl.toChars());
errors = true;
}
}
}
else if (va)
{
nested |= cast(int)hasNestedArgs(&va.objects, isstatic);
}
}
//printf("-TemplateInstance::hasNestedArgs('%s') = %d\n", tempdecl->ident->toChars(), nested);
return nested != 0;
}
/*****************************************
* Append 'this' to the specific module members[]
*/
final Dsymbols* appendToModuleMember()
{
Module mi = minst; // instantiated -> inserted module
if (global.params.useUnitTests || global.params.debuglevel)
{
// Turn all non-root instances to speculative
if (mi && !mi.isRoot())
mi = null;
}
//printf("%s->appendToModuleMember() enclosing = %s mi = %s\n",
// toPrettyChars(),
// enclosing ? enclosing.toPrettyChars() : null,
// mi ? mi.toPrettyChars() : null);
if (!mi || mi.isRoot())
{
/* If the instantiated module is speculative or root, insert to the
* member of a root module. Then:
* - semantic3 pass will get called on the instance members.
* - codegen pass will get a selection chance to do/skip it.
*/
struct N
{
extern (C++) static Dsymbol getStrictEnclosing(TemplateInstance ti)
{
if (ti.enclosing)
return ti.enclosing;
if (TemplateInstance tix = ti.tempdecl.isInstantiated())
return getStrictEnclosing(tix);
return null;
}
}
Dsymbol enc = N.getStrictEnclosing(this);
// insert target is made stable by using the module
// where tempdecl is declared.
mi = (enc ? enc : tempdecl).getModule();
if (!mi.isRoot())
mi = mi.importedFrom;
assert(mi.isRoot());
}
else
{
/* If the instantiated module is non-root, insert to the member of the
* non-root module. Then:
* - semantic3 pass won't be called on the instance.
* - codegen pass won't reach to the instance.
*/
}
//printf("\t--> mi = %s\n", mi.toPrettyChars());
Dsymbols* a = mi.members;
for (size_t i = 0; 1; i++)
{
if (i == a.dim)
{
a.push(this);
if (mi.semanticRun >= PASSsemantic3done && mi.isRoot())
Module.addDeferredSemantic3(this);
break;
}
if (this == (*a)[i]) // if already in Array
{
a = null;
break;
}
}
return a;
}
/****************************************************
* Declare parameters of template instance, initialize them with the
* template instance arguments.
*/
final void declareParameters(Scope* sc)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
//printf("TemplateInstance::declareParameters()\n");
for (size_t i = 0; i < tdtypes.dim; i++)
{
TemplateParameter tp = (*tempdecl.parameters)[i];
//RootObject *o = (*tiargs)[i];
RootObject o = tdtypes[i]; // initializer for tp
//printf("\ttdtypes[%d] = %p\n", i, o);
tempdecl.declareParameter(sc, tp, o);
}
}
/****************************************
* This instance needs an identifier for name mangling purposes.
* Create one by taking the template declaration name and adding
* the type signature for it.
*/
final Identifier genIdent(Objects* args)
{
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
//printf("TemplateInstance::genIdent('%s')\n", tempdecl->ident->toChars());
OutBuffer buf;
const id = tempdecl.ident.toChars();
if (!members)
{
// Use "__U" for the symbols declared inside template constraint.
buf.printf("__U%llu%s", cast(ulong)strlen(id), id);
}
else
buf.printf("__T%llu%s", cast(ulong)strlen(id), id);
size_t nparams = tempdecl.parameters.dim - (tempdecl.isVariadic() ? 1 : 0);
for (size_t i = 0; i < args.dim; i++)
{
RootObject o = (*args)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
Tuple va = isTuple(o);
//printf("\to [%d] %p ta %p ea %p sa %p va %p\n", i, o, ta, ea, sa, va);
if (i < nparams && (*tempdecl.parameters)[i].specialization())
buf.writeByte('H'); // Bugzilla 6574
if (ta)
{
buf.writeByte('T');
if (ta.deco)
buf.writestring(ta.deco);
else
{
debug
{
if (!global.errors)
printf("ta = %d, %s\n", ta.ty, ta.toChars());
}
assert(global.errors);
}
}
else if (ea)
{
// Don't interpret it yet, it might actually be an alias
ea = ea.optimize(WANTvalue);
if (ea.op == TOKvar)
{
sa = (cast(VarExp)ea).var;
ea = null;
goto Lsa;
}
if (ea.op == TOKthis)
{
sa = (cast(ThisExp)ea).var;
ea = null;
goto Lsa;
}
if (ea.op == TOKfunction)
{
if ((cast(FuncExp)ea).td)
sa = (cast(FuncExp)ea).td;
else
sa = (cast(FuncExp)ea).fd;
ea = null;
goto Lsa;
}
buf.writeByte('V');
if (ea.op == TOKtuple)
{
ea.error("tuple is not a valid template value argument");
continue;
}
// Now that we know it is not an alias, we MUST obtain a value
uint olderr = global.errors;
ea = ea.ctfeInterpret();
if (ea.op == TOKerror || olderr != global.errors)
continue;
/* Use deco that matches what it would be for a function parameter
*/
buf.writestring(ea.type.deco);
mangleToBuffer(ea, &buf);
}
else if (sa)
{
Lsa:
buf.writeByte('S');
sa = sa.toAlias();
Declaration d = sa.isDeclaration();
if (d && (!d.type || !d.type.deco))
{
error("forward reference of %s %s", d.kind(), d.toChars());
continue;
}
const(char)* p = mangle(sa);
/* Bugzilla 3043: if the first character of p is a digit this
* causes ambiguity issues because the digits of the two numbers are adjacent.
* Current demanglers resolve this by trying various places to separate the
* numbers until one gets a successful demangle.
* Unfortunately, fixing this ambiguity will break existing binary
* compatibility and the demanglers, so we'll leave it as is.
*/
buf.printf("%llu%s", cast(ulong)strlen(p), p);
}
else if (va)
{
assert(i + 1 == args.dim); // must be last one
args = &va.objects;
i = -cast(size_t)1;
}
else
assert(0);
}
buf.writeByte('Z');
const id2 = buf.peekString();
//printf("\tgenIdent = %s\n", id2);
return Identifier.idPool(id2);
}
final void expandMembers(Scope* sc2)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.setScope(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf("\t[%d] semantic on '%s' %p kind %s in '%s'\n", i, s->toChars(), s, s->kind(), this->toChars());
//printf("test: enclosing = %d, sc2->parent = %s\n", enclosing, sc2->parent->toChars());
// if (enclosing)
// s->parent = sc->parent;
//printf("test3: enclosing = %d, s->parent = %s\n", enclosing, s->parent->toChars());
s.semantic(sc2);
//printf("test4: enclosing = %d, s->parent = %s\n", enclosing, s->parent->toChars());
sc2._module.runDeferredSemantic();
}
}
final void tryExpandMembers(Scope* sc2)
{
static __gshared int nest;
// extracted to a function to allow windows SEH to work without destructors in the same function
//printf("%d\n", nest);
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
expandMembers(sc2);
nest--;
}
final void trySemantic3(Scope* sc2)
{
// extracted to a function to allow windows SEH to work without destructors in the same function
static __gshared int nest;
//printf("%d\n", nest);
if (++nest > 300)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
semantic3(sc2);
--nest;
}
override final inout(TemplateInstance) isTemplateInstance() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/**************************************
* IsExpression can evaluate the specified type speculatively, and even if
* it instantiates any symbols, they are normally unnecessary for the
* final executable.
* However, if those symbols leak to the actual code, compiler should remark
* them as non-speculative to generate their code and link to the final executable.
*/
extern (C++) void unSpeculative(Scope* sc, RootObject o)
{
if (!o)
return;
if (Tuple tup = isTuple(o))
{
for (size_t i = 0; i < tup.objects.dim; i++)
{
unSpeculative(sc, tup.objects[i]);
}
return;
}
Dsymbol s = getDsymbol(o);
if (!s)
return;
Declaration d = s.isDeclaration();
if (d)
{
if (VarDeclaration vd = d.isVarDeclaration())
o = vd.type;
else if (AliasDeclaration ad = d.isAliasDeclaration())
{
o = ad.getType();
if (!o)
o = ad.toAlias();
}
else
o = d.toAlias();
s = getDsymbol(o);
if (!s)
return;
}
if (TemplateInstance ti = s.isTemplateInstance())
{
// If the instance is already non-speculative,
// or it is leaked to the speculative scope.
if (ti.minst !is null || sc.minst is null)
return;
// Remark as non-speculative instance.
ti.minst = sc.minst;
if (!ti.tinst)
ti.tinst = sc.tinst;
unSpeculative(sc, ti.tempdecl);
}
if (TemplateInstance ti = s.isInstantiated())
unSpeculative(sc, ti);
}
/**********************************
* Return true if e could be valid only as a template value parameter.
* Return false if it might be an alias or tuple.
* (Note that even in this case, it could still turn out to be a value).
*/
extern (C++) bool definitelyValueParameter(Expression e)
{
// None of these can be value parameters
if (e.op == TOKtuple || e.op == TOKscope ||
e.op == TOKtype || e.op == TOKdottype ||
e.op == TOKtemplate || e.op == TOKdottd ||
e.op == TOKfunction || e.op == TOKerror ||
e.op == TOKthis || e.op == TOKsuper)
return false;
if (e.op != TOKdotvar)
return true;
/* Template instantiations involving a DotVar expression are difficult.
* In most cases, they should be treated as a value parameter, and interpreted.
* But they might also just be a fully qualified name, which should be treated
* as an alias.
*/
// x.y.f cannot be a value
FuncDeclaration f = (cast(DotVarExp)e).var.isFuncDeclaration();
if (f)
return false;
while (e.op == TOKdotvar)
{
e = (cast(DotVarExp)e).e1;
}
// this.x.y and super.x.y couldn't possibly be valid values.
if (e.op == TOKthis || e.op == TOKsuper)
return false;
// e.type.x could be an alias
if (e.op == TOKdottype)
return false;
// var.x.y is the only other possible form of alias
if (e.op != TOKvar)
return true;
VarDeclaration v = (cast(VarExp)e).var.isVarDeclaration();
// func.x.y is not an alias
if (!v)
return true;
// TODO: Should we force CTFE if it is a global constant?
return false;
}
/***********************************************************
*/
extern (C++) final class TemplateMixin : TemplateInstance
{
public:
TypeQualified tqual;
extern (D) this(Loc loc, Identifier ident, TypeQualified tqual, Objects* tiargs)
{
super(loc, tqual.idents.dim ? cast(Identifier)tqual.idents[tqual.idents.dim - 1] : (cast(TypeIdentifier)tqual).ident);
//printf("TemplateMixin(ident = '%s')\n", ident ? ident->toChars() : "");
this.ident = ident;
this.tqual = tqual;
this.tiargs = tiargs ? tiargs : new Objects();
}
override Dsymbol syntaxCopy(Dsymbol s)
{
auto tm = new TemplateMixin(loc, ident, cast(TypeQualified)tqual.syntaxCopy(), tiargs);
return TemplateInstance.syntaxCopy(tm);
}
override void semantic(Scope* sc)
{
static if (LOG)
{
printf("+TemplateMixin::semantic('%s', this=%p)\n", toChars(), this);
fflush(stdout);
}
if (semanticRun != PASSinit)
{
// When a class/struct contains mixin members, and is done over
// because of forward references, never reach here so semanticRun
// has been reset to PASSinit.
static if (LOG)
{
printf("\tsemantic done\n");
}
return;
}
semanticRun = PASSsemantic;
static if (LOG)
{
printf("\tdo semantic\n");
}
Scope* scx = null;
if (_scope)
{
sc = _scope;
scx = _scope; // save so we don't make redundant copies
_scope = null;
}
/* Run semantic on each argument, place results in tiargs[],
* then find best match template with tiargs
*/
if (!findTempDecl(sc) || !semanticTiargs(sc) || !findBestMatch(sc, null))
{
if (semanticRun == PASSinit) // forward reference had occured
{
/* Cannot handle forward references if mixin is a struct member,
* because addField must happen during struct's semantic, not
* during the mixin semantic.
* runDeferred will re-run mixin's semantic outside of the struct's
* semantic.
*/
AggregateDeclaration ad = toParent().isAggregateDeclaration();
if (ad)
ad.sizeok = SIZEOKfwd;
else
{
// Forward reference
//printf("forward reference - deferring\n");
_scope = scx ? scx : sc.copy();
_scope.setNoFree();
_scope._module.addDeferredSemantic(this);
}
return;
}
inst = this;
errors = true;
return; // error recovery
}
TemplateDeclaration tempdecl = this.tempdecl.isTemplateDeclaration();
assert(tempdecl);
if (!ident)
{
/* Assign scope local unique identifier, as same as lambdas.
*/
const(char)* s = "__mixin";
DsymbolTable symtab;
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
{
symtab = func.localsymtab;
if (symtab)
{
// Inside template constraint, symtab is not set yet.
goto L1;
}
}
else
{
symtab = sc.parent.isScopeDsymbol().symtab;
L1:
assert(symtab);
ident = Identifier.generateId(s, symtab.len + 1);
symtab.insert(this);
}
}
inst = this;
parent = sc.parent;
/* Detect recursive mixin instantiations.
*/
for (Dsymbol s = parent; s; s = s.parent)
{
//printf("\ts = '%s'\n", s->toChars());
TemplateMixin tm = s.isTemplateMixin();
if (!tm || tempdecl != tm.tempdecl)
continue;
/* Different argument list lengths happen with variadic args
*/
if (tiargs.dim != tm.tiargs.dim)
continue;
for (size_t i = 0; i < tiargs.dim; i++)
{
RootObject o = (*tiargs)[i];
Type ta = isType(o);
Expression ea = isExpression(o);
Dsymbol sa = isDsymbol(o);
RootObject tmo = (*tm.tiargs)[i];
if (ta)
{
Type tmta = isType(tmo);
if (!tmta)
goto Lcontinue;
if (!ta.equals(tmta))
goto Lcontinue;
}
else if (ea)
{
Expression tme = isExpression(tmo);
if (!tme || !ea.equals(tme))
goto Lcontinue;
}
else if (sa)
{
Dsymbol tmsa = isDsymbol(tmo);
if (sa != tmsa)
goto Lcontinue;
}
else
assert(0);
}
error("recursive mixin instantiation");
return;
Lcontinue:
continue;
}
// Copy the syntax trees from the TemplateDeclaration
members = Dsymbol.arraySyntaxCopy(tempdecl.members);
if (!members)
return;
symtab = new DsymbolTable();
for (Scope* sce = sc; 1; sce = sce.enclosing)
{
ScopeDsymbol sds = cast(ScopeDsymbol)sce.scopesym;
if (sds)
{
sds.importScope(this, Prot(PROTpublic));
break;
}
}
static if (LOG)
{
printf("\tcreate scope for template parameters '%s'\n", toChars());
}
Scope* scy = sc.push(this);
scy.parent = this;
argsym = new ScopeDsymbol();
argsym.parent = scy.parent;
Scope* argscope = scy.push(argsym);
uint errorsave = global.errors;
// Declare each template parameter as an alias for the argument type
declareParameters(argscope);
// Add members to enclosing scope, as well as this scope
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.addMember(argscope, this);
//printf("sc->parent = %p, sc->scopesym = %p\n", sc->parent, sc->scopesym);
//printf("s->parent = %s\n", s->parent->toChars());
}
// Do semantic() analysis on template instance members
static if (LOG)
{
printf("\tdo semantic() on template instance members '%s'\n", toChars());
}
Scope* sc2 = argscope.push(this);
//size_t deferred_dim = Module::deferred.dim;
static __gshared int nest;
//printf("%d\n", nest);
if (++nest > 500)
{
global.gag = 0; // ensure error message gets printed
error("recursive expansion");
fatal();
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.setScope(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.importAll(sc2);
}
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic(sc2);
}
nest--;
/* In DeclDefs scope, TemplateMixin does not have to handle deferred symbols.
* Because the members would already call Module::addDeferredSemantic() for themselves.
* See Struct, Class, Interface, and EnumDeclaration::semantic().
*/
//if (!sc->func && Module::deferred.dim > deferred_dim) {}
AggregateDeclaration ad = toParent().isAggregateDeclaration();
if (sc.func && !ad)
{
semantic2(sc2);
semantic3(sc2);
}
// Give additional context info if error occurred during instantiation
if (global.errors != errorsave)
{
error("error instantiating");
errors = true;
}
sc2.pop();
argscope.pop();
scy.pop();
static if (LOG)
{
printf("-TemplateMixin::semantic('%s', this=%p)\n", toChars(), this);
}
}
override void semantic2(Scope* sc)
{
if (semanticRun >= PASSsemantic2)
return;
semanticRun = PASSsemantic2;
static if (LOG)
{
printf("+TemplateMixin::semantic2('%s')\n", toChars());
}
if (members)
{
assert(sc);
sc = sc.push(argsym);
sc = sc.push(this);
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
static if (LOG)
{
printf("\tmember '%s', kind = '%s'\n", s.toChars(), s.kind());
}
s.semantic2(sc);
}
sc = sc.pop();
sc.pop();
}
static if (LOG)
{
printf("-TemplateMixin::semantic2('%s')\n", toChars());
}
}
override void semantic3(Scope* sc)
{
if (semanticRun >= PASSsemantic3)
return;
semanticRun = PASSsemantic3;
static if (LOG)
{
printf("TemplateMixin::semantic3('%s')\n", toChars());
}
if (members)
{
sc = sc.push(argsym);
sc = sc.push(this);
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
s.semantic3(sc);
}
sc = sc.pop();
sc.pop();
}
}
override const(char)* kind() const
{
return "mixin";
}
override bool oneMember(Dsymbol* ps, Identifier ident)
{
return Dsymbol.oneMember(ps, ident);
}
override int apply(Dsymbol_apply_ft_t fp, void* param)
{
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
if (s)
{
if (s.apply(fp, param))
return 1;
}
}
}
return 0;
}
override bool hasPointers()
{
//printf("TemplateMixin::hasPointers() %s\n", toChars());
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf(" s = %s %s\n", s->kind(), s->toChars());
if (s.hasPointers())
{
return true;
}
}
}
return false;
}
override void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
{
//printf("TemplateMixin::setFieldOffset() %s\n", toChars());
if (_scope) // if fwd reference
semantic(null); // try to resolve it
if (members)
{
for (size_t i = 0; i < members.dim; i++)
{
Dsymbol s = (*members)[i];
//printf("\t%s\n", s->toChars());
s.setFieldOffset(ad, poffset, isunion);
}
}
}
override const(char)* toChars()
{
OutBuffer buf;
toCBufferInstance(this, &buf);
return buf.extractString();
}
bool findTempDecl(Scope* sc)
{
// Follow qualifications to find the TemplateDeclaration
if (!tempdecl)
{
Expression e;
Type t;
Dsymbol s;
tqual.resolve(loc, sc, &e, &t, &s);
if (!s)
{
error("is not defined");
return false;
}
s = s.toAlias();
tempdecl = s.isTemplateDeclaration();
OverloadSet os = s.isOverloadSet();
/* If an OverloadSet, look for a unique member that is a template declaration
*/
if (os)
{
Dsymbol ds = null;
for (size_t i = 0; i < os.a.dim; i++)
{
Dsymbol s2 = os.a[i].isTemplateDeclaration();
if (s2)
{
if (ds)
{
tempdecl = os;
break;
}
ds = s2;
}
}
}
if (!tempdecl)
{
error("%s isn't a template", s.toChars());
return false;
}
}
assert(tempdecl);
// Look for forward references
auto tovers = tempdecl.isOverloadSet();
foreach (size_t oi; 0 .. tovers ? tovers.a.dim : 1)
{
Dsymbol dstart = tovers ? tovers.a[oi] : tempdecl;
int r = overloadApply(dstart, (Dsymbol s)
{
auto td = s.isTemplateDeclaration();
if (!td)
return 0;
if (td.semanticRun == PASSinit)
{
if (td._scope)
td.semantic(td._scope);
else
{
semanticRun = PASSinit;
return 1;
}
}
return 0;
});
if (r)
return false;
}
return true;
}
override inout(TemplateMixin) isTemplateMixin() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
|
D
|
/*****************************************************************************
*
* Higgs JavaScript Virtual Machine
*
* This file is part of the Higgs project. The project is distributed at:
* https://github.com/maximecb/Higgs
*
* Copyright (c) 2011-2015, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
module ir.analysis;
import std.stdio;
import std.array;
import std.string;
import std.stdint;
import std.conv;
import ir.ir;
import ir.ops;
import ir.livevars;
import runtime.vm;
import jit.jit;
import options;
/// Type test info struct
struct TestInfo
{
StackIdx outSlot;
string mnem;
TestResult result;
}
/// Type test result
enum TestResult
{
TRUE,
FALSE,
UNKNOWN
}
/// Block versions registered as containing a type test, indexed by block id
private BlockVersion[uint64_t] versions;
/// Loaded test results, indexed by block id
private TestInfo[uint64_t] testResults;
/// Register a block version containing a tag test
void regTagTest(BlockVersion ver)
{
//writeln(ver.block.lastInstr.opcode.mnem, " ", ver.block.id);
//writeln(" ", ver.block);
// Assert type test present
assert (ver.block.lastInstr.opcode is &IF_TRUE);
auto testInstr = cast(IRInstr)ver.block.lastInstr.getArg(0);
assert (testInstr);
assert (testInstr.opcode.mnem.startsWith("is_"));
if (ver.block.id in versions)
writeln(ver.block);
assert (
ver.block.id !in versions,
format(
"block.id=%s\nfun.getName=%s",
ver.block.id,
ver.block.fun.getName
)
);
versions[ver.block.id] = ver;
}
/// Get the type test result for a given tag test
TestResult getTagTestResult(BlockVersion ver)
{
assert (ver.block.id in testResults);
auto testInfo = ver.block.id in testResults;
assert (ver.block.lastInstr.opcode is &IF_TRUE);
auto testInstr = cast(IRInstr)ver.block.lastInstr.getArg(0);
assert (testInstr);
assert (testInstr.outSlot is testInfo.outSlot);
assert (testInstr.opcode.mnem == testInfo.mnem);
return testInfo.result;
}
void saveTagTests(string fileName)
{
writefln("saving tag tests");
writefln("%s tests registered", versions.length);
assert (versions.length > 0);
import std.stdio;
auto f = File(fileName, "w");
size_t numUnknown = 0;
foreach (ver; versions)
{
auto targets = ver.targets;
auto branchInstr = ver.block.lastInstr;
auto block0 = branchInstr.getTarget(0).target;
auto block1 = branchInstr.getTarget(1).target;
bool exec0 = false;
bool exec1 = false;
foreach (target; ver.targets)
{
auto branch = cast(BranchCode)target;
assert (branch || target is null);
if (!branch || !branch.ended)
continue;
if (branch.target.block is block0)
exec0 = true;
if (branch.target.block is block1)
exec1 = true;
}
if (exec0 && exec1)
numUnknown++;
TestResult testResult;
if (exec0 && !exec1)
testResult = TestResult.TRUE;
else if (!exec0 && exec1)
testResult = TestResult.FALSE;
else
testResult = TestResult.UNKNOWN;
auto testInstr = cast(IRInstr)ver.block.lastInstr.getArg(0);
assert (testInstr);
f.writefln(
"%s,%s,%s,%s",
ver.block.id,
testInstr.outSlot,
testInstr.opcode.mnem,
testResult
);
}
writefln(
"%s tests unknown (%.1f %%)",
numUnknown,
100.0 * numUnknown / versions.length
);
}
void loadTagTests(string fileName)
{
import std.stdio;
auto f = File(fileName, "r");
for (;;)
{
auto line = f.readln();
if (line is null)
break;
auto cols = line.strip().split(",");
assert (cols.length == 4);
TestInfo info;
ulong blockId = to!ulong(cols[0]);
info.outSlot = to!StackIdx(cols[1]);
info.mnem = cols[2];
info.result = to!TestResult(cols[3]);
testResults[blockId] = info;
}
}
|
D
|
module jaypha.fixdb.literal;
import jaypha.fixdb.dbdef;
import jaypha.io.print;
import jaypha.algorithm;
import std.algorithm;
import std.array;
string literal(ref DatabaseDef database_def)
{
auto w = appender!string;
w.println("DatabaseDef\n(\n [");
w.println(database_def.tables.map!literal().join(",\n"));
w.println(" ],");
if (database_def.views.length)
w.println(" [\n",database_def.views.map!literal().join(",\n")," ],");
else
w.println(" null,");
if (database_def.functions.length)
w.print("[",database_def.functions.meld!((a,b) => ("\""~a~"\":"~b.literal()))().join(","),"]");
else
w.print("null");
w.print(")");
return w.data;
}
string literal(ref TableDef table_def)
{
auto w = appender!string;
w.print(" TableDef\n (\n ");
w.print(quote_str(table_def.name));
w.print(",");
w.print(quote_str(table_def.old_name));
w.print(",");
w.print(quote_str(table_def.engine));
w.print(",");
w.print(quote_str(table_def.charset));
w.print(",");
w.print(table_def.no_id);
w.print(",");
w.print(quote_str(table_def.is_a));
w.print(",[");
w.print(table_def.has_a.map!quote_str().join(","));
w.print("],[");
w.print(table_def.belongs_to.map!quote_str().join(","));
w.print("],[");
w.print(table_def.has_many.map!quote_str().join(","));
w.print("],[");
w.print(table_def.primary.map!quote_str().join(","));
w.print("],\n [ //columns\n ");
//w.print(table_def.columns.meld!((a,b) => ("\""~a~"\":"~b.literal()))().join(",\n "));
w.print(table_def.columns.map!literal().join(",\n "));
w.print("\n ],\n");
if (table_def.indicies.length)
w.println(" [",table_def.indicies.meld!((a,b) => ("\""~a~"\":"~b.literal()))().join(","),"]");
else
w.println(" null");
w.print(" )");
return w.data;
}
string literal(ref ColumnDef column_def)
{
auto w = appender!string;
w.print("ColumnDef(");
w.print(quote_str(column_def.name));
w.print(",");
w.print(quote_str(column_def.old_name));
w.print(",");
w.print("ColumnDef.Type.",column_def.type);
w.print(",");
w.print(quote_str(column_def.custom_type));
w.print(",");
w.print(column_def.size);
w.print(",");
w.print(column_def.scale);
w.print(",[");
w.print(column_def.values.map!quote_str().join(","));
w.print("],");
w.print(quote_str(column_def.default_value));
w.print(",");
w.print(column_def.nullable);
w.print(",");
w.print(column_def.unsigned);
w.print(",");
w.print(column_def.auto_increment);
w.print(")");
return w.data;
}
string literal(ref IndexDef index_def)
{
auto w = appender!string;
w.print("IndexDef(");
w.print(quote_str(index_def.name)),
w.print(",");
w.print(index_def.unique);
w.print(",");
w.print(index_def.fulltext);
w.print(",[");
w.print(index_def.columns.map!quote_str().join(","));
w.print("])");
return w.data;
}
string literal(ref ViewDef viewDef)
{
auto w = appender!string;
w.print(" ViewDef\n (\n ");
w.print(quote_str(viewDef.name));
w.print(",\n ");
w.print(quote_str(viewDef.sql));
w.print("\n )");
return w.data;
}
string literal(ref FunctionDef function_def)
{
auto w = appender!string;
w.print("FunctionDef(");
w.print(quote_str(function_def.name));
w.print(",");
w.print(quote_str(function_def.definer));
w.print(",");
w.print(function_def.no_sql);
w.print(",");
w.print(function_def.deterministic);
w.print(",[");
w.print(function_def.parameters.map!literal().join(","));
w.print("],");
w.print(literal(function_def.returns));
w.print(",");
w.print(quote_str(function_def.fn_body));
w.print(")");
return w.data;
}
string quote_str(string s)
{
if (s is null)
return "null";
else
return "\""~s~"\"";
}
|
D
|
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatikUITests.build/Objects-normal/x86_64/BaseTest.o : /Users/Natalia/FunChatik/FunChatikUITests/Data/CreateData.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ProfileScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/BaseScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/LoginScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChooseAvatarScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChatScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateAccountScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/CreateUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/LoginUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/ChannelsTests.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/BaseTest.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatikUITests.build/Objects-normal/x86_64/BaseTest~partial.swiftmodule : /Users/Natalia/FunChatik/FunChatikUITests/Data/CreateData.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ProfileScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/BaseScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/LoginScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChooseAvatarScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChatScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateAccountScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/CreateUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/LoginUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/ChannelsTests.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/BaseTest.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Natalia/FunChatik/Jenkins/build/Build/Intermediates.noindex/FunChatik.build/Debug-iphonesimulator/FunChatikUITests.build/Objects-normal/x86_64/BaseTest~partial.swiftdoc : /Users/Natalia/FunChatik/FunChatikUITests/Data/CreateData.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ProfileScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/BaseScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateChannelScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/LoginScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChooseAvatarScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/ChatScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/Screens/CreateAccountScreen.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/CreateUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/LoginUser.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/ChannelsTests.swift /Users/Natalia/FunChatik/FunChatikUITests/AllTests/BaseTest.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
a misanthrope who dislikes women in particular
|
D
|
module android.java.android.webkit.WebMessagePort;
public import android.java.android.webkit.WebMessagePort_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!WebMessagePort;
import import3 = android.java.java.lang.Class;
|
D
|
import std.stdio, std.socket, core.thread, std.file, std.datetime, std.conv;
import std.array, std.algorithm, std.string;
class Handler : Thread{
private Socket socket;
this(){
super(&run);
}
this(Socket socket){
this.socket = socket;
super(&run);
}
private void run(){
char[2048] buffer;
char[] buffer_response;
auto lenght = socket.receive(buffer);
string request = to!string(buffer[0 .. lenght]);
string[] splited_request = request.split[0 .. 3];
auto method = splited_request[0];
auto path = splited_request[1];
auto http_version = splited_request[2];
if(!path.startsWith("/")){
socket.shutdown(SocketShutdown.BOTH);
auto curr_time = Clock.currTime(UTC());
throw new Exception(curr_time.toString() ~ " [ ERROR ] Path must start with /");
}
if(path == "/") { path = "/index.html"; }
auto final_path = "public_html" ~ path;
writeln(Clock.currTime(UTC()).toString() ~ "[ INFO ] Client " ~ socket.hostName() ~
" Path : " ~ path);
if(!exists(final_path)){
http_return("404 error: File not Found".dup, 404 , "Not Found", "text/plain");
socket.shutdown(SocketShutdown.BOTH);
return;
}
auto page_file = File(final_path, "r");
auto buf = page_file.rawRead(new char[page_file.size()]);
string[] splited_path = path.split(".");
string[string] mimes = [
"html" : "text/html;charset=utf-8",
"png" : "image/png",
"jpg" : "image/jpeg",
"css" : "text/css",
"gif" : "image/gif",
"js" : "text/javascript"
];
auto my_mime_type = "application/binary";
if(splited_path[splited_path.length-1] in mimes){
my_mime_type = mimes[splited_path[splited_path.length-1]];
}
http_return(buf,200 , "OK", my_mime_type);
page_file.close();
socket.shutdown(SocketShutdown.BOTH);
}
private void http_return(char[] data, int status, string status_text,
string mime="application/binary"){
string response = "HTTP/1.1 " ~ to!string(status) ~ " " ~ status_text ~ "\r\n";
response ~= "Content-Type: " ~ mime ~ "\r\n";
response ~= "Content-Length: " ~ to!string(data.length) ~ "\r\n\r\n";
response ~= data;
socket.send(response);
}
}
void main(string[] args){
if(args.length != 4){
writeln("[ ERROR ] Wrong arguments. Close server...");
return;
}
ushort port = to!ushort(args[1]);
string public_html = args[3];
string addr = args[2];
auto listener = new Socket(AddressFamily.INET, SocketType.STREAM);
listener.bind(new InternetAddress(addr.dup, port));
listener.listen(10);
writeln(Clock.currTime(UTC()).toString() ~ " [ INFO ] Server start => [ hostName : " ~
listener.hostName() ~ " : localAddress : " ~ listener.localAddress().toAddrString() ~ " ]");
bool isRunning = true;
while(isRunning){
auto client = listener.accept();
auto curr_time = Clock.currTime(UTC());
writeln(curr_time.toString() ~ " [ INFO ] Connected client => [ hostName : " ~
client.hostName() ~ " : localAddress : " ~ client.localAddress().toAddrString() ~
" : remoteAddress : " ~ client.remoteAddress().toAddrString() ~ " ]");
auto t1 = new Handler(client);
t1.isDaemon(false);
t1.start();
}
}
|
D
|
/Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Intermediates.noindex/MVC.build/Debug-iphonesimulator/MVC.build/Objects-normal/x86_64/Custome.o : /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/HomeVC.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/LoginVC.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/BaseURL.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/Custome.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/SceneDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/AppDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/LoginModel.swift /Users/hanykaram/Desktop/MVC/MVC/ProductModel.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/View/CustomeTableView/TableViewCell.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/CustomeButton.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/NetworkManager.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/ActivityIndector.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/PKHUD.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/NVActivityIndicatorView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Intermediates.noindex/MVC.build/Debug-iphonesimulator/MVC.build/Objects-normal/x86_64/Custome~partial.swiftmodule : /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/HomeVC.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/LoginVC.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/BaseURL.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/Custome.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/SceneDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/AppDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/LoginModel.swift /Users/hanykaram/Desktop/MVC/MVC/ProductModel.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/View/CustomeTableView/TableViewCell.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/CustomeButton.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/NetworkManager.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/ActivityIndector.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/PKHUD.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/NVActivityIndicatorView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Intermediates.noindex/MVC.build/Debug-iphonesimulator/MVC.build/Objects-normal/x86_64/Custome~partial.swiftdoc : /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/HomeVC.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/LoginVC.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/BaseURL.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/Custome.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/SceneDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/AppDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/LoginModel.swift /Users/hanykaram/Desktop/MVC/MVC/ProductModel.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/View/CustomeTableView/TableViewCell.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/CustomeButton.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/NetworkManager.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/ActivityIndector.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/PKHUD.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/NVActivityIndicatorView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Intermediates.noindex/MVC.build/Debug-iphonesimulator/MVC.build/Objects-normal/x86_64/Custome~partial.swiftsourceinfo : /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/HomeVC.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/Controller/LoginVC.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/BaseURL.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/Custome.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/SceneDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/Delegate/AppDelegate.swift /Users/hanykaram/Desktop/MVC/MVC/LoginModel.swift /Users/hanykaram/Desktop/MVC/MVC/ProductModel.swift /Users/hanykaram/Desktop/MVC/MVC/MVC/View/CustomeTableView/TableViewCell.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/CustomeButton.swift /Users/hanykaram/Desktop/MVC/MVC/NetWork/NetworkManager.swift /Users/hanykaram/Desktop/MVC/MVC/Cutome\ +\ Extenstion/ActivityIndector.swift /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/PKHUD.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/NVActivityIndicatorView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-umbrella.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Headers/PKHUD-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Headers/NVActivityIndicatorView-Swift.h /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/PKHUD/PKHUD.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/hanykaram/Desktop/MVC/DerivedData/MVC/Build/Intermediates.noindex/SwiftMigration/MVC/Products/Debug-iphonesimulator/NVActivityIndicatorView/NVActivityIndicatorView.framework/Modules/module.modulemap /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/hanykaram/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module android.java.java.security.SignedObject_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import0 = android.java.java.io.Serializable_d_interface;
import import4 = android.java.java.lang.Class_d_interface;
import import2 = android.java.java.security.Signature_d_interface;
import import3 = android.java.java.security.PublicKey_d_interface;
import import1 = android.java.java.security.PrivateKey_d_interface;
final class SignedObject : IJavaObject {
static immutable string[] _d_canCastTo = [
"java/io/Serializable",
];
@Import this(import0.Serializable, import1.PrivateKey, import2.Signature);
@Import IJavaObject getObject();
@Import byte[] getSignature();
@Import string getAlgorithm();
@Import bool verify(import3.PublicKey, import2.Signature);
@Import import4.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Ljava/security/SignedObject;";
}
|
D
|
instance DJG_7110_GODAR(Npc_Default)
{
name[0] = "Годар";
guild = GIL_OUT;
id = 7110;
voice = 13;
flags = 0;
npcType = npctype_main;
aivar[AIV_DropDeadAndKill] = TRUE;
B_SetAttributesToChapter(self,6);
fight_tactic = FAI_HUMAN_MASTER;
EquipItem(self,ItMw_1h_Sld_Sword_New);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_FatBald",Face_N_Normal14,BodyTex_N,itar_djg_m_NPC);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,80);
daily_routine = rtn_prestart_7110;
};
func void rtn_prestart_7110()
{
TA_Stand_Guarding(8,0,21,0,"NW_ENTERVALLEY_DJG_03");
TA_Stand_Guarding(21,0,8,0,"NW_ENTERVALLEY_DJG_03");
};
func void rtn_start_7110()
{
TA_Stand_Drinking(8,0,21,0,"NW_BIGFARM_GODAR");
TA_Smoke_Joint(21,0,8,0,"NW_BIGFARM_GODAR");
};
func void rtn_tot_7110()
{
TA_Stand_Guarding(8,0,23,0,"TOT");
TA_Stand_Guarding(23,0,8,0,"TOT");
};
func void rtn_inbattle_7110()
{
ta_bigfight(8,0,22,0,"NW_BIGFIGHT_8758");
ta_bigfight(22,0,8,0,"NW_BIGFIGHT_8758");
};
|
D
|
//***************************************************************************
// Alte Mine - Tor auf der untersten Ebene
//***************************************************************************
var int _STR_MESSAGE_WHEEL_STUCKS_AGAIN;
FUNC int MC_OLDMINE_ASGHAN ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_OLDMINE_ASGHAN");
if (Npc_KnowsInfo(hero,Grd_263_Asghan_OPEN_NOW) && (_STR_MESSAGE_WHEEL_STUCKS_AGAIN == 0))
{
_STR_MESSAGE_WHEEL_STUCKS_AGAIN=1;
return TRUE;
}
else
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
return FALSE;
};
};
//***************************************************************************
// Alte Mine - Eingangstor
//***************************************************************************
func int MC_OLDMINE_ENTRANCE ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_OLDMINE_ENTRANCE");
PrintGlobals (PD_ITEM_MOBSI);
if (Kapitel >= 4)
&& Hlp_IsValidNpc(self)
{
PrintDebugNpc (PD_ITEM_MOBSI, "...blockiert");
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
return FALSE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...bedienbar");
return TRUE;
};
};
//***************************************************************************
// Klosterruine
//***************************************************************************
FUNC int MC_MONASTERYRUIN_GATE ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_MONASTERYRUIN_GATE");
if (MonasteryRuin_GateOpen == FALSE)
{
PrintDebugNpc (PD_ITEM_MOBSI, "...noch nie geöffnet");
AI_UseMob (hero,"VWHEEL",1);
AI_UseMob (hero,"VWHEEL",-1);
MonasteryRuin_GateOpen = TRUE;
return TRUE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...schonmal geöffnet");
return TRUE;
};
};
//***************************************************************************
// Ork-Friedhof
//***************************************************************************
FUNC int MC_OGY_GATE ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_OGY_GATE");
if (CorAngar_GotoOGY)
{
PrintDebugNpc (PD_ITEM_MOBSI, "...closed");
return TRUE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...open");
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
return FALSE;
};
};
//***************************************************************************
// Ork-Friedhof
//***************************************************************************
var int FM_GateOpen;
FUNC int MC_FM_GATE ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_FM_GATE");
if ((Kapitel == 4) && (FM_GateOpen == FALSE))
{
PrintDebugNpc (PD_ITEM_MOBSI, "...closed");
AI_UseMob (hero,"VWHEEL",1);
AI_UseMob (hero,"VWHEEL",-1);
FM_GateOpen = TRUE;
// falls die Gardisten sofort attackiert wurden, Gorn hier auch nochmal zum Tor runterschicken
B_ExchangeRoutine (PC_Fighter, "WaitFM");
return TRUE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...open");
if !FM_GateOpen
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
};
return FALSE;
};
};
//***************************************************************************
// Trollschlucht
//***************************************************************************
FUNC int EVT_TROLLSCHLUCHT_GATE_TRIGGER ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "EVT_TROLLSCHLUCHT_GATE_TRIGGER");
if (Saturas_BringFoci > 0)
{
if (Troll_Wheel == 0)
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
Troll_Wheel = 1; // SC hat die Winde zum ersten Mal angepackt!
return FALSE;
}
else if (Troll_Wheel == 1)
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
return FALSE;
}
else if (Troll_Wheel == 2)
{
AI_UseMob (hero,"VWHEEL",1);
AI_UseMob (hero,"VWHEEL",-1);
Troll_Wheel = 3;
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_13");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_13");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_13");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_13");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_14");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_14");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_14");
Wld_InsertNpc (BlackGobboWarrior,"LOCATION_12_14");
return TRUE;
}
else // Troll_Wheel == 3
{
return FALSE;
};
}
else
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
};
};
//***************************************************************************
// Ork-Stadt - großes Holztor
//***************************************************************************
var int OrcCity_GateOpen;
FUNC int MC_OrcCity_Gate ()
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_OrcCity_Gate");
if ((Kapitel >= 5) && (OrcCity_GateOpen == FALSE))
{
PrintDebugNpc (PD_ITEM_MOBSI, "...closed");
AI_UseMob (hero,"VWHEEL",1);
AI_UseMob (hero,"VWHEEL",-1);
OrcCity_GateOpen = TRUE;
return TRUE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...open");
if !OrcCity_GateOpen
{
G_PrintScreen (_STR_MESSAGE_WHEEL_STUCKS);
};
return FALSE;
};
};
//***************************************************************************
// Ork-Stadt - äußeres Tempeltor
//***************************************************************************
FUNC int MC_OrcCity_Sunctum_OuterGate () // heißt absichtlich "Sunctum"
{
PrintDebugNpc (PD_ITEM_MOBSI, "MC_OrcCity_Sanctum_OuterGate");
OrcCity_Sanctum_OuterGateTried = TRUE;
if (Kapitel >= 5)
&& (Npc_HasItems(hero,ItMi_Stuff_Idol_Sleeper_01))
&& (OrcCity_Sanctum_OuterGateOpen == FALSE)
{
PrintDebugNpc (PD_ITEM_MOBSI, "...closed");
G_PrintScreen (_STR_MESSAGE_OCLEVER_MOVES);
AI_UseMob (hero,"LEVER",1);
AI_UseMob (hero,"LEVER",-1);
OrcCity_Sanctum_OuterGateOpen = TRUE;
return TRUE;
}
else
{
PrintDebugNpc (PD_ITEM_MOBSI, "...open");
if !OrcCity_Sanctum_OuterGateOpen
{
G_PrintScreen (_STR_MESSAGE_OCLEVER_STUCKS);
};
return FALSE;
};
};
|
D
|
const int SPL_Cost_WindFist = 48;
const int STEP_WindFist = 12;
const int SPL_Damage_Windfist = 60;
instance Spell_WindFist(C_Spell_Proto)
{
time_per_mana = 10;
damage_per_level = SPL_Damage_Windfist;
damagetype = DAM_FLY;
canTurnDuringInvest = TRUE;
targetCollectAlgo = TARGET_COLLECT_NONE;
targetCollectRange = 1250;
targetCollectType = TARGET_TYPE_NPCS;
isMultiEffect = 1;
};
func int Spell_Logic_WindFist(var int manaInvested)
{
if(self.attribute[ATR_MANA] < STEP_WindFist)
{
return SPL_DONTINVEST;
};
if(manaInvested <= (STEP_WindFist * 1))
{
self.aivar[AIV_SpellLevel] = 1;
return SPL_STATUS_CANINVEST_NO_MANADEC;
}
else if((manaInvested > (STEP_WindFist * 1)) && (self.aivar[AIV_SpellLevel] <= 1))
{
self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_WindFist;
if(self.attribute[ATR_MANA] < 0)
{
self.attribute[ATR_MANA] = 0;
};
self.aivar[AIV_SpellLevel] = 2;
return SPL_NEXTLEVEL;
}
else if((manaInvested > (STEP_WindFist * 2)) && (self.aivar[AIV_SpellLevel] <= 2))
{
self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_WindFist;
if(self.attribute[ATR_MANA] < 0)
{
self.attribute[ATR_MANA] = 0;
};
self.aivar[AIV_SpellLevel] = 3;
return SPL_NEXTLEVEL;
}
else if((manaInvested > (STEP_WindFist * 3)) && (self.aivar[AIV_SpellLevel] <= 3))
{
self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_WindFist;
if(self.attribute[ATR_MANA] < 0)
{
self.attribute[ATR_MANA] = 0;
};
self.aivar[AIV_SpellLevel] = 4;
return SPL_NEXTLEVEL;
}
else if((manaInvested > (STEP_WindFist * 3)) && (self.aivar[AIV_SpellLevel] == 4))
{
return SPL_DONTINVEST;
};
return SPL_STATUS_CANINVEST_NO_MANADEC;
};
func void Spell_Cast_WindFist(var int spellLevel)
{
self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_WindFist;
if(self.attribute[ATR_MANA] < 0)
{
self.attribute[ATR_MANA] = 0;
};
self.aivar[AIV_SelectSpell] += 1;
};
|
D
|
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_packed_switch_7.java
.class public dot.junit.opcodes.packed_switch.d.T_packed_switch_7
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run(I)I
.limit regs 5
packed-switch v4, -1
Label9 ; -1
Label6 ; 0
Label6 ; 1
Label12 ; 2
Label12 ; 3
packed-switch-end
Label6:
const/4 v2, -1
return v2
Label9:
const/4 v2, 2
return v2
Label12:
const/16 v2, 20
return v2
.end method
|
D
|
/x/calo/jgoncalves/JetCleaningHI/RootCoreBin/obj/x86_64-slc6-gcc49-opt/QuickAna/obj/quickana_basic.o /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/obj/x86_64-slc6-gcc49-opt/QuickAna/obj/quickana_basic.d : /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/util/quickana_basic.cxx /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/CorrectionCode.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/MessageCheck.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/Global.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/MessageCheck.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/MsgStream.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/AsgToolsConf.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/MsgLevel.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/IAsgTool.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/AsgToolMacros.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/StatusCode.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/Check.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/MsgStreamMacros.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TReturnCode.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/QuickAna.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/AsgTool.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/AsgMessaging.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/SgTEvent.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/SgTEvent.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/TEvent.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Rtypes.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RtypesCore.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RConfig.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RVersion.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/DllImport.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Rtypeinfo.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/snprintf.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/strlcpy.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TGenericClassInfo.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TSchemaHelper.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEventFormat/EventFormat.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEventFormat/versions/EventFormat_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEventFormat/EventFormatElement.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCore/CLASS_DEF.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCore/ClassID_traits.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxStoreHolder.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccessInterfaces/TVirtualEvent.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccessInterfaces/TVirtualEvent.icc /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TError.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/TEvent.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/ClassName.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/ClassName.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/error.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/TStore.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/ConstDataVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/DataVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/exceptions.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/AuxTypes.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CxxUtils/unordered_set.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CxxUtils/hashtable.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_const.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/user.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/select_compiler_config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/compiler/gcc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/select_stdlib_config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/stdlib/libstdcpp3.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/select_platform_config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/platform/linux.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/posix_features.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/config/suffix.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/detail/workaround.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CxxUtils/noreturn.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/OwnershipPolicy.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/IndexTrackingPolicy.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxVectorBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxVectorData.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IConstAuxStore.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/AuxDataOption.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/AuxDataOption.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/AuxDataTraits.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/DataLink.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/DataLinkBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/tools/selection_ns.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RVersion.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RootMetaSelection.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/DataLink.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccessInterfaces/TActiveEvent.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CxxUtils/override.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/likely.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/assume.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/threading.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/threading.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxVectorData.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxTypeRegistry.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxTypeVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxTypeVectorFactory.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/AuxTypeVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxSetOption.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/PackedContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/PackedParameters.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/PackedParameters.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/PackedContainer.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/AuxTypeVector.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/AuxTypeVectorFactory.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/AuxTypeVectorFactory.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxTypeRegistry.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxStore.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxElement.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/IAuxElement.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxElement.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/ATHCONTAINERS_ASSERT.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainersInterfaces/AuxStore_traits.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/AuxVectorBase.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVLNoBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVLInfo.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/ClassID.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVLInfo.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVLCast.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVLIterator.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/ElementProxy.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/ElementProxy.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/iterator_adaptor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/static_assert.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/detail/iterator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/iterator_categories.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/detail/config_def.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/eval_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/value_wknd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/static_cast.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/workaround.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/integral.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/msvc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/eti.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/na_spec.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/lambda_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/void_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/adl_barrier.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/adl.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/intel.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/gcc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/na.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/bool.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/bool_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/integral_c_tag.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/static_constant.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/na_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/ctps.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/lambda.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/ttp.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/int.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/int_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/nttp_decl.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/nttp.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/integral_wrapper.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/cat.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/config/config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/lambda_arity_param.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/template_arity_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/arity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/dtp.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessor/params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/preprocessor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/comma_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/punctuation/comma_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/control/if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/control/iif.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/logical/bool.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/facilities/empty.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/punctuation/comma.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repeat.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repetition/repeat.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/debug/error.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/detail/auto_rec.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/tuple/eat.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/inc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/arithmetic/inc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessor/enum.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessor/def_params_tail.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/limits/arity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/logical/and.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/logical/bitand.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/identity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/facilities/identity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/empty.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/arithmetic/add.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/arithmetic/dec.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/control/while.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/fold_left.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/detail/fold_left.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/control/expr_iif.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/adt.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/detail/is_binary.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/detail/check.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/logical/compl.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/fold_right.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/detail/fold_right.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/list/reverse.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/control/detail/while.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/tuple/elem.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/facilities/expand.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/facilities/overload.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/variadic/size.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/tuple/rem.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/tuple/detail/is_single_return.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/variadic/elem.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/arithmetic/sub.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/overload_resolution.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/lambda_support.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/identity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/placeholders.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/arg.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/arg_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/na_assert.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/assert.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/not.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/nested_type_wknd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/yes_no.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/arrays.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/gpu.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/pp_counter.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/arity_spec.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/arg_typedef.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/use_preprocessed.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/include_preprocessed.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/compiler.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/stringize.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/arg.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_convertible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/intrinsics.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/config.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/version.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/integral_constant.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/yes_no_type.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_array.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_arithmetic.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_integral.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_floating_point.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_void.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_abstract.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_lvalue_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_rvalue_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_lvalue_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_rvalue_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_function.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/is_function_ptr_helper.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/declval.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/detail/config_undef.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/iterator_facade.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/interoperable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/or.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/or.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/iterator_traits.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/detail/facade_iterator_category.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/and.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/and.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_same.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_const.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/detail/indirect_traits.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_class.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_volatile.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_member_function_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_cv.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_member_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_reference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/detail/enable_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/addressof.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/core/addressof.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_const.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_pod.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_scalar.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_enum.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/always.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessor/default_params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/apply.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/apply_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/apply_wrap.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/has_apply.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/has_xxx.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/type_wrapper.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/has_xxx.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/msvc_typename.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/array/elem.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/array/data.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/array/size.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repetition/enum_params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repetition/enum_trailing_params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/has_apply.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/msvc_never_true.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/lambda.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/bind.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/bind_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/bind.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/next.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/next_prior.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/common_name_wknd.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/protect.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/bind.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/full_lambda.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/quote.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/void.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/has_type.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/config/bcc.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/template_arity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/mpl/aux_/preprocessed/gcc/apply.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVL_iter_swap.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVL_algorithms.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/DVL_algorithms.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/IsMostDerivedFlag.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_cv.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/add_volatile.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/aligned_storage.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/alignment_of.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/type_with_alignment.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/conditional.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/common_type.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/decay.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_bounds.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_extent.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/mp_defer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/copy_cv.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/extent.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/floating_point_promotion.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/function_traits.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_and.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/has_binary_operator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_base_of.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_base_and_derived.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_fundamental.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_and_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_or.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_or_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_xor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_bit_xor_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_complement.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/has_prefix_operator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_dereference.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_divides.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_divides_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_equal_to.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_greater.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_greater_equal.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_left_shift.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_left_shift_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_less.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_less_equal.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_logical_and.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_logical_not.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_logical_or.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_minus.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_minus_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_modulus.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_modulus_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_multiplies.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_multiplies_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_negate.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_new_operator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_not_equal_to.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_nothrow_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_assignable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_nothrow_constructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_default_constructible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_nothrow_copy.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_copy_constructible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_constructible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_destructible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_nothrow_destructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_destructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_plus.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_plus_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_post_decrement.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/detail/has_postfix_operator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_post_increment.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_pre_decrement.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_pre_increment.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_right_shift.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_right_shift_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_constructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_copy.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_move_assign.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_trivial_move_constructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_unary_minus.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_unary_plus.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/has_virtual_destructor.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_complex.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_compound.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_copy_assignable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/noncopyable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/core/noncopyable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_empty.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_final.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_float.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_member_object_pointer.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_nothrow_move_assignable.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/enable_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/core/enable_if.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_nothrow_move_constructible.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_object.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_polymorphic.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_signed.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_stateless.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_union.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_unsigned.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/is_virtual_base_of.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/make_signed.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/make_unsigned.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/rank.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_all_extents.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/remove_volatile.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/type_identity.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/integral_promotion.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/promote.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/DataVector.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/tools/CompareAndPrint.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/ConstDataVector.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/iterator/transform_iterator.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/result_of.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/iteration/iterate.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/slot/slot.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/slot/detail/def.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repetition/enum_binary_params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/repetition/enum_shifted_params.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/facilities/intercept.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/declval.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/iteration/detail/iter/forward1.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/iteration/detail/bounds/lower1.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/slot/detail/shared.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/preprocessor/iteration/detail/bounds/upper1.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/detail/result_of_iterate.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/TStore.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthContainers/normalizedTypeinfoName.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TDestructorRegistry.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TDestructorRegistry.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TDestructor.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TDestructor.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TCDVHolderT.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/THolder.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/tools/TCDVHolderT.icc /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TClass.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TDictionary.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TNamed.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TObject.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TStorage.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVersionCheck.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Riosfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TBuffer.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TString.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMathBase.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RStringView.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RConfigure.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/RWrap_libcpp_string_view.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/libcpp_string_view.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/ESTLType.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TObjArray.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TSeqCollection.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TCollection.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TIterator.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TObjString.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/ThreadLocalStorage.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/AsgTool.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/PropertyMgr.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/Property.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/PropertyMgr.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/TProperty.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/ToolHandle.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/ToolHandle.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/ToolStore.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/ToolHandleArray.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/ToolHandleArray.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/TProperty.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AsgTools/SetProperty.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/Configuration.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/Configuration.icc /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/IQuickAna.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/ISystematicsTool.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/SystematicCode.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/SystematicVariation.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/Global.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/PATInterfaces/SystematicSet.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/xAODInclude.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/ElectronContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/Electron.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/Electron_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLink.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLinkBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/tools/TypeTools.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLink.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/Egamma_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBase/IParticle.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TLorentzVector.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMath.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TError.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVector3.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVector2.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrix.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixF.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixT.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixTBase.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixFBasefwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixDBasefwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVectorFfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVectorDfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixTUtils.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixFfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixFUtils.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMatrixFUtilsfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TRotation.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBase/ObjectType.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/EgammaDefs.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/EgammaEnums.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/CaloCluster.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/versions/CaloCluster_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CaloGeoHelpers/CaloSampling.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CaloGeoHelpers/CaloSampling.def /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/CaloClusterBadChannelData.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/versions/CaloClusterBadChannelData_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/CaloClusterContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCaloEvent/versions/CaloClusterContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBase/IParticleContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPrimitives/IsolationCorrection.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPrimitives/IsolationType.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPrimitives/IsolationFlavour.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/EventPrimitives/EventPrimitives.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Core /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/DisableStupidWarnings.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/Macros.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/MKL_support.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/Constants.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/ForwardDeclarations.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/Meta.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/StaticAssert.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/XprHelper.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/Memory.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/NumTraits.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/MathFunctions.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/GenericPacketMath.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/arch/SSE/PacketMath.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/arch/SSE/MathFunctions.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/arch/SSE/Complex.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/arch/Default/Settings.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Functors.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/DenseCoeffsBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/DenseBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/BlockMethods.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/MatrixBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/CommonCwiseUnaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/CommonCwiseBinaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/MatrixCwiseUnaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/MatrixCwiseBinaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/EventPrimitives/AmgMatrixPlugin.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/EigenBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Assign.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/BlasUtil.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/DenseStorage.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/NestByValue.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/ForceAlignedAccess.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/ReturnByValue.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/NoAlias.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/PlainObjectBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Matrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/EventPrimitives/SymmetricMatrixHelpers.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Array.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CwiseBinaryOp.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CwiseUnaryOp.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CwiseNullaryOp.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CwiseUnaryView.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/SelfCwiseBinaryOp.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Dot.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/StableNorm.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/MapBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Stride.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Map.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Block.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/VectorBlock.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Ref.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Transpose.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/DiagonalMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Diagonal.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/DiagonalProduct.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/PermutationMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Transpositions.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Redux.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Visitor.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Fuzzy.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/IO.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Swap.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CommaInitializer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Flagged.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/ProductBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/GeneralProduct.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/TriangularMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/SelfAdjointView.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/GeneralBlockPanelKernel.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/Parallelizer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/CoeffBasedProduct.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/GeneralMatrixVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/GeneralMatrixMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/SolveTriangular.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/SelfadjointMatrixVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/SelfadjointMatrixMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/SelfadjointProduct.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/SelfadjointRank2Update.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/TriangularMatrixVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/TriangularMatrixMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/TriangularSolverMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/products/TriangularSolverVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/BandMatrix.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/CoreIterators.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/BooleanRedux.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Select.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/VectorwiseOp.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Random.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Replicate.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/Reverse.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/ArrayBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/ArrayCwiseUnaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/ArrayWrapper.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/GlobalFunctions.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Core/util/ReenableStupidWarnings.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Dense /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Core /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/LU /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/misc/Solve.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/misc/Kernel.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/misc/Image.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/LU/FullPivLU.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/LU/PartialPivLU.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/LU/Determinant.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/LU/Inverse.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/LU/arch/Inverse_SSE.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Cholesky /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Cholesky/LLT.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Cholesky/LDLT.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/QR /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Jacobi /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Jacobi/Jacobi.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Householder /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Householder/Householder.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Householder/HouseholderSequence.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Householder/BlockHouseholder.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/QR/HouseholderQR.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/QR/FullPivHouseholderQR.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/QR/ColPivHouseholderQR.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/SVD /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/SVD/JacobiSVD.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/SVD/UpperBidiagonalization.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Geometry /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/OrthoMethods.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/EulerAngles.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Homogeneous.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/RotationBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Rotation2D.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Quaternion.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/AngleAxis.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Transform.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/EventPrimitives/AmgTransformPlugin.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Translation.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Scaling.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Hyperplane.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/ParametrizedLine.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/AlignedBox.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/Umeyama.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Geometry/arch/Geometry_SSE.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Eigenvalues /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/Tridiagonalization.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/RealSchur.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/./HessenbergDecomposition.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/EigenSolver.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/./RealSchur.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/./Tridiagonalization.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/HessenbergDecomposition.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/ComplexSchur.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/ComplexEigenSolver.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/./ComplexSchur.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/RealQZ.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/./RealQZ.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/CxxUtils/final.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/TrackingPrimitives.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/TrackParticle.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/TrackParticle_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/VertexContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/VertexFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/TrackParticleContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/TrackParticleContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/TrackParticle_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/TrackParticleContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/TrackParticleFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/ElectronContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/EgammaContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/EgammaContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/EgammaFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/ElectronContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/ElectronFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/PhotonContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/Photon.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/Photon_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/Vertex.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/Vertex_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/GeoPrimitives/GeoPrimitives.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/Eigen/Geometry /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/NeutralParticleContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/NeutralParticle.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/NeutralParticle_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/NeutralParticleContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/NeutralParticle_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/NeutralParticleContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/NeutralParticleFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBase/ObjectType.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODCore/BaseInfo.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/VertexContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTracking/versions/VertexContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/PhotonxAODHelpers.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/PhotonFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/versions/PhotonContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEgamma/PhotonContainerFwd.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEventInfo/EventInfo.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODEventInfo/versions/EventInfo_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/Jet.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/versions/Jet_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/BTaggingContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/BTagging.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/versions/BTagging_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/BTaggingEnums.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/BTagVertexContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/BTagVertex.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/versions/BTagVertex_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/versions/BTagVertexContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODBTagging/versions/BTaggingContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetConstituentVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetTypes.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/Vector4D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/Vector4Dfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/PxPyPzE4D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/eta.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/etaMax.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/GenVector_exception.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/PtEtaPhiE4D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/Math.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/PxPyPzM4D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/PtEtaPhiM4D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/LorentzVector.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/DisplacementVector3D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/Cartesian3D.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/Polar3Dfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/PositionVector3Dfwd.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/GenVectorIO.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/BitReproducible.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Math/GenVector/CoordinateSystemTags.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetAttributes.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetContainerInfo.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/versions/Jet_v1.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/versions/JetAccessorMap_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLinkVector.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLinkVectorBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/AthLinks/ElementLinkVector.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/JetAccessors.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODJet/versions/JetContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/MissingETContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/MissingET.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/versions/MissingET_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/versions/MissingETBase.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/tuple/tuple.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/ref.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/core/ref.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/tuple/detail/tuple_basic.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/type_traits/cv_traits.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/utility/swap.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/boost/core/swap.hpp /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/versions/MissingET_v1.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/versions/MissingETContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMissingET/versions/MissingETContainer_v1.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/MuonContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/Muon.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/Muon_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/MuonSegmentContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/MuonSegment.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/MuonSegment_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/MuonIdHelpers/MuonStationIndex.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/MuonSegmentContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/MuonSegment_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/MuonContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODMuon/versions/Muon_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTau/TauJetContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTau/TauJet.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTau/versions/TauJet_v2.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTau/TauDefs.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/PFOContainer.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/PFO.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/versions/PFO_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/PFODefs.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TVector3.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/versions/PFO_v1.icc /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/versions/PFOAttributesAccessor_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODPFlow/versions/PFOContainer_v1.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODTau/versions/TauJetContainer_v2.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.4.8/QuickAna/QuickAna/IQuickAna.icc /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TFile.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TDirectoryFile.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TDirectory.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TList.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TDatime.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TUUID.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TMap.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/THashTable.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TUrl.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TH1.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TAxis.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TAttAxis.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArrayD.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArray.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TAttLine.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TAttFill.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TAttMarker.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArrayC.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArrayS.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArrayI.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TArrayF.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/Foption.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/include/TFitResultPtr.h /x/calo/jgoncalves/JetCleaningHI/RootCoreBin/include/xAODRootAccess/Init.h
|
D
|
module hunt.stomp.converter.MessageConverterHelper;
import hunt.stomp.Message;
import hunt.stomp.MessageHeaders;
import hunt.stomp.support.GenericMessage;
import hunt.Exceptions;
import hunt.logging;
class MessageConverterHelper {
static T fromMessage(T)(MessageBase message) {
T r = T.init;
GenericMessage!(byte[]) m;
if(message.payloadType == typeid(byte[])) {
m = cast(GenericMessage!(byte[]))message;
}
else if(message.payloadType != typeid(T)) {
warningf("Wrong message type, expected: %s, actual: %s",
typeid(T), message.payloadType);
return r;
}
MessageHeaders headers = message.getHeaders;
static if(is(T == byte[])) {
return m.getPayload();
} else static if(is(T == string)) {
r = cast(string) m.getPayload();
} else {
warningf("Can't handle message for type: %s", typeid(T));
}
return r;
}
// static string getAsString(GenericMessage!(byte[]) message) {
// return cast(string) message.getPayload();
// }
}
|
D
|
instance Mod_1233_TPL_Templer_MT (Npc_Default)
{
//-------- primary data --------
name = Name_Templer;
npctype = NPCTYPE_mt_templer;
guild = GIL_out;
level = 17;
voice = 29;
id = 1233;
//-------- abilities --------
attribute[ATR_STRENGTH] = 130;
attribute[ATR_DEXTERITY] = 65;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 244;
attribute[ATR_HITPOINTS] = 244;
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Militia.mds");
// body mesh ,bdytex,skin,head mesh ,headtex,teethtex,ruestung
Mdl_SetVisualBody (self,"hum_body_Naked0", 1, 1 ,"Hum_Head_Psionic", 59 , 1, TPL_ARMOR_M);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_STRONG;
//-------- Talente --------
Npc_SetTalentSkill (self, NPC_TALENT_2H,1);
//-------- inventory --------
EquipItem (self, ItMw_2H_Sword_Light_02);
//-------------Daily Routine-------------
daily_routine = Rtn_start_1233;
};
FUNC VOID Rtn_start_1233 ()
{
TA_Guard_Passage (21,00,08,00,"PSI_TEMPLE_GUARD_04");
TA_Guard_Passage (08,00,21,00,"PSI_TEMPLE_GUARD_04");
};
FUNC VOID Rtn_Tot_1233 ()
{
TA_Stand_WP (08,00,20,00,"TOT");
TA_Stand_WP (20,00,08,00,"TOT");
};
|
D
|
characterized by or caused by allergy
having an allergy or peculiar or excessive susceptibility (especially to a specific factor
|
D
|
/*
Copyright (c) 2016-2020 Eugene Wissner
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/**
* Copyright: Eugene Wissner 2016-2020.
* License: $(LINK2 boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Eugene Wissner
*/
module dlib.container.buffer;
import dlib.memory;
version (unittest)
{
private int fillBuffer(ubyte[] buffer,
in size_t size,
int start = 0,
int end = 10) @nogc pure nothrow
in
{
assert(start < end);
}
do
{
auto numberRead = end - start;
for (ubyte i; i < numberRead; ++i)
{
buffer[i] = cast(ubyte) (start + i);
}
return numberRead;
}
}
/**
* Interface for implemeting input/output buffers.
*/
interface Buffer
{
/**
* Returns: The size of the internal buffer.
*/
@property size_t capacity() const @nogc @safe pure nothrow;
/**
* Returns: Data size.
*/
@property size_t length() const @nogc @safe pure nothrow;
/**
* Returns: Available space.
*/
@property size_t free() const @nogc @safe pure nothrow;
/**
* Params:
* start = Start position.
* end = End position.
*
* Returns: Array between $(D_PARAM start) and $(D_PARAM end).
*/
@property ubyte[] opSlice(size_t start, size_t end)
in
{
assert(start <= end);
assert(end <= length);
}
/**
* Returns: Length of available data.
*/
@property size_t opDollar() const pure nothrow @safe @nogc;
/**
* Returns: Data chunk.
*/
@property ubyte[] opIndex();
}
/**
* Self-expanding buffer, that can be used with functions returning the number
* of the read bytes.
*
* This buffer supports asynchronous reading. It means you can pass a new chunk
* to an asynchronous read function during you are working with already
* available data. But only one asynchronous call at a time is supported. Be
* sure to call $(D_PSYMBOL ReadBuffer.clear()) before you append the result
* of the pended asynchronous call.
*/
class ReadBuffer : Buffer
{
/// Internal buffer.
protected ubyte[] buffer_;
/// Filled buffer length.
protected size_t length_;
/// Start of available data.
protected size_t start;
/// Last position returned with $(D_KEYWORD []).
protected size_t ring;
/// Available space.
protected immutable size_t minAvailable;
/// Size by which the buffer will grow.
protected immutable size_t blockSize;
invariant
{
assert(length_ <= buffer_.length);
assert(blockSize > 0);
assert(minAvailable > 0);
}
/**
* Creates a new read buffer.
*
* Params:
* size = Initial buffer size and the size by which the buffer
* will grow.
* minAvailable = minimal size should be always available to fill.
* So it will reallocate if $(D_INLINECODE
* $(D_PSYMBOL free) < $(D_PARAM minAvailable)
* ).
*/
this(size_t size = 8192,
size_t minAvailable = 1024)
{
this.minAvailable = minAvailable;
this.blockSize = size;
defaultAllocator.resizeArray!ubyte(buffer_, size);
}
/**
* Deallocates the internal buffer.
*/
~this()
{
defaultAllocator.dispose(buffer_);
}
///
unittest
{
auto b = defaultAllocator.make!ReadBuffer;
assert(b.capacity == 8192);
assert(b.length == 0);
defaultAllocator.dispose(b);
}
/**
* Returns: The size of the internal buffer.
*/
@property size_t capacity() const @nogc @safe pure nothrow
{
return buffer_.length;
}
/**
* Returns: Data size.
*/
@property size_t length() const @nogc @safe pure nothrow
{
return length_ - start;
}
/**
* Clears the buffer.
*
* Returns: $(D_KEYWORD this).
*/
ReadBuffer clear() pure nothrow @safe @nogc
{
start = length_ = ring;
return this;
}
/**
* Returns: Available space.
*/
@property size_t free() const pure nothrow @safe @nogc
{
return length > ring ? capacity - length : capacity - ring;
}
///
unittest
{
auto b = defaultAllocator.make!ReadBuffer;
size_t numberRead;
// Fills the buffer with values 0..10
assert(b.free == b.blockSize);
numberRead = fillBuffer(b[], b.free, 0, 10);
b += numberRead;
assert(b.free == b.blockSize - numberRead);
b.clear();
assert(b.free == b.blockSize);
defaultAllocator.dispose(b);
}
/**
* Appends some data to the buffer.
*
* Params:
* length = Number of the bytes read.
*
* Returns: $(D_KEYWORD this).
*/
ReadBuffer opOpAssign(string op)(size_t length)
if (op == "+")
{
length_ += length;
ring = start;
return this;
}
///
unittest
{
auto b = defaultAllocator.make!ReadBuffer;
size_t numberRead;
ubyte[] result;
// Fills the buffer with values 0..10
numberRead = fillBuffer(b[], b.free, 0, 10);
b += numberRead;
result = b[0..$];
assert(result[0] == 0);
assert(result[1] == 1);
assert(result[9] == 9);
b.clear();
// It shouldn't overwrite, but append another 5 bytes to the buffer
numberRead = fillBuffer(b[], b.free, 0, 10);
b += numberRead;
numberRead = fillBuffer(b[], b.free, 20, 25);
b += numberRead;
result = b[0..$];
assert(result[0] == 0);
assert(result[1] == 1);
assert(result[9] == 9);
assert(result[10] == 20);
assert(result[14] == 24);
defaultAllocator.dispose(b);
}
/**
* Returns: Length of available data.
*/
@property size_t opDollar() const pure nothrow @safe @nogc
{
return length;
}
/**
* Params:
* start = Start position.
* end = End position.
*
* Returns: Array between $(D_PARAM start) and $(D_PARAM end).
*/
@property ubyte[] opSlice(size_t start, size_t end) pure nothrow @safe @nogc
{
return buffer_[this.start + start .. this.start + end];
}
/**
* Returns a free chunk of the buffer.
*
* Add ($(D_KEYWORD +=)) the number of the read bytes after using it.
*
* Returns: A free chunk of the buffer.
*/
ubyte[] opIndex()
{
if (start > 0)
{
auto ret = buffer_[0..start];
ring = 0;
return ret;
}
else
{
if (capacity - length < minAvailable)
{
defaultAllocator.resizeArray!ubyte(buffer_, capacity + blockSize);
}
ring = length_;
return buffer_[length_..$];
}
}
///
unittest
{
auto b = defaultAllocator.make!ReadBuffer;
size_t numberRead;
ubyte[] result;
// Fills the buffer with values 0..10
numberRead = fillBuffer(b[], b.free, 0, 10);
b += numberRead;
assert(b.length == 10);
result = b[0..$];
assert(result[0] == 0);
assert(result[9] == 9);
b.clear();
assert(b.length == 0);
defaultAllocator.dispose(b);
}
}
/**
* Circular, self-expanding buffer with overflow support. Can be used with
* functions returning returning the number of the transferred bytes.
*
* The buffer is optimized for situations where you read all the data from it
* at once (without writing to it occasionally). It can become ineffective if
* you permanently keep some data in the buffer and alternate writing and
* reading, because it may allocate and move elements.
*/
class WriteBuffer : Buffer
{
/// Internal buffer.
protected ubyte[] buffer_;
/// Buffer start position.
protected size_t start;
/// Buffer ring area size. After this position begins buffer overflow area.
protected size_t ring;
/// Size by which the buffer will grow.
protected immutable size_t blockSize;
/// The position of the free area in the buffer.
protected size_t position;
invariant
{
assert(blockSize > 0);
// position can refer to an element outside the buffer if the buffer is full.
assert(position <= buffer_.length);
}
/**
* Params:
* size = Initial buffer size and the size by which the buffer
* will grow.
*/
this(size_t size = 8192)
{
blockSize = size;
ring = size - 1;
defaultAllocator.resizeArray!ubyte(buffer_, size);
}
/**
* Deallocates the internal buffer.
*/
~this()
{
defaultAllocator.dispose(buffer_);
}
/**
* Returns: The size of the internal buffer.
*/
@property size_t capacity() const @nogc @safe pure nothrow
{
return buffer_.length;
}
/**
* Note that $(D_PSYMBOL length) doesn't return the real length of the data,
* but only the array length that will be returned with $(D_PSYMBOL buffer)
* next time. Be sure to call $(D_PSYMBOL buffer) and set $(D_KEYWORD +=)
* until $(D_PSYMBOL length) returns 0.
*
* Returns: Data size.
*/
@property size_t length() const @nogc @safe pure nothrow
{
if (position > ring || position < start) // Buffer overflowed
{
return ring - start + 1;
}
else
{
return position - start;
}
}
/**
* Returns: Length of available data.
*/
@property size_t opDollar() const pure nothrow @safe @nogc
{
return length;
}
///
unittest
{
auto b = defaultAllocator.make!WriteBuffer(4);
ubyte[3] buf = [48, 23, 255];
b ~= buf;
assert(b.length == 3);
b += 2;
assert(b.length == 1);
b ~= buf;
assert(b.length == 2);
b += 2;
assert(b.length == 2);
b ~= buf;
assert(b.length == 5);
b += b.length;
assert(b.length == 0);
defaultAllocator.dispose(b);
}
/**
* Returns: Available space.
*/
@property size_t free() const @nogc @safe pure nothrow
{
return capacity - length;
}
/**
* Appends data to the buffer.
*
* Params:
* buffer = Buffer chunk got with $(D_PSYMBOL buffer).
*/
WriteBuffer opOpAssign(string op)(ubyte[] buffer)
if (op == "~")
{
size_t end, start;
if (position >= this.start && position <= ring)
{
auto afterRing = ring + 1;
end = position + buffer.length;
if (end > afterRing)
{
end = afterRing;
}
start = end - position;
buffer_[position..end] = buffer[0..start];
if (end == afterRing)
{
position = this.start == 0 ? afterRing : 0;
}
else
{
position = end;
}
}
// Check if we have some free space at the beginning
if (start < buffer.length && position < this.start)
{
end = position + buffer.length - start;
if (end > this.start)
{
end = this.start;
}
auto areaEnd = end - position + start;
buffer_[position..end] = buffer[start..areaEnd];
position = end == this.start ? ring + 1 : end - position;
start = areaEnd;
}
// And if we still haven't found any place, save the rest in the overflow area
if (start < buffer.length)
{
end = position + buffer.length - start;
if (end > capacity)
{
auto newSize = end / blockSize * blockSize + blockSize;
defaultAllocator.resizeArray!ubyte(buffer_, newSize);
}
buffer_[position..end] = buffer[start..$];
position = end;
if (this.start == 0)
{
ring = capacity - 1;
}
}
return this;
}
///
unittest
{
auto b = defaultAllocator.make!WriteBuffer(4);
ubyte[3] buf = [48, 23, 255];
b ~= buf;
assert(b.capacity == 4);
assert(b.buffer_[0] == 48 && b.buffer_[1] == 23 && b.buffer_[2] == 255);
b += 2;
b ~= buf;
assert(b.capacity == 4);
assert(b.buffer_[0] == 23 && b.buffer_[1] == 255
&& b.buffer_[2] == 255 && b.buffer_[3] == 48);
b += 2;
b ~= buf;
assert(b.capacity == 8);
assert(b.buffer_[0] == 23 && b.buffer_[1] == 255
&& b.buffer_[2] == 48 && b.buffer_[3] == 23 && b.buffer_[4] == 255);
defaultAllocator.dispose(b);
b = make!WriteBuffer(defaultAllocator, 2);
b ~= buf;
assert(b.start == 0);
assert(b.capacity == 4);
assert(b.ring == 3);
assert(b.position == 3);
defaultAllocator.dispose(b);
}
/**
* Sets how many bytes were written. It will shrink the buffer
* appropriately. Always set this property after calling
* $(D_PSYMBOL buffer).
*
* Params:
* length = Length of the written data.
*
* Returns: $(D_KEYWORD this).
*/
@property WriteBuffer opOpAssign(string op)(size_t length) pure nothrow @safe @nogc
if (op == "+")
in
{
assert(length <= this.length);
}
do
{
auto afterRing = ring + 1;
auto oldStart = start;
if (length <= 0)
{
return this;
}
else if (position <= afterRing)
{
start += length;
if (start > 0 && position == afterRing)
{
position = oldStart;
}
}
else
{
auto overflow = position - afterRing;
if (overflow > length) {
buffer_[start.. start + length] = buffer_[afterRing.. afterRing + length];
buffer_[afterRing.. afterRing + length] = buffer_[afterRing + length ..position];
position -= length;
}
else if (overflow == length)
{
buffer_[start.. start + overflow] = buffer_[afterRing..position];
position -= overflow;
}
else
{
buffer_[start.. start + overflow] = buffer_[afterRing..position];
position = overflow;
}
start += length;
if (start == position)
{
if (position != afterRing)
{
position = 0;
}
start = 0;
ring = capacity - 1;
}
}
if (start > ring)
{
start = 0;
}
return this;
}
///
unittest
{
auto b = defaultAllocator.make!WriteBuffer;
ubyte[6] buf = [23, 23, 255, 128, 127, 9];
b ~= buf;
assert(b.length == 6);
b += 2;
assert(b.length == 4);
b += 4;
assert(b.length == 0);
defaultAllocator.dispose(b);
}
/**
* Returns a chunk with data.
*
* After calling it, set $(D_KEYWORD +=) to the length could be
* written.
*
* $(D_PSYMBOL buffer) may return only part of the data. You may need
* to call it (and set $(D_KEYWORD +=) several times until
* $(D_PSYMBOL length) is 0). If all the data can be written,
* maximally 3 calls are required.
*
* Returns: A chunk of data buffer.
*/
@property ubyte[] opSlice(size_t start, size_t end) pure nothrow @safe @nogc
{
immutable internStart = this.start + start;
if (position > ring || position < start) // Buffer overflowed
{
return buffer_[this.start.. ring + 1 - length + end];
}
else
{
return buffer_[this.start.. this.start + end];
}
}
///
unittest
{
auto b = defaultAllocator.make!WriteBuffer(6);
ubyte[6] buf = [23, 23, 255, 128, 127, 9];
b ~= buf;
assert(b[0..$] == buf[0..6]);
b += 2;
assert(b[0..$] == buf[2..6]);
b ~= buf;
assert(b[0..$] == buf[2..6]);
b += b.length;
assert(b[0..$] == buf[0..6]);
b += b.length;
defaultAllocator.dispose(b);
}
/**
* After calling it, set $(D_KEYWORD +=) to the length could be
* written.
*
* $(D_PSYMBOL buffer) may return only part of the data. You may need
* to call it (and set $(D_KEYWORD +=) several times until
* $(D_PSYMBOL length) is 0). If all the data can be written,
* maximally 3 calls are required.
*
* Returns: A chunk of data buffer.
*/
@property ubyte[] opIndex() pure nothrow @safe @nogc
{
return opSlice(0, length);
}
}
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/enum9921.d(9): Error: enum `enum9921.X` base type must not be `void`
fail_compilation/enum9921.d(11): Error: enum `enum9921.Z` base type must not be `void`
---
*/
enum X : void;
enum Z : void { Y };
|
D
|
/**
* Forms the symbols available to all D programs. Includes Object, which is
* the root of the class object hierarchy. This module is implicitly
* imported.
* Macros:
* WIKI = Object
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Walter Bright, Sean Kelly
*/
/* Copyright Digital Mars 2000 - 2011.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module object;
//debug=PRINTF;
private
{
import core.atomic;
import core.stdc.string;
import core.stdc.stdlib;
import rt.util.hash;
import rt.util.string;
import rt.util.console;
debug(PRINTF) import core.stdc.stdio;
extern (C) void onOutOfMemoryError();
extern (C) Object _d_newclass(TypeInfo_Class ci);
extern (C) void _d_arrayshrinkfit(TypeInfo ti, void[] arr);
extern (C) size_t _d_arraysetcapacity(TypeInfo ti, size_t newcapacity, void *arrptr);
extern (C) void rt_finalize(void *data, bool det=true);
}
// NOTE: For some reason, this declaration method doesn't work
// in this particular file (and this file only). It must
// be a DMD thing.
//alias typeof(int.sizeof) size_t;
//alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t;
version(D_LP64)
{
alias ulong size_t;
alias long ptrdiff_t;
alias long sizediff_t;
}
else
{
alias uint size_t;
alias int ptrdiff_t;
alias int sizediff_t;
}
alias size_t hash_t;
alias bool equals_t;
alias immutable(char)[] string;
alias immutable(wchar)[] wstring;
alias immutable(dchar)[] dstring;
/**
* All D class objects inherit from Object.
*/
class Object
{
/**
* Convert Object to a human readable string.
*/
string toString()
{
return this.classinfo.name;
}
/**
* Compute hash function for Object.
*/
hash_t toHash()
{
// BUG: this prevents a compacting GC from working, needs to be fixed
return cast(hash_t)cast(void*)this;
}
/**
* Compare with another Object obj.
* Returns:
* $(TABLE
* $(TR $(TD this < obj) $(TD < 0))
* $(TR $(TD this == obj) $(TD 0))
* $(TR $(TD this > obj) $(TD > 0))
* )
*/
int opCmp(Object o)
{
// BUG: this prevents a compacting GC from working, needs to be fixed
//return cast(int)cast(void*)this - cast(int)cast(void*)o;
throw new Exception("need opCmp for class " ~ this.classinfo.name);
//return this !is o;
}
/**
* Returns !=0 if this object does have the same contents as obj.
*/
equals_t opEquals(Object o)
{
return this is o;
}
equals_t opEquals(Object lhs, Object rhs)
{
if (lhs is rhs)
return true;
if (lhs is null || rhs is null)
return false;
if (typeid(lhs) == typeid(rhs))
return lhs.opEquals(rhs);
return lhs.opEquals(rhs) &&
rhs.opEquals(lhs);
}
interface Monitor
{
void lock();
void unlock();
}
/**
* Create instance of class specified by classname.
* The class must either have no constructors or have
* a default constructor.
* Returns:
* null if failed
*/
static Object factory(string classname)
{
auto ci = TypeInfo_Class.find(classname);
if (ci)
{
return ci.create();
}
return null;
}
}
/************************
* Returns true if lhs and rhs are equal.
*/
bool opEquals(Object lhs, Object rhs)
{
// If aliased to the same object or both null => equal
if (lhs is rhs) return true;
// If either is null => non-equal
if (lhs is null || rhs is null) return false;
// If same exact type => one call to method opEquals
if (typeid(lhs) is typeid(rhs) || typeid(lhs).opEquals(typeid(rhs)))
return lhs.opEquals(rhs);
// General case => symmetric calls to method opEquals
return lhs.opEquals(rhs) && rhs.opEquals(lhs);
}
bool opEquals(TypeInfo lhs, TypeInfo rhs)
{
// If aliased to the same object or both null => equal
if (lhs is rhs) return true;
// If either is null => non-equal
if (lhs is null || rhs is null) return false;
// If same exact type => one call to method opEquals
if (typeid(lhs) == typeid(rhs)) return lhs.opEquals(rhs);
//printf("%.*s and %.*s, %d %d\n", lhs.toString(), rhs.toString(), lhs.opEquals(rhs), rhs.opEquals(lhs));
// Factor out top level const
// (This still isn't right, should follow same rules as compiler does for type equality.)
TypeInfo_Const c = cast(TypeInfo_Const) lhs;
if (c)
lhs = c.base;
c = cast(TypeInfo_Const) rhs;
if (c)
rhs = c.base;
// General case => symmetric calls to method opEquals
return lhs.opEquals(rhs) && rhs.opEquals(lhs);
}
/**
* Information about an interface.
* When an object is accessed via an interface, an Interface* appears as the
* first entry in its vtbl.
*/
struct Interface
{
TypeInfo_Class classinfo; /// .classinfo for this interface (not for containing class)
void*[] vtbl;
ptrdiff_t offset; /// offset to Interface 'this' from Object 'this'
}
/**
* Runtime type information about a class. Can be retrieved for any class type
* or instance by using the .classinfo property.
* A pointer to this appears as the first entry in the class's vtbl[].
*/
alias TypeInfo_Class Classinfo;
/**
* Array of pairs giving the offset and type information for each
* member in an aggregate.
*/
struct OffsetTypeInfo
{
size_t offset; /// Offset of member from start of object
TypeInfo ti; /// TypeInfo for this member
}
/**
* Runtime type information about a type.
* Can be retrieved for any type using a
* <a href="../expression.html#typeidexpression">TypeidExpression</a>.
*/
class TypeInfo
{
override hash_t toHash()
{
auto data = this.toString();
return hashOf(data.ptr, data.length);
}
override int opCmp(Object o)
{
if (this is o)
return 0;
TypeInfo ti = cast(TypeInfo)o;
if (ti is null)
return 1;
return dstrcmp(this.toString(), ti.toString());
}
override equals_t opEquals(Object o)
{
/* TypeInfo instances are singletons, but duplicates can exist
* across DLL's. Therefore, comparing for a name match is
* sufficient.
*/
if (this is o)
return true;
TypeInfo ti = cast(TypeInfo)o;
return ti && this.toString() == ti.toString();
}
/// Returns a hash of the instance of a type.
hash_t getHash(in void* p) { return cast(hash_t)p; }
/// Compares two instances for equality.
equals_t equals(in void* p1, in void* p2) { return p1 == p2; }
/// Compares two instances for <, ==, or >.
int compare(in void* p1, in void* p2) { return 0; }
/// Returns size of the type.
@property size_t tsize() nothrow pure { return 0; }
/// Swaps two instances of the type.
void swap(void* p1, void* p2)
{
size_t n = tsize;
for (size_t i = 0; i < n; i++)
{
byte t = (cast(byte *)p1)[i];
(cast(byte*)p1)[i] = (cast(byte*)p2)[i];
(cast(byte*)p2)[i] = t;
}
}
/// Get TypeInfo for 'next' type, as defined by what kind of type this is,
/// null if none.
@property TypeInfo next() nothrow pure { return null; }
/// Return default initializer. If the type should be initialized to all zeros,
/// an array with a null ptr and a length equal to the type size will be returned.
// TODO: make this a property, but may need to be renamed to diambiguate with T.init...
void[] init() nothrow pure { return null; }
/// Get flags for type: 1 means GC should scan for pointers
@property uint flags() nothrow pure { return 0; }
/// Get type information on the contents of the type; null if not available
OffsetTypeInfo[] offTi() { return null; }
/// Run the destructor on the object and all its sub-objects
void destroy(void* p) {}
/// Run the postblit on the object and all its sub-objects
void postblit(void* p) {}
/// Return alignment of type
@property size_t talign() nothrow pure { return tsize; }
/** Return internal info on arguments fitting into 8byte.
* See X86-64 ABI 3.2.3
*/
version (X86_64) int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ arg1 = this;
return 0;
}
}
class TypeInfo_Typedef : TypeInfo
{
override string toString() { return name; }
override equals_t opEquals(Object o)
{
TypeInfo_Typedef c;
return this is o ||
((c = cast(TypeInfo_Typedef)o) !is null &&
this.name == c.name &&
this.base == c.base);
}
override hash_t getHash(in void* p) { return base.getHash(p); }
override equals_t equals(in void* p1, in void* p2) { return base.equals(p1, p2); }
override int compare(in void* p1, in void* p2) { return base.compare(p1, p2); }
@property override size_t tsize() nothrow pure { return base.tsize; }
override void swap(void* p1, void* p2) { return base.swap(p1, p2); }
@property override TypeInfo next() nothrow pure { return base.next; }
@property override uint flags() nothrow pure { return base.flags; }
override void[] init() nothrow pure { return m_init.length ? m_init : base.init(); }
@property override size_t talign() nothrow pure { return base.talign; }
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ return base.argTypes(arg1, arg2);
}
TypeInfo base;
string name;
void[] m_init;
}
class TypeInfo_Enum : TypeInfo_Typedef
{
}
class TypeInfo_Pointer : TypeInfo
{
override string toString() { return m_next.toString() ~ "*"; }
override equals_t opEquals(Object o)
{
TypeInfo_Pointer c;
return this is o ||
((c = cast(TypeInfo_Pointer)o) !is null &&
this.m_next == c.m_next);
}
override hash_t getHash(in void* p)
{
return cast(hash_t)*cast(void**)p;
}
override equals_t equals(in void* p1, in void* p2)
{
return *cast(void**)p1 == *cast(void**)p2;
}
override int compare(in void* p1, in void* p2)
{
if (*cast(void**)p1 < *cast(void**)p2)
return -1;
else if (*cast(void**)p1 > *cast(void**)p2)
return 1;
else
return 0;
}
@property override size_t tsize() nothrow pure
{
return (void*).sizeof;
}
override void swap(void* p1, void* p2)
{
void* tmp = *cast(void**)p1;
*cast(void**)p1 = *cast(void**)p2;
*cast(void**)p2 = tmp;
}
@property override TypeInfo next() nothrow pure { return m_next; }
@property override uint flags() nothrow pure { return 1; }
TypeInfo m_next;
}
class TypeInfo_Array : TypeInfo
{
override string toString() { return value.toString() ~ "[]"; }
override equals_t opEquals(Object o)
{
TypeInfo_Array c;
return this is o ||
((c = cast(TypeInfo_Array)o) !is null &&
this.value == c.value);
}
override hash_t getHash(in void* p)
{
void[] a = *cast(void[]*)p;
return hashOf(a.ptr, a.length);
}
override equals_t equals(in void* p1, in void* p2)
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
if (a1.length != a2.length)
return false;
size_t sz = value.tsize;
for (size_t i = 0; i < a1.length; i++)
{
if (!value.equals(a1.ptr + i * sz, a2.ptr + i * sz))
return false;
}
return true;
}
override int compare(in void* p1, in void* p2)
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
size_t sz = value.tsize;
size_t len = a1.length;
if (a2.length < len)
len = a2.length;
for (size_t u = 0; u < len; u++)
{
int result = value.compare(a1.ptr + u * sz, a2.ptr + u * sz);
if (result)
return result;
}
return cast(int)a1.length - cast(int)a2.length;
}
@property override size_t tsize() nothrow pure
{
return (void[]).sizeof;
}
override void swap(void* p1, void* p2)
{
void[] tmp = *cast(void[]*)p1;
*cast(void[]*)p1 = *cast(void[]*)p2;
*cast(void[]*)p2 = tmp;
}
TypeInfo value;
@property override TypeInfo next() nothrow pure
{
return value;
}
@property override uint flags() nothrow pure { return 1; }
@property override size_t talign() nothrow pure
{
return (void[]).alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ //arg1 = typeid(size_t);
//arg2 = typeid(void*);
return 0;
}
}
class TypeInfo_StaticArray : TypeInfo
{
override string toString()
{
char[20] tmp = void;
return cast(string)(value.toString() ~ "[" ~ tmp.intToString(len) ~ "]");
}
override equals_t opEquals(Object o)
{
TypeInfo_StaticArray c;
return this is o ||
((c = cast(TypeInfo_StaticArray)o) !is null &&
this.len == c.len &&
this.value == c.value);
}
override hash_t getHash(in void* p)
{
size_t sz = value.tsize;
hash_t hash = 0;
for (size_t i = 0; i < len; i++)
hash += value.getHash(p + i * sz);
return hash;
}
override equals_t equals(in void* p1, in void* p2)
{
size_t sz = value.tsize;
for (size_t u = 0; u < len; u++)
{
if (!value.equals(p1 + u * sz, p2 + u * sz))
return false;
}
return true;
}
override int compare(in void* p1, in void* p2)
{
size_t sz = value.tsize;
for (size_t u = 0; u < len; u++)
{
int result = value.compare(p1 + u * sz, p2 + u * sz);
if (result)
return result;
}
return 0;
}
@property override size_t tsize() nothrow pure
{
return len * value.tsize;
}
override void swap(void* p1, void* p2)
{
void* tmp;
size_t sz = value.tsize;
ubyte[16] buffer;
void* pbuffer;
if (sz < buffer.sizeof)
tmp = buffer.ptr;
else
tmp = pbuffer = (new void[sz]).ptr;
for (size_t u = 0; u < len; u += sz)
{ size_t o = u * sz;
memcpy(tmp, p1 + o, sz);
memcpy(p1 + o, p2 + o, sz);
memcpy(p2 + o, tmp, sz);
}
if (pbuffer)
delete pbuffer;
}
override void[] init() nothrow pure { return value.init(); }
@property override TypeInfo next() nothrow pure { return value; }
@property override uint flags() nothrow pure { return value.flags(); }
override void destroy(void* p)
{
auto sz = value.tsize;
p += sz * len;
foreach (i; 0 .. len)
{
p -= sz;
value.destroy(p);
}
}
override void postblit(void* p)
{
auto sz = value.tsize;
foreach (i; 0 .. len)
{
value.postblit(p);
p += sz;
}
}
TypeInfo value;
size_t len;
@property override size_t talign() nothrow pure
{
return value.talign;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ arg1 = typeid(void*);
return 0;
}
}
class TypeInfo_AssociativeArray : TypeInfo
{
override string toString()
{
return cast(string)(next.toString() ~ "[" ~ key.toString() ~ "]");
}
override equals_t opEquals(Object o)
{
TypeInfo_AssociativeArray c;
return this is o ||
((c = cast(TypeInfo_AssociativeArray)o) !is null &&
this.key == c.key &&
this.value == c.value);
}
// BUG: need to add the rest of the functions
@property override size_t tsize() nothrow pure
{
return (char[int]).sizeof;
}
@property override TypeInfo next() nothrow pure { return value; }
@property override uint flags() nothrow pure { return 1; }
TypeInfo value;
TypeInfo key;
TypeInfo impl;
@property override size_t talign() nothrow pure
{
return (char[int]).alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ arg1 = typeid(void*);
return 0;
}
}
class TypeInfo_Function : TypeInfo
{
override string toString()
{
return cast(string)(next.toString() ~ "()");
}
override equals_t opEquals(Object o)
{
TypeInfo_Function c;
return this is o ||
((c = cast(TypeInfo_Function)o) !is null &&
this.deco == c.deco);
}
// BUG: need to add the rest of the functions
@property override size_t tsize() nothrow pure
{
return 0; // no size for functions
}
TypeInfo next;
string deco;
}
class TypeInfo_Delegate : TypeInfo
{
override string toString()
{
return cast(string)(next.toString() ~ " delegate()");
}
override equals_t opEquals(Object o)
{
TypeInfo_Delegate c;
return this is o ||
((c = cast(TypeInfo_Delegate)o) !is null &&
this.deco == c.deco);
}
// BUG: need to add the rest of the functions
@property override size_t tsize() nothrow pure
{
alias int delegate() dg;
return dg.sizeof;
}
@property override uint flags() nothrow pure { return 1; }
TypeInfo next;
string deco;
@property override size_t talign() nothrow pure
{ alias int delegate() dg;
return dg.alignof;
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ //arg1 = typeid(void*);
//arg2 = typeid(void*);
return 0;
}
}
/**
* Runtime type information about a class.
* Can be retrieved from an object instance by using the
* $(LINK2 ../property.html#classinfo, .classinfo) property.
*/
class TypeInfo_Class : TypeInfo
{
override string toString() { return info.name; }
override equals_t opEquals(Object o)
{
TypeInfo_Class c;
return this is o ||
((c = cast(TypeInfo_Class)o) !is null &&
this.info.name == c.info.name);
}
override hash_t getHash(in void* p)
{
Object o = *cast(Object*)p;
return o ? o.toHash() : 0;
}
override equals_t equals(in void* p1, in void* p2)
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
return (o1 is o2) || (o1 && o1.opEquals(o2));
}
override int compare(in void* p1, in void* p2)
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
int c = 0;
// Regard null references as always being "less than"
if (o1 !is o2)
{
if (o1)
{
if (!o2)
c = 1;
else
c = o1.opCmp(o2);
}
else
c = -1;
}
return c;
}
@property override size_t tsize() nothrow pure
{
return Object.sizeof;
}
@property override uint flags() nothrow pure { return 1; }
@property override OffsetTypeInfo[] offTi() nothrow pure
{
return m_offTi;
}
@property TypeInfo_Class info() nothrow pure { return this; }
@property TypeInfo typeinfo() nothrow pure { return this; }
byte[] init; /** class static initializer
* (init.length gives size in bytes of class)
*/
string name; /// class name
void*[] vtbl; /// virtual function pointer table
Interface[] interfaces; /// interfaces this class implements
TypeInfo_Class base; /// base class
void* destructor;
void function(Object) classInvariant;
uint m_flags;
// 1: // is IUnknown or is derived from IUnknown
// 2: // has no possible pointers into GC memory
// 4: // has offTi[] member
// 8: // has constructors
// 16: // has xgetMembers member
// 32: // has typeinfo member
// 64: // is not constructable
void* deallocator;
OffsetTypeInfo[] m_offTi;
void function(Object) defaultConstructor; // default Constructor
const(MemberInfo[]) function(in char[]) xgetMembers;
/**
* Search all modules for TypeInfo_Class corresponding to classname.
* Returns: null if not found
*/
static TypeInfo_Class find(in char[] classname)
{
foreach (m; ModuleInfo)
{
if (m)
//writefln("module %s, %d", m.name, m.localClasses.length);
foreach (c; m.localClasses)
{
//writefln("\tclass %s", c.name);
if (c.name == classname)
return c;
}
}
return null;
}
/**
* Create instance of Object represented by 'this'.
*/
Object create()
{
if (m_flags & 8 && !defaultConstructor)
return null;
if (m_flags & 64) // abstract
return null;
Object o = _d_newclass(this);
if (m_flags & 8 && defaultConstructor)
{
defaultConstructor(o);
}
return o;
}
/**
* Search for all members with the name 'name'.
* If name[] is null, return all members.
*/
const(MemberInfo[]) getMembers(in char[] name)
{
if (m_flags & 16 && xgetMembers)
return xgetMembers(name);
return null;
}
}
alias TypeInfo_Class ClassInfo;
class TypeInfo_Interface : TypeInfo
{
override string toString() { return info.name; }
override equals_t opEquals(Object o)
{
TypeInfo_Interface c;
return this is o ||
((c = cast(TypeInfo_Interface)o) !is null &&
this.info.name == c.classinfo.name);
}
override hash_t getHash(in void* p)
{
Interface* pi = **cast(Interface ***)*cast(void**)p;
Object o = cast(Object)(*cast(void**)p - pi.offset);
assert(o);
return o.toHash();
}
override equals_t equals(in void* p1, in void* p2)
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
pi = **cast(Interface ***)*cast(void**)p2;
Object o2 = cast(Object)(*cast(void**)p2 - pi.offset);
return o1 == o2 || (o1 && o1.opCmp(o2) == 0);
}
override int compare(in void* p1, in void* p2)
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
pi = **cast(Interface ***)*cast(void**)p2;
Object o2 = cast(Object)(*cast(void**)p2 - pi.offset);
int c = 0;
// Regard null references as always being "less than"
if (o1 != o2)
{
if (o1)
{
if (!o2)
c = 1;
else
c = o1.opCmp(o2);
}
else
c = -1;
}
return c;
}
@property override size_t tsize() nothrow pure
{
return Object.sizeof;
}
@property override uint flags() nothrow pure { return 1; }
TypeInfo_Class info;
}
class TypeInfo_Struct : TypeInfo
{
override string toString() { return name; }
override equals_t opEquals(Object o)
{
TypeInfo_Struct s;
return this is o ||
((s = cast(TypeInfo_Struct)o) !is null &&
this.name == s.name &&
this.init().length == s.init().length);
}
override hash_t getHash(in void* p)
{
assert(p);
if (xtoHash)
{
debug(PRINTF) printf("getHash() using xtoHash\n");
return (*xtoHash)(p);
}
else
{
debug(PRINTF) printf("getHash() using default hash\n");
return hashOf(p, init().length);
}
}
override equals_t equals(in void* p1, in void* p2)
{
if (!p1 || !p2)
return false;
else if (xopEquals)
return (*xopEquals)(p1, p2);
else if (p1 == p2)
return true;
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, init().length) == 0;
}
override int compare(in void* p1, in void* p2)
{
// Regard null references as always being "less than"
if (p1 != p2)
{
if (p1)
{
if (!p2)
return true;
else if (xopCmp)
return (*xopCmp)(p2, p1);
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, init().length);
}
else
return -1;
}
return 0;
}
@property override size_t tsize() nothrow pure
{
return init().length;
}
override void[] init() nothrow pure { return m_init; }
@property override uint flags() nothrow pure { return m_flags; }
@property override size_t talign() nothrow pure { return m_align; }
override void destroy(void* p)
{
if (xdtor)
(*xdtor)(p);
}
override void postblit(void* p)
{
if (xpostblit)
(*xpostblit)(p);
}
string name;
void[] m_init; // initializer; init.ptr == null if 0 initialize
hash_t function(in void*) xtoHash;
equals_t function(in void*, in void*) xopEquals;
int function(in void*, in void*) xopCmp;
char[] function(in void*) xtoString;
uint m_flags;
const(MemberInfo[]) function(in char[]) xgetMembers;
void function(void*) xdtor;
void function(void*) xpostblit;
uint m_align;
version (X86_64)
{
override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ arg1 = m_arg1;
arg2 = m_arg2;
return 0;
}
TypeInfo m_arg1;
TypeInfo m_arg2;
}
}
unittest
{
struct S
{
const bool opEquals(ref const S rhs)
{
return false;
}
}
S s;
assert(!typeid(S).equals(&s, &s));
}
class TypeInfo_Tuple : TypeInfo
{
TypeInfo[] elements;
override string toString()
{
string s = "(";
foreach (i, element; elements)
{
if (i)
s ~= ',';
s ~= element.toString();
}
s ~= ")";
return s;
}
override equals_t opEquals(Object o)
{
if (this is o)
return true;
auto t = cast(TypeInfo_Tuple)o;
if (t && elements.length == t.elements.length)
{
for (size_t i = 0; i < elements.length; i++)
{
if (elements[i] != t.elements[i])
return false;
}
return true;
}
return false;
}
override hash_t getHash(in void* p)
{
assert(0);
}
override equals_t equals(in void* p1, in void* p2)
{
assert(0);
}
override int compare(in void* p1, in void* p2)
{
assert(0);
}
@property override size_t tsize() nothrow pure
{
assert(0);
}
override void swap(void* p1, void* p2)
{
assert(0);
}
override void destroy(void* p)
{
assert(0);
}
override void postblit(void* p)
{
assert(0);
}
@property override size_t talign() nothrow pure
{
assert(0);
}
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{
assert(0);
}
}
class TypeInfo_Const : TypeInfo
{
override string toString()
{
return cast(string) ("const(" ~ base.toString() ~ ")");
}
//override equals_t opEquals(Object o) { return base.opEquals(o); }
override equals_t opEquals(Object o)
{
if (this is o)
return true;
if (typeid(this) != typeid(o))
return false;
auto t = cast(TypeInfo_Const)o;
if (base.opEquals(t.base))
{
return true;
}
return false;
}
override hash_t getHash(in void *p) { return base.getHash(p); }
override equals_t equals(in void *p1, in void *p2) { return base.equals(p1, p2); }
override int compare(in void *p1, in void *p2) { return base.compare(p1, p2); }
@property override size_t tsize() nothrow pure { return base.tsize; }
override void swap(void *p1, void *p2) { return base.swap(p1, p2); }
@property override TypeInfo next() nothrow pure { return base.next; }
@property override uint flags() nothrow pure { return base.flags; }
override void[] init() nothrow pure { return base.init(); }
@property override size_t talign() nothrow pure { return base.talign(); }
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2)
{ return base.argTypes(arg1, arg2);
}
TypeInfo base;
}
class TypeInfo_Invariant : TypeInfo_Const
{
override string toString()
{
return cast(string) ("immutable(" ~ base.toString() ~ ")");
}
}
class TypeInfo_Shared : TypeInfo_Const
{
override string toString()
{
return cast(string) ("shared(" ~ base.toString() ~ ")");
}
}
class TypeInfo_Inout : TypeInfo_Const
{
override string toString()
{
return cast(string) ("inout(" ~ base.toString() ~ ")");
}
}
abstract class MemberInfo
{
@property string name() nothrow pure;
}
class MemberInfo_field : MemberInfo
{
this(string name, TypeInfo ti, size_t offset)
{
m_name = name;
m_typeinfo = ti;
m_offset = offset;
}
@property override string name() nothrow pure { return m_name; }
@property TypeInfo typeInfo() nothrow pure { return m_typeinfo; }
@property size_t offset() nothrow pure { return m_offset; }
string m_name;
TypeInfo m_typeinfo;
size_t m_offset;
}
class MemberInfo_function : MemberInfo
{
this(string name, TypeInfo ti, void* fp, uint flags)
{
m_name = name;
m_typeinfo = ti;
m_fp = fp;
m_flags = flags;
}
@property override string name() nothrow pure { return m_name; }
@property TypeInfo typeInfo() nothrow pure { return m_typeinfo; }
@property void* fp() nothrow pure { return m_fp; }
@property uint flags() nothrow pure { return m_flags; }
string m_name;
TypeInfo m_typeinfo;
void* m_fp;
uint m_flags;
}
///////////////////////////////////////////////////////////////////////////////
// Throwable
///////////////////////////////////////////////////////////////////////////////
class Throwable : Object
{
interface TraceInfo
{
int opApply(scope int delegate(ref char[]));
int opApply(scope int delegate(ref size_t, ref char[]));
string toString();
}
string msg;
string file;
size_t line;
TraceInfo info;
Throwable next;
this(string msg, Throwable next = null)
{
this.msg = msg;
this.next = next;
//this.info = _d_traceContext();
}
this(string msg, string file, size_t line, Throwable next = null)
{
this(msg, next);
this.file = file;
this.line = line;
//this.info = _d_traceContext();
}
override string toString()
{
char[20] tmp = void;
char[] buf;
if (file)
{
buf ~= this.classinfo.name ~ "@" ~ file ~ "(" ~ tmp.intToString(line) ~ ")";
}
else
{
buf ~= this.classinfo.name;
}
if (msg)
{
buf ~= ": " ~ msg;
}
if (info)
{
buf ~= "\n----------------";
foreach (t; info)
buf ~= "\n" ~ t;
}
return cast(string) buf;
}
}
alias Throwable.TraceInfo function(void* ptr) TraceHandler;
private __gshared TraceHandler traceHandler = null;
/**
* Overrides the default trace hander with a user-supplied version.
*
* Params:
* h = The new trace handler. Set to null to use the default handler.
*/
extern (C) void rt_setTraceHandler(TraceHandler h)
{
traceHandler = h;
}
/**
* Return the current trace handler
*/
extern (C) TraceHandler rt_getTraceHandler()
{
return traceHandler;
}
/**
* This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,
* otherwise no trace will be generated.
*
* Params:
* ptr = A pointer to the location from which to generate the trace, or null
* if the trace should be generated from within the trace handler
* itself.
*
* Returns:
* An object describing the current calling context or null if no handler is
* supplied.
*/
extern (C) Throwable.TraceInfo _d_traceContext(void* ptr = null)
{
if (traceHandler is null)
return null;
return traceHandler(ptr);
}
class Exception : Throwable
{
this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
super(msg, file, line, next);
}
this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__)
{
super(msg, file, line, next);
}
}
unittest
{
{
auto e = new Exception("msg");
assert(e.file == __FILE__);
assert(e.line == __LINE__ - 2);
assert(e.next is null);
assert(e.msg == "msg");
}
{
auto e = new Exception("msg", new Exception("It's an Excepton!"), "hello", 42);
assert(e.file == "hello");
assert(e.line == 42);
assert(e.next !is null);
assert(e.msg == "msg");
}
{
auto e = new Exception("msg", "hello", 42, new Exception("It's an Exception!"));
assert(e.file == "hello");
assert(e.line == 42);
assert(e.next !is null);
assert(e.msg == "msg");
}
}
class Error : Throwable
{
this(string msg, Throwable next = null)
{
super(msg, next);
bypassedException = null;
}
this(string msg, string file, size_t line, Throwable next = null)
{
super(msg, file, line, next);
bypassedException = null;
}
/// The first Exception which was bypassed when this Error was thrown,
/// or null if no Exceptions were pending.
Throwable bypassedException;
}
unittest
{
{
auto e = new Error("msg");
assert(e.file is null);
assert(e.line == 0);
assert(e.next is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
{
auto e = new Error("msg", new Exception("It's an Excepton!"));
assert(e.file is null);
assert(e.line == 0);
assert(e.next !is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
{
auto e = new Error("msg", "hello", 42, new Exception("It's an Exception!"));
assert(e.file == "hello");
assert(e.line == 42);
assert(e.next !is null);
assert(e.msg == "msg");
assert(e.bypassedException is null);
}
}
///////////////////////////////////////////////////////////////////////////////
// ModuleInfo
///////////////////////////////////////////////////////////////////////////////
enum
{
MIctorstart = 1, // we've started constructing it
MIctordone = 2, // finished construction
MIstandalone = 4, // module ctor does not depend on other module
// ctors being done first
MItlsctor = 8,
MItlsdtor = 0x10,
MIctor = 0x20,
MIdtor = 0x40,
MIxgetMembers = 0x80,
MIictor = 0x100,
MIunitTest = 0x200,
MIimportedModules = 0x400,
MIlocalClasses = 0x800,
MInew = 0x80000000 // it's the "new" layout
}
struct ModuleInfo
{
struct New
{
uint flags;
uint index; // index into _moduleinfo_array[]
/* Order of appearance, depending on flags
* tlsctor
* tlsdtor
* xgetMembers
* ctor
* dtor
* ictor
* importedModules
* localClasses
* name
*/
}
struct Old
{
string name;
ModuleInfo*[] importedModules;
TypeInfo_Class[] localClasses;
uint flags;
void function() ctor; // module shared static constructor (order dependent)
void function() dtor; // module shared static destructor
void function() unitTest; // module unit tests
void* xgetMembers; // module getMembers() function
void function() ictor; // module shared static constructor (order independent)
void function() tlsctor; // module thread local static constructor (order dependent)
void function() tlsdtor; // module thread local static destructor
uint index; // index into _moduleinfo_array[]
void*[1] reserved; // for future expansion
}
union
{
New n;
Old o;
}
@property bool isNew() nothrow pure { return (n.flags & MInew) != 0; }
@property uint index() nothrow pure { return isNew ? n.index : o.index; }
@property void index(uint i) nothrow pure { if (isNew) n.index = i; else o.index = i; }
@property uint flags() nothrow pure { return isNew ? n.flags : o.flags; }
@property void flags(uint f) nothrow pure { if (isNew) n.flags = f; else o.flags = f; }
@property void function() tlsctor() nothrow pure
{
if (isNew)
{
if (n.flags & MItlsctor)
{
size_t off = New.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
else
return o.tlsctor;
}
@property void function() tlsdtor() nothrow pure
{
if (isNew)
{
if (n.flags & MItlsdtor)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
else
return o.tlsdtor;
}
@property void* xgetMembers() nothrow pure
{
if (isNew)
{
if (n.flags & MIxgetMembers)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
return o.xgetMembers;
}
@property void function() ctor() nothrow pure
{
if (isNew)
{
if (n.flags & MIctor)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
return o.ctor;
}
@property void function() dtor() nothrow pure
{
if (isNew)
{
if (n.flags & MIdtor)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
return o.ctor;
}
@property void function() ictor() nothrow pure
{
if (isNew)
{
if (n.flags & MIictor)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
if (n.flags & MIdtor)
off += o.ctor.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
return o.ictor;
}
@property void function() unitTest() nothrow pure
{
if (isNew)
{
if (n.flags & MIunitTest)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
if (n.flags & MIdtor)
off += o.ctor.sizeof;
if (n.flags & MIictor)
off += o.ictor.sizeof;
return *cast(typeof(return)*)(cast(void*)(&this) + off);
}
return null;
}
return o.unitTest;
}
@property ModuleInfo*[] importedModules() nothrow pure
{
if (isNew)
{
if (n.flags & MIimportedModules)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
if (n.flags & MIdtor)
off += o.ctor.sizeof;
if (n.flags & MIictor)
off += o.ictor.sizeof;
if (n.flags & MIunitTest)
off += o.unitTest.sizeof;
auto plength = cast(size_t*)(cast(void*)(&this) + off);
ModuleInfo** pm = cast(ModuleInfo**)(plength + 1);
return pm[0 .. *plength];
}
return null;
}
return o.importedModules;
}
@property TypeInfo_Class[] localClasses() nothrow pure
{
if (isNew)
{
if (n.flags & MIlocalClasses)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
if (n.flags & MIdtor)
off += o.ctor.sizeof;
if (n.flags & MIictor)
off += o.ictor.sizeof;
if (n.flags & MIunitTest)
off += o.unitTest.sizeof;
if (n.flags & MIimportedModules)
{
auto plength = cast(size_t*)(cast(void*)(&this) + off);
off += size_t.sizeof + *plength * plength.sizeof;
}
auto plength = cast(size_t*)(cast(void*)(&this) + off);
TypeInfo_Class* pt = cast(TypeInfo_Class*)(plength + 1);
return pt[0 .. *plength];
}
return null;
}
return o.localClasses;
}
@property string name() nothrow pure
{
if (isNew)
{
size_t off = New.sizeof;
if (n.flags & MItlsctor)
off += o.tlsctor.sizeof;
if (n.flags & MItlsdtor)
off += o.tlsdtor.sizeof;
if (n.flags & MIxgetMembers)
off += o.xgetMembers.sizeof;
if (n.flags & MIctor)
off += o.ctor.sizeof;
if (n.flags & MIdtor)
off += o.ctor.sizeof;
if (n.flags & MIictor)
off += o.ictor.sizeof;
if (n.flags & MIunitTest)
off += o.unitTest.sizeof;
if (n.flags & MIimportedModules)
{
auto plength = cast(size_t*)(cast(void*)(&this) + off);
off += size_t.sizeof + *plength * plength.sizeof;
}
if (n.flags & MIlocalClasses)
{
auto plength = cast(size_t*)(cast(void*)(&this) + off);
off += size_t.sizeof + *plength * plength.sizeof;
}
auto p = cast(immutable(char)*)(cast(void*)(&this) + off);
auto len = strlen(p);
return p[0 .. len];
}
return o.name;
}
static int opApply(scope int delegate(ref ModuleInfo*) dg)
{
int ret = 0;
foreach (m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m !is null)
{
ret = dg(m);
if (ret)
break;
}
}
return ret;
}
}
// Windows: this gets initialized by minit.asm
// Posix: this gets initialized in _moduleCtor()
extern (C) __gshared ModuleInfo*[] _moduleinfo_array;
version (linux)
{
// This linked list is created by a compiler generated function inserted
// into the .ctor list by the compiler.
struct ModuleReference
{
ModuleReference* next;
ModuleInfo* mod;
}
extern (C) __gshared ModuleReference* _Dmodule_ref; // start of linked list
}
version (FreeBSD)
{
// This linked list is created by a compiler generated function inserted
// into the .ctor list by the compiler.
struct ModuleReference
{
ModuleReference* next;
ModuleInfo* mod;
}
extern (C) __gshared ModuleReference* _Dmodule_ref; // start of linked list
}
version (Solaris)
{
// This linked list is created by a compiler generated function inserted
// into the .ctor list by the compiler.
struct ModuleReference
{
ModuleReference* next;
ModuleInfo* mod;
}
extern (C) __gshared ModuleReference* _Dmodule_ref; // start of linked list
}
version (OSX)
{
extern (C)
{
extern __gshared void* _minfo_beg;
extern __gshared void* _minfo_end;
}
}
__gshared ModuleInfo*[] _moduleinfo_dtors;
__gshared size_t _moduleinfo_dtors_i;
__gshared ModuleInfo*[] _moduleinfo_tlsdtors;
__gshared size_t _moduleinfo_tlsdtors_i;
// Register termination function pointers
extern (C) int _fatexit(void*);
/**
* Initialize the modules.
*/
extern (C) void _moduleCtor()
{
debug(PRINTF) printf("_moduleCtor()\n");
version (OSX)
{
/* The ModuleInfo references are stored in the special segment
* __minfodata, which is bracketed by the segments __minfo_beg
* and __minfo_end. The variables _minfo_beg and _minfo_end
* are of zero size and are in the two bracketing segments,
* respectively.
*/
size_t length = cast(ModuleInfo**)&_minfo_end - cast(ModuleInfo**)&_minfo_beg;
_moduleinfo_array = (cast(ModuleInfo**)&_minfo_beg)[0 .. length];
debug printf("moduleinfo: ptr = %p, length = %d\n", _moduleinfo_array.ptr, _moduleinfo_array.length);
debug foreach (m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m !is null)
//printf("\t%p\n", m);
printf("\t%.*s\n", m.name);
}
}
// all other Posix variants (FreeBSD, Solaris, Linux)
else version (Posix)
{
int len = 0;
ModuleReference *mr;
for (mr = _Dmodule_ref; mr; mr = mr.next)
len++;
_moduleinfo_array = new ModuleInfo*[len];
len = 0;
for (mr = _Dmodule_ref; mr; mr = mr.next)
{ _moduleinfo_array[len] = mr.mod;
len++;
}
}
else version (Windows)
{
// Ensure module destructors also get called on program termination
//_fatexit(&_STD_moduleDtor);
}
//_moduleinfo_dtors = new ModuleInfo*[_moduleinfo_array.length];
//debug(PRINTF) printf("_moduleinfo_dtors = x%x\n", cast(void*)_moduleinfo_dtors);
// this will determine the constructor/destructor order, and check for
// cycles for both shared and TLS ctors
_checkModCtors();
_moduleIndependentCtors();
// now, call the module constructors in the designated order
foreach(i; 0.._moduleinfo_dtors_i)
{
ModuleInfo *mi = _moduleinfo_dtors[i];
if(mi.ctor)
(*mi.ctor)();
}
//_moduleCtor2(_moduleinfo_array, 0);
// NOTE: _moduleTlsCtor is now called manually by dmain2
//_moduleTlsCtor();
}
extern (C) void _moduleIndependentCtors()
{
debug(PRINTF) printf("_moduleIndependentCtors()\n");
foreach (m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m && m.ictor)
{
(*m.ictor)();
}
}
}
/********************************************
* Check for cycles on module constructors, and establish an order for module
* constructors.
*/
extern(C) void _checkModCtors()
{
// Create an array of modules that will determine the order of construction
// (and destruction in reverse).
auto dtors = _moduleinfo_dtors = new ModuleInfo*[_moduleinfo_array.length];
size_t dtoridx = 0;
// this pointer will identify the module where the cycle was detected.
ModuleInfo *cycleModule;
// allocate some stack arrays that will be used throughout the process.
ubyte* p = cast(ubyte *)alloca(_moduleinfo_array.length * ubyte.sizeof);
auto reachable = p[0.._moduleinfo_array.length];
p = cast(ubyte *)alloca(_moduleinfo_array.length * ubyte.sizeof);
auto flags = p[0.._moduleinfo_array.length];
// find all the non-trivial dependencies (that is, dependencies that have a
// ctor or dtor) of a given module. Doing this, we can 'skip over' the
// trivial modules to get at the non-trivial ones.
size_t _findDependencies(ModuleInfo *current, bool orig = true)
{
auto idx = current.index;
if(reachable[idx])
return 0;
size_t result = 0;
reachable[idx] = 1;
if(!orig && (flags[idx] & (MIctor | MIdtor)) && !(flags[idx] & MIstandalone))
// non-trivial, stop here
return result + 1;
foreach(ModuleInfo *m; current.importedModules)
{
result += _findDependencies(m, false);
}
return result;
}
void println(string msg[]...)
{
version(Windows)
immutable ret = "\r\n";
else
immutable ret = "\n";
foreach(m; msg)
{
// write message to stderr
console(m);
}
console(ret);
}
bool printCycle(ModuleInfo *current, ModuleInfo *target, bool orig = true)
{
if(reachable[current.index])
// already visited
return false;
if(current is target)
// found path
return true;
reachable[current.index] = 1;
if(!orig && (flags[current.index] & (MIctor | MIdtor)) && !(flags[current.index] & MIstandalone))
// don't go through modules with ctors/dtors that aren't
// standalone.
return false;
// search connections from current to see if we can get to target
foreach(m; current.importedModules)
{
if(printCycle(m, target, false))
{
// found the path, print this module
if(orig)
println("imported from ", current.name, " containing module ctor/dtor");
else
println(" imported from (", current.name, ")");
return true;
}
}
return false;
}
// This function will determine the order of construction/destruction and
// check for cycles.
bool _checkModCtors2(ModuleInfo *current)
{
// we only get called if current has a dtor or a ctor, so no need to
// check that. First, determine what non-trivial elements are
// reachable.
reachable[] = 0;
auto nmodules = _findDependencies(current);
// allocate the dependencies on the stack
ModuleInfo **p = cast(ModuleInfo **)alloca(nmodules * (ModuleInfo*).sizeof);
auto dependencies = p[0..nmodules];
uint depidx = 0;
// fill in the dependencies
foreach(i, r; reachable)
{
if(r)
{
ModuleInfo *m = _moduleinfo_array[i];
if(m !is current && (flags[i] & (MIctor | MIdtor)) && !(flags[i] & MIstandalone))
{
dependencies[depidx++] = m;
}
}
}
assert(depidx == nmodules);
// ok, now perform cycle detection
auto curidx = current.index;
flags[curidx] |= MIctorstart;
bool valid = true;
foreach(m; dependencies)
{
auto mflags = flags[m.index];
if(mflags & MIctorstart)
{
// found a cycle, but we don't care if the MIstandalone flag is
// set, this is a guarantee that there are no cycles in this
// module (not sure what triggers it)
println("Cyclic dependency in module ", m.name);
cycleModule = m;
valid = false;
// use the currently allocated dtor path to record the loop
// that contains module ctors/dtors only.
dtoridx = dtors.length;
}
else if(!(mflags & MIctordone))
{
valid = _checkModCtors2(m);
}
if(!valid)
{
// cycle detected, now, we must print in reverse order the
// module include cycle. For this, we need to traverse the
// graph of trivial modules again, this time printing them.
reachable[] = 0;
printCycle(current, m);
// record this as a module that was used in the loop.
dtors[--dtoridx] = current;
if(current is cycleModule)
{
// print the cycle
println("Cycle detected between modules with ctors/dtors:");
foreach(cm; dtors[dtoridx..$])
{
console(cm.name)(" -> ");
}
println(cycleModule.name);
throw new Exception("Aborting!");
}
return false;
}
}
flags[curidx] = (flags[curidx] & ~MIctorstart) | MIctordone;
// add this module to the construction order list
dtors[dtoridx++] = current;
return true;
}
void _checkModCtors3()
{
foreach(m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m is null) continue;
auto flag = flags[m.index];
if((flag & (MIctor | MIdtor)) && !(flag & MIctordone))
{
if(flag & MIstandalone)
{
// no need to run a check on this one, but we do need to call its ctor/dtor
dtors[dtoridx++] = m;
}
else
_checkModCtors2(m);
}
}
}
// ok, now we need to assign indexes, and also initialize the flags
foreach(uint i, m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m is null) continue;
m.index = i;
ubyte flag = m.flags & MIstandalone;
if(m.dtor)
flag |= MIdtor;
if(m.ctor)
flag |= MIctor;
flags[i] = flag;
}
// everything's all set up for shared ctors
_checkModCtors3();
// store the number of dtors/ctors
_moduleinfo_dtors_i = dtoridx;
// set up everything for tls ctors
dtors = _moduleinfo_tlsdtors = new ModuleInfo*[_moduleinfo_array.length];
dtoridx = 0;
foreach(i, m; _moduleinfo_array)
{
// TODO: Should null ModuleInfo be allowed?
if (m is null) continue;
ubyte flag = m.flags & MIstandalone;
if(m.tlsdtor)
flag |= MIdtor;
if(m.tlsctor)
flag |= MIctor;
flags[i] = flag;
}
// ok, run it
_checkModCtors3();
// store the number of dtors/ctors
_moduleinfo_tlsdtors_i = dtoridx;
}
/********************************************
* Run static constructors for thread local global data.
*/
extern (C) void _moduleTlsCtor()
{
// call the module constructors in the correct order as determined by the
// check routine.
foreach(i; 0.._moduleinfo_tlsdtors_i)
{
ModuleInfo *mi = _moduleinfo_tlsdtors[i];
if(mi.tlsctor)
(*mi.tlsctor)();
}
}
/**
* Destruct the modules.
*/
// Starting the name with "_STD" means under Posix a pointer to the
// function gets put in the .dtors segment.
extern (C) void _moduleDtor()
{
debug(PRINTF) printf("_moduleDtor(): %d modules\n", _moduleinfo_dtors_i);
// NOTE: _moduleTlsDtor is now called manually by dmain2
//_moduleTlsDtor();
for (auto i = _moduleinfo_dtors_i; i-- != 0;)
{
ModuleInfo* m = _moduleinfo_dtors[i];
debug(PRINTF) printf("\tmodule[%d] = '%.*s', x%x\n", i, m.name.length, m.name.ptr, m);
if (m.dtor)
{
(*m.dtor)();
}
}
debug(PRINTF) printf("_moduleDtor() done\n");
}
extern (C) void _moduleTlsDtor()
{
debug(PRINTF) printf("_moduleTlsDtor(): %d modules\n", _moduleinfo_tlsdtors_i);
version(none)
{
printf("_moduleinfo_tlsdtors = %d,%p\n", _moduleinfo_tlsdtors);
foreach (i,m; _moduleinfo_tlsdtors[0..11])
printf("[%d] = %p\n", i, m);
}
for (auto i = _moduleinfo_tlsdtors_i; i-- != 0;)
{
ModuleInfo* m = _moduleinfo_tlsdtors[i];
debug(PRINTF) printf("\tmodule[%d] = '%.*s', x%x\n", i, m.name.length, m.name.ptr, m);
if (m.tlsdtor)
{
(*m.tlsdtor)();
}
}
debug(PRINTF) printf("_moduleTlsDtor() done\n");
}
// Alias the TLS ctor and dtor using "rt_" prefixes, since these routines
// must be called by core.thread.
extern (C) void rt_moduleTlsCtor()
{
_moduleTlsCtor();
}
extern (C) void rt_moduleTlsDtor()
{
_moduleTlsDtor();
}
///////////////////////////////////////////////////////////////////////////////
// Monitor
///////////////////////////////////////////////////////////////////////////////
alias Object.Monitor IMonitor;
alias void delegate(Object) DEvent;
// NOTE: The dtor callback feature is only supported for monitors that are not
// supplied by the user. The assumption is that any object with a user-
// supplied monitor may have special storage or lifetime requirements and
// that as a result, storing references to local objects within Monitor
// may not be safe or desirable. Thus, devt is only valid if impl is
// null.
struct Monitor
{
IMonitor impl;
/* internal */
DEvent[] devt;
size_t refs;
/* stuff */
}
Monitor* getMonitor(Object h)
{
return cast(Monitor*) h.__monitor;
}
void setMonitor(Object h, Monitor* m)
{
h.__monitor = m;
}
void setSameMutex(shared Object ownee, shared Object owner)
in
{
assert(ownee.__monitor is null);
}
body
{
auto m = cast(shared(Monitor)*) owner.__monitor;
if (m is null)
{
_d_monitor_create(cast(Object) owner);
m = cast(shared(Monitor)*) owner.__monitor;
}
auto i = m.impl;
if (i is null)
{
atomicOp!("+=")(m.refs, cast(size_t)1);
ownee.__monitor = owner.__monitor;
return;
}
// If m.impl is set (ie. if this is a user-created monitor), assume
// the monitor is garbage collected and simply copy the reference.
ownee.__monitor = owner.__monitor;
}
extern (C) void _d_monitor_create(Object);
extern (C) void _d_monitor_destroy(Object);
extern (C) void _d_monitor_lock(Object);
extern (C) int _d_monitor_unlock(Object);
extern (C) void _d_monitordelete(Object h, bool det)
{
// det is true when the object is being destroyed deterministically (ie.
// when it is explicitly deleted or is a scope object whose time is up).
Monitor* m = getMonitor(h);
if (m !is null)
{
IMonitor i = m.impl;
if (i is null)
{
auto s = cast(shared(Monitor)*) m;
if(!atomicOp!("-=")(s.refs, cast(size_t) 1))
{
_d_monitor_devt(m, h);
_d_monitor_destroy(h);
setMonitor(h, null);
}
return;
}
// NOTE: Since a monitor can be shared via setSameMutex it isn't safe
// to explicitly delete user-created monitors--there's no
// refcount and it may have multiple owners.
/+
if (det && (cast(void*) i) !is (cast(void*) h))
delete i;
+/
setMonitor(h, null);
}
}
extern (C) void _d_monitorenter(Object h)
{
Monitor* m = getMonitor(h);
if (m is null)
{
_d_monitor_create(h);
m = getMonitor(h);
}
IMonitor i = m.impl;
if (i is null)
{
_d_monitor_lock(h);
return;
}
i.lock();
}
extern (C) void _d_monitorexit(Object h)
{
Monitor* m = getMonitor(h);
IMonitor i = m.impl;
if (i is null)
{
_d_monitor_unlock(h);
return;
}
i.unlock();
}
extern (C) void _d_monitor_devt(Monitor* m, Object h)
{
if (m.devt.length)
{
DEvent[] devt;
synchronized (h)
{
devt = m.devt;
m.devt = null;
}
foreach (v; devt)
{
if (v)
v(h);
}
free(devt.ptr);
}
}
extern (C) void rt_attachDisposeEvent(Object h, DEvent e)
{
synchronized (h)
{
Monitor* m = getMonitor(h);
assert(m.impl is null);
foreach (ref v; m.devt)
{
if (v is null || v == e)
{
v = e;
return;
}
}
auto len = m.devt.length + 4; // grow by 4 elements
auto pos = m.devt.length; // insert position
auto p = realloc(m.devt.ptr, DEvent.sizeof * len);
if (!p)
onOutOfMemoryError();
m.devt = (cast(DEvent*)p)[0 .. len];
m.devt[pos+1 .. len] = null;
m.devt[pos] = e;
}
}
extern (C) void rt_detachDisposeEvent(Object h, DEvent e)
{
synchronized (h)
{
Monitor* m = getMonitor(h);
assert(m.impl is null);
foreach (p, v; m.devt)
{
if (v == e)
{
memmove(&m.devt[p],
&m.devt[p+1],
(m.devt.length - p - 1) * DEvent.sizeof);
m.devt[$ - 1] = null;
return;
}
}
}
}
extern (C)
{
// from druntime/src/compiler/dmd/aaA.d
size_t _aaLen(void* p);
void* _aaGet(void** pp, TypeInfo keyti, size_t valuesize, ...);
void* _aaGetRvalue(void* p, TypeInfo keyti, size_t valuesize, ...);
void* _aaIn(void* p, TypeInfo keyti);
void _aaDel(void* p, TypeInfo keyti, ...);
void[] _aaValues(void* p, size_t keysize, size_t valuesize);
void[] _aaKeys(void* p, size_t keysize);
void* _aaRehash(void** pp, TypeInfo keyti);
extern (D) alias scope int delegate(void *) _dg_t;
int _aaApply(void* aa, size_t keysize, _dg_t dg);
extern (D) alias scope int delegate(void *, void *) _dg2_t;
int _aaApply2(void* aa, size_t keysize, _dg2_t dg);
void* _d_assocarrayliteralT(TypeInfo_AssociativeArray ti, size_t length, ...);
}
struct AssociativeArray(Key, Value)
{
void* p;
@property size_t length() { return _aaLen(p); }
Value[Key] rehash() @property
{
auto p = _aaRehash(&p, typeid(Value[Key]));
return *cast(Value[Key]*)(&p);
}
Value[] values() @property
{
auto a = _aaValues(p, Key.sizeof, Value.sizeof);
return *cast(Value[]*) &a;
}
Key[] keys() @property
{
auto a = _aaKeys(p, Key.sizeof);
return *cast(Key[]*) &a;
}
int opApply(scope int delegate(ref Key, ref Value) dg)
{
return _aaApply2(p, Key.sizeof, cast(_dg2_t)dg);
}
int opApply(scope int delegate(ref Value) dg)
{
return _aaApply(p, Key.sizeof, cast(_dg_t)dg);
}
int delegate(int delegate(ref Key) dg) byKey()
{
// Discard the Value part and just do the Key
int foo(int delegate(ref Key) dg)
{
int byKeydg(ref Key key, ref Value value)
{
return dg(key);
}
return _aaApply2(p, Key.sizeof, cast(_dg2_t)&byKeydg);
}
return &foo;
}
int delegate(int delegate(ref Value) dg) byValue()
{
return &opApply;
}
Value get(Key key, lazy Value defaultValue)
{
auto p = key in *cast(Value[Key]*)(&p);
return p ? *p : defaultValue;
}
static if (is(typeof({ Value[Key] r; r[Key.init] = Value.init; }())))
@property Value[Key] dup()
{
Value[Key] result;
foreach (k, v; this)
{
result[k] = v;
}
return result;
}
}
unittest
{
auto a = [ 1:"one", 2:"two", 3:"three" ];
auto b = a.dup;
assert(b == [ 1:"one", 2:"two", 3:"three" ]);
}
unittest
{
// test for bug 5925
const a = [4:0];
const b = [4:0];
assert(a == b);
}
void clear(T)(T obj) if (is(T == class))
{
rt_finalize(cast(void*)obj);
}
version(unittest) unittest
{
{
class A { string s = "A"; this() {} }
auto a = new A;
a.s = "asd";
clear(a);
assert(a.s == "A");
}
{
static bool destroyed = false;
class B
{
string s = "B";
this() {}
~this()
{
destroyed = true;
}
}
auto a = new B;
a.s = "asd";
clear(a);
assert(destroyed);
assert(a.s == "B");
}
// this test is invalid now that the default ctor is not run after clearing
version(none)
{
class C
{
string s;
this()
{
s = "C";
}
}
auto a = new C;
a.s = "asd";
clear(a);
assert(a.s == "C");
}
}
void clear(T)(ref T obj) if (is(T == struct))
{
typeid(T).destroy( &obj );
auto buf = (cast(ubyte*) &obj)[0 .. T.sizeof];
auto init = cast(ubyte[])typeid(T).init();
if(init.ptr is null) // null ptr means initialize to 0s
buf[] = 0;
else
buf[] = init[];
}
version(unittest) unittest
{
{
struct A { string s = "A"; }
A a;
a.s = "asd";
clear(a);
assert(a.s == "A");
}
{
static int destroyed = 0;
struct C
{
string s = "C";
~this()
{
destroyed ++;
}
}
struct B
{
C c;
string s = "B";
~this()
{
destroyed ++;
}
}
B a;
a.s = "asd";
a.c.s = "jkl";
clear(a);
assert(destroyed == 2);
assert(a.s == "B");
assert(a.c.s == "C" );
}
}
void clear(T : U[n], U, size_t n)(ref T obj)
{
obj = T.init;
}
version(unittest) unittest
{
int[2] a;
a[0] = 1;
a[1] = 2;
clear(a);
assert(a == [ 0, 0 ]);
}
void clear(T)(ref T obj)
if (!is(T == struct) && !is(T == class) && !_isStaticArray!T)
{
obj = T.init;
}
template _isStaticArray(T : U[N], U, size_t N)
{
enum bool _isStaticArray = true;
}
template _isStaticArray(T)
{
enum bool _isStaticArray = false;
}
version(unittest) unittest
{
{
int a = 42;
clear(a);
assert(a == 0);
}
{
float a = 42;
clear(a);
assert(isnan(a));
}
}
version (unittest)
{
bool isnan(float x)
{
return x != x;
}
}
/**
* (Property) Get the current capacity of an array. The capacity is the number
* of elements that the array can grow to before the array must be
* extended/reallocated.
*/
@property size_t capacity(T)(T[] arr)
{
return _d_arraysetcapacity(typeid(T[]), 0, cast(void *)&arr);
}
/**
* Try to reserve capacity for an array. The capacity is the number of
* elements that the array can grow to before the array must be
* extended/reallocated.
*
* The return value is the new capacity of the array (which may be larger than
* the requested capacity).
*/
size_t reserve(T)(ref T[] arr, size_t newcapacity)
{
return _d_arraysetcapacity(typeid(T[]), newcapacity, cast(void *)&arr);
}
/**
* Assume that it is safe to append to this array. Appends made to this array
* after calling this function may append in place, even if the array was a
* slice of a larger array to begin with.
*
* Use this only when you are sure no elements are in use beyond the array in
* the memory block. If there are, those elements could be overwritten by
* appending to this array.
*
* Calling this function, and then using references to data located after the
* given array results in undefined behavior.
*/
void assumeSafeAppend(T)(T[] arr)
{
_d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr));
}
version (unittest) unittest
{
{
int[] arr;
auto newcap = arr.reserve(2000);
assert(newcap >= 2000);
assert(newcap == arr.capacity);
auto ptr = arr.ptr;
foreach(i; 0..2000)
arr ~= i;
assert(ptr == arr.ptr);
arr = arr[0..1];
arr.assumeSafeAppend();
arr ~= 5;
assert(ptr == arr.ptr);
}
}
version (none)
{
// enforce() copied from Phobos std.contracts for clear(), left out until
// we decide whether to use it.
T _enforce(T, string file = __FILE__, int line = __LINE__)
(T value, lazy const(char)[] msg = null)
{
if (!value) bailOut(file, line, msg);
return value;
}
T _enforce(T, string file = __FILE__, int line = __LINE__)
(T value, scope void delegate() dg)
{
if (!value) dg();
return value;
}
T _enforce(T)(T value, lazy Exception ex)
{
if (!value) throw ex();
return value;
}
private void _bailOut(string file, int line, in char[] msg)
{
char[21] buf;
throw new Exception(cast(string)(file ~ "(" ~ ulongToString(buf[], line) ~ "): " ~ (msg ? msg : "Enforcement failed")));
}
}
/***************************************
* Helper function used to see if two containers of different
* types have the same contents in the same sequence.
*/
bool _ArrayEq(T1, T2)(T1[] a1, T2[] a2)
{
if (a1.length != a2.length)
return false;
foreach(i, a; a1)
{
if (a != a2[i])
return false;
}
return true;
}
bool _xopEquals(in void*, in void*)
{
throw new Error("TypeInfo.equals is not implemented");
}
|
D
|
/**
* Copyright: © 2014 Anton Gushcha
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module evol.operators.opif;
import devol.typemng;
import devol.individ;
import devol.world;
import devol.operator;
import devol.std.typepod;
debug import std.stdio;
class IfOperator : Operator
{
TypePod!bool booltype;
TypeVoid voidtype;
enum description = "Условный оператор, который берет три аргумента. Первый "
"имеет логический тип, который относится к условию действия. Если этот аргумент "
"вычисляется в значение 'ИСТИНА', то возвращается второй аргумент, иначе "
"возвращается третий аргумент. Второй и третий аргументы относятся к действиям, "
"которые имеют тип void";
this()
{
booltype = cast(TypePod!bool)(TypeMng.getSingleton().getType("Typebool"));
assert(booltype, "We need bool type!");
voidtype = cast(TypeVoid)(TypeMng.getSingleton().getType("TypeVoid"));
mRetType = voidtype;
super("if", description, ArgsStyle.CONTROL_STYLE);
ArgInfo a1;
a1.type = booltype;
args ~= a1;
a1.type = voidtype;
args ~= a1;
args ~= a1;
}
override Argument apply(IndAbstract ind, Line line, WorldAbstract world)
{
auto cond = cast(ArgPod!bool)(line[0]);
Line vthen = cast(Line)(line[1]);
Line velse = cast(Line)(line[2]);
ArgScope sthen = cast(ArgScope)(line[1]);
ArgScope selse = cast(ArgScope)(line[2]);
if (cond.val)
{
if (vthen !is null)
{
vthen.compile(ind, world);
} else if (sthen !is null)
{
foreach(Line aline; sthen)
{
auto line = cast(Line)aline;
line.compile(ind, world);
}
} else
{
debug writeln("Warning: invalid ThenArg: ", line.tostring);
}//else throw new Exception("If is confused! ThenArg is no line, no scope. " ~ line.tostring);
} else
{
if (velse !is null)
{
velse.compile(ind, world);
} else if (selse !is null)
{
foreach(Line aline; selse)
{
auto line = cast(Line)aline;
line.compile(ind, world);
}
} else
{
debug writeln("Warning: invalid ElseArg: ", line.tostring);
} //else throw new Exception("If is confused! ElseArg is no line, no scope" ~ line.tostring);
}
return voidtype.getNewArg();
}
}
|
D
|
/*
Copyright (c) 2016 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dlib.math.tensor;
import std.traits;
import std.math;
import std.conv;
import std.range;
import std.format;
import dlib.core.tuple;
import dlib.core.compound;
T zero(T)() if (isNumeric!T)
{
return T(0);
}
size_t calcLen(T...)(T n)
{
size_t len = 1;
foreach(s; n)
len *= s;
return len;
}
template NTypeTuple(T, int n)
{
static if (n <= 0)
alias Tuple!() NTypeTuple;
else
alias Tuple!(NTypeTuple!(T, n-1), T) NTypeTuple;
}
enum MaxStaticTensorSize = double.sizeof * 16; // fit 4x4 matrix of doubles
/*
* Generic multi-dimensional array template.
* It mainly serves as a base for creating various
* more specialized algebraic objects via encapsulation.
* Think of Tensor as a backend for e.g. Vector and Matrix.
*
* T - element type, usually numeric (float or double)
* dim - number of dimensions (tensor order):
* 0 - scalar
* 1 - vector
* 2 - matrix
* 3 - 3D array
* (higer dimensions are also possible)
* sizes - tuple defining sizes for each dimension:
* 3 - 3-vector
* 4,4 - 4x4 matrix
* etc.
*
* Data storage type (stack or heap) is statically selected: if given size(s)
* imply data size larger than MaxStaticTensorSize, data is allocated
* on heap (as dynamic array). Otherwise, data is allocated on stack (as static array).
*/
// TODO:
// - Manual memory management
// - External storage
// - Component-wise addition, subtraction
template Tensor(T, size_t dim, sizes...)
{
struct Tensor
{
private enum size_t _dataLen = calcLen(sizes);
alias T ElementType;
enum size_t dimensions = dim;
enum size_t order = dim;
alias sizes Sizes;
enum bool isTensor = true;
enum bool isScalar = (order == 0 && _dataLen == 1);
enum bool isVector = (order == 1);
enum bool isMatrix = (order == 2);
enum bool dynamic = (_dataLen * T.sizeof) > MaxStaticTensorSize;
static assert(order == sizes.length,
"Illegal size for Tensor");
static if (order > 0)
{
static assert(sizes.length,
"Illegal size for 0-order Tensor");
}
static if (isVector)
{
static assert(sizes.length == 1,
"Illegal size for 1st-order Tensor");
}
static if (isMatrix)
{
static assert(sizes.length == 2,
"Illegal size for 2nd-order Tensor");
enum size_t rows = sizes[0];
enum size_t cols = sizes[1];
enum bool isSquareMatrix = (rows == cols);
static if (isSquareMatrix)
{
enum size = sizes[0];
}
}
else
{
enum bool isSquareMatrix = false;
static if (sizes.length > 0)
{
enum size = sizes[0];
}
}
/*
* Single element constructor
*/
this(T initVal)
{
static if (dynamic)
{
allocate();
}
foreach(ref v; data)
v = initVal;
}
/*
* Tensor constructor
*/
this(Tensor!(T, order, sizes) t)
{
static if (dynamic)
{
allocate();
}
foreach(i, v; t.arrayof)
{
arrayof[i] = v;
}
}
/*
* Tuple constructor
*/
this(F...)(F components) if (F.length > 1)
{
static if (dynamic)
{
allocate();
}
foreach(i, v; components)
{
static if (i < arrayof.length)
arrayof[i] = cast(T)v;
}
}
static Tensor!(T, order, sizes) init()
{
Tensor!(T, order, sizes) res;
static if (dynamic)
{
res.allocate();
}
return res;
}
static Tensor!(T, order, sizes) zero()
{
Tensor!(T, order, sizes) res;
static if (dynamic)
{
res.allocate();
}
foreach(ref v; res.data)
v = .zero!T();
return res;
}
/*
* T = Tensor[index]
*/
auto ref T opIndex(this X)(size_t index)
in
{
assert ((0 <= index) && (index < _dataLen),
"Tensor.opIndex: array index out of bounds");
}
body
{
return arrayof[index];
}
/*
* Tensor[index] = T
*/
void opIndexAssign(T n, size_t index)
in
{
assert (index < _dataLen,
"Tensor.opIndexAssign: array index out of bounds");
}
body
{
arrayof[index] = n;
}
/*
* T = Tensor[i, j, ...]
*/
T opIndex(I...)(in I indices) const if (I.length == sizes.length)
{
size_t index = 0;
size_t m = 1;
foreach(i, ind; indices)
{
index += ind * m;
m *= sizes[i];
}
return arrayof[index];
}
/*
* Tensor[i, j, ...] = T
*/
T opIndexAssign(I...)(in T t, in I indices) if (I.length == sizes.length)
{
size_t index = 0;
size_t m = 1;
foreach(i, ind; indices)
{
index += ind * m;
m *= sizes[i];
}
return (arrayof[index] = t);
}
/*
* Tensor = Tensor
*/
void opAssign (Tensor!(T, order, sizes) t)
{
static if (dynamic)
{
allocate();
}
foreach(i, v; t.arrayof)
{
arrayof[i] = v;
}
}
alias NTypeTuple!(size_t, order) Indices;
int opApply(int delegate(ref T v, Indices indices) dg)
{
int result = 0;
Compound!(Indices) ind;
size_t index = 0;
while(index < data.length)
{
result = dg(data[index], ind.tuple);
if (result)
break;
ind[0]++;
foreach(i; RangeTuple!(0, order))
{
if (ind[i] == sizes[i])
{
ind[i] = 0;
static if (i < order-1)
{
ind[i+1]++;
}
}
}
index++;
}
return result;
}
@property string toString() const
{
static if (isScalar)
{
return x.to!string;
}
else
{
auto writer = appender!string();
formattedWrite(writer, "%s", arrayof);
return writer.data;
}
}
@property size_t length()
{
return data.length;
}
@property bool initialized()
{
return (data.length > 0);
}
static if (isVector)
{
/*
* NOTE: unfortunately, the following cannot be
* moved to Vector struct because of conflicting
* opDispatch with alias this.
*/
private static bool valid(string s)
{
if (s.length < 2)
return false;
foreach(c; s)
{
switch(c)
{
case 'w', 'a', 'q':
if (size < 4) return false;
else break;
case 'z', 'b', 'p':
if (size < 3) return false;
else break;
case 'y', 'g', 't':
if (size < 2) return false;
else break;
case 'x', 'r', 's':
if (size < 1) return false;
else break;
default:
return false;
}
}
return true;
}
static if (size < 5)
{
/*
* Symbolic element access for vector
*/
private static string vecElements(string[4] letters) @property
{
string res;
foreach (i; 0..size)
{
res ~= "T " ~ letters[i] ~ "; ";
}
return res;
}
}
/*
* Swizzling
*/
template opDispatch(string s) if (valid(s))
{
static if (s.length <= 4)
{
@property auto ref opDispatch(this X)()
{
auto extend(string s)
{
while (s.length < 4)
s ~= s[$-1];
return s;
}
enum p = extend(s);
enum i = (char c) => ['x':0, 'y':1, 'z':2, 'w':3,
'r':0, 'g':1, 'b':2, 'a':3,
's':0, 't':1, 'p':2, 'q':3][c];
enum i0 = i(p[0]),
i1 = i(p[1]),
i2 = i(p[2]),
i3 = i(p[3]);
static if (s.length == 4)
return Tensor!(T,1,4)(arrayof[i0], arrayof[i1], arrayof[i2], arrayof[i3]);
else static if (s.length == 3)
return Tensor!(T,1,3)(arrayof[i0], arrayof[i1], arrayof[i2]);
else static if (s.length == 2)
return Tensor!(T,1,2)(arrayof[i0], arrayof[i1]);
}
}
}
}
static if (dynamic)
{
T[] data;
private void allocate()
{
if (data.length == 0)
data = new T[_dataLen];
}
}
else
{
union
{
T[_dataLen] data;
static if (isScalar)
{
T x;
}
static if (isVector)
{
static if (size < 5)
{
struct { mixin(vecElements(["x", "y", "z", "w"])); }
struct { mixin(vecElements(["r", "g", "b", "a"])); }
struct { mixin(vecElements(["s", "t", "p", "q"])); }
}
}
}
static if (isScalar)
{
alias x this;
}
}
alias data arrayof;
}
}
/*
* Tensor product of two tensors of order N
* and sizes S1 and S2 gives a tensor of order 2N
* and sizes (S1,S2).
*
* TODO: ensure T1, t2 are Tensors
* TODO: if T1 and T2 are scalars, use ordinary multiplication
* TODO: if T1 and T2 are vectors, use optimized version
*/
auto tensorProduct(T1, T2)(T1 t1, T2 t2)
{
static assert(T1.dimensions == T2.dimensions);
alias T1.ElementType T;
enum order = T1.dimensions + T2.dimensions;
alias Tuple!(T2.Sizes, T1.Sizes) sizes;
alias Tensor!(T, order, sizes) TensorType;
TensorType t;
static if (TensorType.dynamic)
{
t = TensorType.init();
}
Compound!(TensorType.Indices) ind;
size_t index = 0;
while(index < t.data.length)
{
t.data[index] =
t2[ind.tuple[0..$/2]] *
t1[ind.tuple[$/2..$]];
ind[0]++;
foreach(i; RangeTuple!(0, order))
{
if (ind[i] == sizes[i])
{
ind[i] = 0;
static if (i < order-1)
{
ind[i+1]++;
}
}
}
index++;
}
return t;
}
|
D
|
nonprofessional soldier member of a territorial military unit
a territorial military unit
of or relating to a territory
displaying territoriality
belonging to the territory of any state or ruler
|
D
|
instance SLD_806_Sylvio(Npc_Default)
{
name[0] = "Сильвио";
guild = GIL_SLD;
id = 806;
voice = 9;
flags = NPC_FLAG_IMMORTAL;
npcType = NPCTYPE_MAIN;
B_SetAttributesToChapter(self,4);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,ItMw_1h_Sld_Sword);
EquipItem(self,ItRw_Sld_Bow);
B_CreateAmbientInv(self);
B_CreateItemToSteal(self,80,ItMi_Gold,120);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Scar,BodyTex_N,ITAR_SLD_H);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,50);
daily_routine = Rtn_Start_806;
};
func void Rtn_Start_806()
{
TA_Sit_Chair(8,0,22,0,"NW_BIGFARM_KITCHEN_BULLCO");
TA_Sit_Chair(22,0,8,0,"NW_BIGFARM_KITCHEN_BULLCO");
};
func void Rtn_Tot_806()
{
TA_Sleep(8,0,23,0,"TOT");
TA_Sleep(23,0,8,0,"TOT");
};
|
D
|
any physical damage to the body caused by violence or accident or fracture etc.
an emotional wound or shock often having long-lasting effects
|
D
|
module imports.link2500a;
import link2500;
import imports.link2500b;
class B
{
S!A t;
}
|
D
|
module dub.version_;
enum dubVersion = "v1.6.0";
|
D
|
/*
Written by Christopher E. Miller
Placed into public domain.
*/
module std.c.windows.winsock;
version (Windows):
extern(Windows):
nothrow:
alias SOCKET = size_t;
alias socklen_t = int;
const SOCKET INVALID_SOCKET = cast(SOCKET)~0;
const int SOCKET_ERROR = -1;
enum WSADESCRIPTION_LEN = 256;
enum WSASYS_STATUS_LEN = 128;
struct WSADATA
{
ushort wVersion;
ushort wHighVersion;
char[WSADESCRIPTION_LEN + 1] szDescription;
char[WSASYS_STATUS_LEN + 1] szSystemStatus;
ushort iMaxSockets;
ushort iMaxUdpDg;
char* lpVendorInfo;
}
alias LPWSADATA = WSADATA*;
const int IOCPARM_MASK = 0x7F;
const int IOC_IN = cast(int)0x80000000;
const int FIONBIO = cast(int)(IOC_IN | ((uint.sizeof & IOCPARM_MASK) << 16) | (102 << 8) | 126);
enum NI_MAXHOST = 1025;
enum NI_MAXSERV = 32;
int WSAStartup(ushort wVersionRequested, LPWSADATA lpWSAData);
int WSACleanup();
SOCKET socket(int af, int type, int protocol);
int ioctlsocket(SOCKET s, int cmd, uint* argp);
int bind(SOCKET s, const(sockaddr)* name, socklen_t namelen);
int connect(SOCKET s, const(sockaddr)* name, socklen_t namelen);
int listen(SOCKET s, int backlog);
SOCKET accept(SOCKET s, sockaddr* addr, socklen_t* addrlen);
int closesocket(SOCKET s);
int shutdown(SOCKET s, int how);
int getpeername(SOCKET s, sockaddr* name, socklen_t* namelen);
int getsockname(SOCKET s, sockaddr* name, socklen_t* namelen);
int send(SOCKET s, const(void)* buf, int len, int flags);
int sendto(SOCKET s, const(void)* buf, int len, int flags, const(sockaddr)* to, socklen_t tolen);
int recv(SOCKET s, void* buf, int len, int flags);
int recvfrom(SOCKET s, void* buf, int len, int flags, sockaddr* from, socklen_t* fromlen);
int getsockopt(SOCKET s, int level, int optname, void* optval, socklen_t* optlen);
int setsockopt(SOCKET s, int level, int optname, const(void)* optval, socklen_t optlen);
uint inet_addr(const char* cp);
int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds, const(timeval)* timeout);
char* inet_ntoa(in_addr ina);
hostent* gethostbyname(const char* name);
hostent* gethostbyaddr(const(void)* addr, int len, int type);
protoent* getprotobyname(const char* name);
protoent* getprotobynumber(int number);
servent* getservbyname(const char* name, const char* proto);
servent* getservbyport(int port, const char* proto);
enum: int
{
NI_NOFQDN = 0x01,
NI_NUMERICHOST = 0x02,
NI_NAMEREQD = 0x04,
NI_NUMERICSERV = 0x08,
NI_DGRAM = 0x10,
}
int gethostname(const char* name, int namelen);
int getaddrinfo(const(char)* nodename, const(char)* servname, const(addrinfo)* hints, addrinfo** res);
void freeaddrinfo(addrinfo* ai);
int getnameinfo(const(sockaddr)* sa, socklen_t salen, char* host, uint hostlen, char* serv, uint servlen, int flags);
enum WSABASEERR = 10000;
enum: int
{
/*
* Windows Sockets definitions of regular Microsoft C error constants
*/
WSAEINTR = (WSABASEERR+4),
WSAEBADF = (WSABASEERR+9),
WSAEACCES = (WSABASEERR+13),
WSAEFAULT = (WSABASEERR+14),
WSAEINVAL = (WSABASEERR+22),
WSAEMFILE = (WSABASEERR+24),
/*
* Windows Sockets definitions of regular Berkeley error constants
*/
WSAEWOULDBLOCK = (WSABASEERR+35),
WSAEINPROGRESS = (WSABASEERR+36),
WSAEALREADY = (WSABASEERR+37),
WSAENOTSOCK = (WSABASEERR+38),
WSAEDESTADDRREQ = (WSABASEERR+39),
WSAEMSGSIZE = (WSABASEERR+40),
WSAEPROTOTYPE = (WSABASEERR+41),
WSAENOPROTOOPT = (WSABASEERR+42),
WSAEPROTONOSUPPORT = (WSABASEERR+43),
WSAESOCKTNOSUPPORT = (WSABASEERR+44),
WSAEOPNOTSUPP = (WSABASEERR+45),
WSAEPFNOSUPPORT = (WSABASEERR+46),
WSAEAFNOSUPPORT = (WSABASEERR+47),
WSAEADDRINUSE = (WSABASEERR+48),
WSAEADDRNOTAVAIL = (WSABASEERR+49),
WSAENETDOWN = (WSABASEERR+50),
WSAENETUNREACH = (WSABASEERR+51),
WSAENETRESET = (WSABASEERR+52),
WSAECONNABORTED = (WSABASEERR+53),
WSAECONNRESET = (WSABASEERR+54),
WSAENOBUFS = (WSABASEERR+55),
WSAEISCONN = (WSABASEERR+56),
WSAENOTCONN = (WSABASEERR+57),
WSAESHUTDOWN = (WSABASEERR+58),
WSAETOOMANYREFS = (WSABASEERR+59),
WSAETIMEDOUT = (WSABASEERR+60),
WSAECONNREFUSED = (WSABASEERR+61),
WSAELOOP = (WSABASEERR+62),
WSAENAMETOOLONG = (WSABASEERR+63),
WSAEHOSTDOWN = (WSABASEERR+64),
WSAEHOSTUNREACH = (WSABASEERR+65),
WSAENOTEMPTY = (WSABASEERR+66),
WSAEPROCLIM = (WSABASEERR+67),
WSAEUSERS = (WSABASEERR+68),
WSAEDQUOT = (WSABASEERR+69),
WSAESTALE = (WSABASEERR+70),
WSAEREMOTE = (WSABASEERR+71),
/*
* Extended Windows Sockets error constant definitions
*/
WSASYSNOTREADY = (WSABASEERR+91),
WSAVERNOTSUPPORTED = (WSABASEERR+92),
WSANOTINITIALISED = (WSABASEERR+93),
/* Authoritative Answer: Host not found */
WSAHOST_NOT_FOUND = (WSABASEERR+1001),
HOST_NOT_FOUND = WSAHOST_NOT_FOUND,
/* Non-Authoritative: Host not found, or SERVERFAIL */
WSATRY_AGAIN = (WSABASEERR+1002),
TRY_AGAIN = WSATRY_AGAIN,
/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
WSANO_RECOVERY = (WSABASEERR+1003),
NO_RECOVERY = WSANO_RECOVERY,
/* Valid name, no data record of requested type */
WSANO_DATA = (WSABASEERR+1004),
NO_DATA = WSANO_DATA,
/* no address, look for MX record */
WSANO_ADDRESS = WSANO_DATA,
NO_ADDRESS = WSANO_ADDRESS
}
/*
* Windows Sockets errors redefined as regular Berkeley error constants
*/
enum: int
{
EWOULDBLOCK = WSAEWOULDBLOCK,
EINPROGRESS = WSAEINPROGRESS,
EALREADY = WSAEALREADY,
ENOTSOCK = WSAENOTSOCK,
EDESTADDRREQ = WSAEDESTADDRREQ,
EMSGSIZE = WSAEMSGSIZE,
EPROTOTYPE = WSAEPROTOTYPE,
ENOPROTOOPT = WSAENOPROTOOPT,
EPROTONOSUPPORT = WSAEPROTONOSUPPORT,
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT,
EOPNOTSUPP = WSAEOPNOTSUPP,
EPFNOSUPPORT = WSAEPFNOSUPPORT,
EAFNOSUPPORT = WSAEAFNOSUPPORT,
EADDRINUSE = WSAEADDRINUSE,
EADDRNOTAVAIL = WSAEADDRNOTAVAIL,
ENETDOWN = WSAENETDOWN,
ENETUNREACH = WSAENETUNREACH,
ENETRESET = WSAENETRESET,
ECONNABORTED = WSAECONNABORTED,
ECONNRESET = WSAECONNRESET,
ENOBUFS = WSAENOBUFS,
EISCONN = WSAEISCONN,
ENOTCONN = WSAENOTCONN,
ESHUTDOWN = WSAESHUTDOWN,
ETOOMANYREFS = WSAETOOMANYREFS,
ETIMEDOUT = WSAETIMEDOUT,
ECONNREFUSED = WSAECONNREFUSED,
ELOOP = WSAELOOP,
ENAMETOOLONG = WSAENAMETOOLONG,
EHOSTDOWN = WSAEHOSTDOWN,
EHOSTUNREACH = WSAEHOSTUNREACH,
ENOTEMPTY = WSAENOTEMPTY,
EPROCLIM = WSAEPROCLIM,
EUSERS = WSAEUSERS,
EDQUOT = WSAEDQUOT,
ESTALE = WSAESTALE,
EREMOTE = WSAEREMOTE
}
enum: int
{
EAI_NONAME = WSAHOST_NOT_FOUND,
}
int WSAGetLastError();
enum: int
{
AF_UNSPEC = 0,
AF_UNIX = 1,
AF_INET = 2,
AF_IMPLINK = 3,
AF_PUP = 4,
AF_CHAOS = 5,
AF_NS = 6,
AF_IPX = AF_NS,
AF_ISO = 7,
AF_OSI = AF_ISO,
AF_ECMA = 8,
AF_DATAKIT = 9,
AF_CCITT = 10,
AF_SNA = 11,
AF_DECnet = 12,
AF_DLI = 13,
AF_LAT = 14,
AF_HYLINK = 15,
AF_APPLETALK = 16,
AF_NETBIOS = 17,
AF_VOICEVIEW = 18,
AF_FIREFOX = 19,
AF_UNKNOWN1 = 20,
AF_BAN = 21,
AF_ATM = 22,
AF_INET6 = 23,
AF_CLUSTER = 24,
AF_12844 = 25,
AF_IRDA = 26,
AF_NETDES = 28,
AF_MAX = 29,
PF_UNSPEC = AF_UNSPEC,
PF_UNIX = AF_UNIX,
PF_INET = AF_INET,
PF_IMPLINK = AF_IMPLINK,
PF_PUP = AF_PUP,
PF_CHAOS = AF_CHAOS,
PF_NS = AF_NS,
PF_IPX = AF_IPX,
PF_ISO = AF_ISO,
PF_OSI = AF_OSI,
PF_ECMA = AF_ECMA,
PF_DATAKIT = AF_DATAKIT,
PF_CCITT = AF_CCITT,
PF_SNA = AF_SNA,
PF_DECnet = AF_DECnet,
PF_DLI = AF_DLI,
PF_LAT = AF_LAT,
PF_HYLINK = AF_HYLINK,
PF_APPLETALK = AF_APPLETALK,
PF_VOICEVIEW = AF_VOICEVIEW,
PF_FIREFOX = AF_FIREFOX,
PF_UNKNOWN1 = AF_UNKNOWN1,
PF_BAN = AF_BAN,
PF_INET6 = AF_INET6,
PF_MAX = AF_MAX,
}
enum: int
{
SOL_SOCKET = 0xFFFF,
}
enum: int
{
SO_DEBUG = 0x0001,
SO_ACCEPTCONN = 0x0002,
SO_REUSEADDR = 0x0004,
SO_KEEPALIVE = 0x0008,
SO_DONTROUTE = 0x0010,
SO_BROADCAST = 0x0020,
SO_USELOOPBACK = 0x0040,
SO_LINGER = 0x0080,
SO_DONTLINGER = ~SO_LINGER,
SO_OOBINLINE = 0x0100,
SO_SNDBUF = 0x1001,
SO_RCVBUF = 0x1002,
SO_SNDLOWAT = 0x1003,
SO_RCVLOWAT = 0x1004,
SO_SNDTIMEO = 0x1005,
SO_RCVTIMEO = 0x1006,
SO_ERROR = 0x1007,
SO_TYPE = 0x1008,
SO_EXCLUSIVEADDRUSE = ~SO_REUSEADDR,
TCP_NODELAY = 1,
IP_MULTICAST_LOOP = 0x4,
IP_ADD_MEMBERSHIP = 0x5,
IP_DROP_MEMBERSHIP = 0x6,
IPV6_UNICAST_HOPS = 4,
IPV6_MULTICAST_IF = 9,
IPV6_MULTICAST_HOPS = 10,
IPV6_MULTICAST_LOOP = 11,
IPV6_ADD_MEMBERSHIP = 12,
IPV6_DROP_MEMBERSHIP = 13,
IPV6_JOIN_GROUP = IPV6_ADD_MEMBERSHIP,
IPV6_LEAVE_GROUP = IPV6_DROP_MEMBERSHIP,
IPV6_V6ONLY = 27,
}
/// Default FD_SETSIZE value.
/// In C/C++, it is redefinable by #define-ing the macro before #include-ing
/// winsock.h. In D, use the $(D FD_CREATE) function to allocate a $(D fd_set)
/// of an arbitrary size.
enum int FD_SETSIZE = 64;
struct fd_set_custom(uint SETSIZE)
{
uint fd_count;
SOCKET[SETSIZE] fd_array;
}
alias fd_set = fd_set_custom!FD_SETSIZE;
// Removes.
void FD_CLR(SOCKET fd, fd_set* set)
{
uint c = set.fd_count;
SOCKET* start = set.fd_array.ptr;
SOCKET* stop = start + c;
for(; start != stop; start++)
{
if(*start == fd)
goto found;
}
return; //not found
found:
for(++start; start != stop; start++)
{
*(start - 1) = *start;
}
set.fd_count = c - 1;
}
// Tests.
int FD_ISSET(SOCKET fd, const(fd_set)* set)
{
const(SOCKET)* start = set.fd_array.ptr;
const(SOCKET)* stop = start + set.fd_count;
for(; start != stop; start++)
{
if(*start == fd)
return true;
}
return false;
}
// Adds.
void FD_SET(SOCKET fd, fd_set* set)
{
uint c = set.fd_count;
set.fd_array.ptr[c] = fd;
set.fd_count = c + 1;
}
// Resets to zero.
void FD_ZERO(fd_set* set)
{
set.fd_count = 0;
}
/// Creates a new $(D fd_set) with the specified capacity.
fd_set* FD_CREATE(uint capacity)
{
// Take into account alignment (SOCKET may be 64-bit and require 64-bit alignment on 64-bit systems)
size_t size = (fd_set_custom!1).sizeof - SOCKET.sizeof + (SOCKET.sizeof * capacity);
auto data = new ubyte[size];
auto set = cast(fd_set*)data.ptr;
FD_ZERO(set);
return set;
}
struct linger
{
ushort l_onoff;
ushort l_linger;
}
struct protoent
{
char* p_name;
char** p_aliases;
short p_proto;
}
struct servent
{
char* s_name;
char** s_aliases;
version (Win64)
{
char* s_proto;
short s_port;
}
else
{
short s_port;
char* s_proto;
}
}
/+
union in6_addr
{
private union _u_t
{
ubyte[16] Byte;
ushort[8] Word;
}
_u_t u;
}
struct in_addr6
{
ubyte[16] s6_addr;
}
+/
version(BigEndian)
{
ushort htons(ushort x)
{
return x;
}
uint htonl(uint x)
{
return x;
}
}
else version(LittleEndian)
{
private import core.bitop;
ushort htons(ushort x)
{
return cast(ushort)((x >> 8) | (x << 8));
}
uint htonl(uint x)
{
return bswap(x);
}
}
else
{
static assert(0);
}
ushort ntohs(ushort x)
{
return htons(x);
}
uint ntohl(uint x)
{
return htonl(x);
}
enum: int
{
SOCK_STREAM = 1,
SOCK_DGRAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
}
enum: int
{
IPPROTO_IP = 0,
IPPROTO_ICMP = 1,
IPPROTO_IGMP = 2,
IPPROTO_GGP = 3,
IPPROTO_TCP = 6,
IPPROTO_PUP = 12,
IPPROTO_UDP = 17,
IPPROTO_IDP = 22,
IPPROTO_IPV6 = 41,
IPPROTO_ND = 77,
IPPROTO_RAW = 255,
IPPROTO_MAX = 256,
}
enum: int
{
MSG_OOB = 0x1,
MSG_PEEK = 0x2,
MSG_DONTROUTE = 0x4
}
enum: int
{
SD_RECEIVE = 0,
SD_SEND = 1,
SD_BOTH = 2,
}
enum: uint
{
INADDR_ANY = 0,
INADDR_LOOPBACK = 0x7F000001,
INADDR_BROADCAST = 0xFFFFFFFF,
INADDR_NONE = 0xFFFFFFFF,
ADDR_ANY = INADDR_ANY,
}
enum: int
{
AI_PASSIVE = 0x1,
AI_CANONNAME = 0x2,
AI_NUMERICHOST = 0x4,
AI_ADDRCONFIG = 0x0400,
AI_NON_AUTHORITATIVE = 0x04000,
AI_SECURE = 0x08000,
AI_RETURN_PREFERRED_NAMES = 0x010000,
}
struct timeval
{
int tv_sec;
int tv_usec;
}
union in_addr
{
private union _S_un_t
{
private struct _S_un_b_t
{
ubyte s_b1, s_b2, s_b3, s_b4;
}
_S_un_b_t S_un_b;
private struct _S_un_w_t
{
ushort s_w1, s_w2;
}
_S_un_w_t S_un_w;
uint S_addr;
}
_S_un_t S_un;
uint s_addr;
struct
{
ubyte s_net, s_host;
union
{
ushort s_imp;
struct
{
ubyte s_lh, s_impno;
}
}
}
}
union in6_addr
{
private union _in6_u_t
{
ubyte[16] u6_addr8;
ushort[8] u6_addr16;
uint[4] u6_addr32;
}
_in6_u_t in6_u;
ubyte[16] s6_addr8;
ushort[8] s6_addr16;
uint[4] s6_addr32;
alias s6_addr = s6_addr8;
}
const in6_addr IN6ADDR_ANY = { s6_addr8: [0] };
const in6_addr IN6ADDR_LOOPBACK = { s6_addr8: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] };
//alias IN6ADDR_ANY_INIT = IN6ADDR_ANY;
//alias IN6ADDR_LOOPBACK_INIT = IN6ADDR_LOOPBACK;
enum int INET_ADDRSTRLEN = 16;
enum int INET6_ADDRSTRLEN = 46;
struct sockaddr
{
short sa_family;
ubyte[14] sa_data;
}
struct sockaddr_in
{
short sin_family = AF_INET;
ushort sin_port;
in_addr sin_addr;
ubyte[8] sin_zero;
}
struct sockaddr_in6
{
short sin6_family = AF_INET6;
ushort sin6_port;
uint sin6_flowinfo;
in6_addr sin6_addr;
uint sin6_scope_id;
}
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
char* ai_canonname;
sockaddr* ai_addr;
addrinfo* ai_next;
}
struct hostent
{
char* h_name;
char** h_aliases;
short h_addrtype;
short h_length;
char** h_addr_list;
char* h_addr()
{
return h_addr_list[0];
}
}
// Note: These are Winsock2!!
struct WSAOVERLAPPED;
alias LPWSAOVERLAPPED = WSAOVERLAPPED*;
alias LPWSAOVERLAPPED_COMPLETION_ROUTINE = void function(uint, uint, LPWSAOVERLAPPED, uint);
int WSAIoctl(SOCKET s, uint dwIoControlCode,
void* lpvInBuffer, uint cbInBuffer,
void* lpvOutBuffer, uint cbOutBuffer,
uint* lpcbBytesReturned,
LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
enum IOC_VENDOR = 0x18000000;
enum SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4;
/* Argument structure for SIO_KEEPALIVE_VALS */
struct tcp_keepalive
{
uint onoff;
uint keepalivetime;
uint keepaliveinterval;
}
|
D
|
a Polynesian rain dance performed by a woman
|
D
|
/home/liyun/clink/zkp_test/ckb-zkp/target/debug/deps/byteorder-9d25ed89ce31dd8b.rmeta: /home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/byteorder-1.3.4/src/lib.rs
/home/liyun/clink/zkp_test/ckb-zkp/target/debug/deps/byteorder-9d25ed89ce31dd8b.d: /home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/byteorder-1.3.4/src/lib.rs
/home/liyun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/byteorder-1.3.4/src/lib.rs:
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.