dmd.importc

Contains semantic routines specific to ImportC

Specification: C11

Authors

Walter Bright

Source: importc.d

  • Declaration

    Type cAdjustParamType(Type t, Scope* sc);

    C11 does not allow array or function parameters. Hence, adjust those types per C11 6.7.6.3 rules.

    Parameters

    Type t

    parameter type to adjust

    Scope* sc

    context

    Return Value

    adjusted type

  • Declaration

    Expression arrayFuncConv(Expression e, Scope* sc);

    C11 6.3.2.1-3 Convert expression that is an array of type to a pointer to type. C11 6.3.2.1-4 Convert expression that is a function to a pointer to a function.

    Parameters

    Expression e

    ImportC expression to possibly convert

    Scope* sc

    context

    Return Value

    converted expression

  • Declaration

    Expression fieldLookup(Expression e, Scope* sc, Identifier id);

    Run semantic on e. Expression e evaluates to an instance of a struct. Look up ident as a field of that struct.

    Parameters

    Expression e

    evaluates to an instance of a struct

    Scope* sc

    context

    Identifier id

    identifier of a field in that struct

    Return Value

    if successful e.ident if not then ErrorExp and message is printed

  • Declaration

    Expression carraySemantic(ArrayExp ae, Scope* sc);

    C11 6.5.2.1-2 Apply C semantics to E[I] expression. E1[E2] is lowered to *(E1 + E2)

    Parameters

    ArrayExp ae

    ArrayExp to run semantics on

    Scope* sc

    context

    Return Value

    Expression if this was a C expression with completed semantic, null if not