Giter VIP home page Giter VIP logo

creduce's People

Contributors

amykhuang avatar annulen avatar berolinux avatar chenyang78 avatar eeide avatar fitzgen avatar janisozaur avatar jightuse avatar jsonn avatar jwilk avatar marxin avatar mgorny avatar mortior avatar mpflanzer avatar oriceemple avatar pkubaj avatar pmatos avatar pranavk avatar qianxincodesafe avatar regehr avatar rgov avatar rnk avatar tamird avatar vgvassilev avatar yrnkrn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

creduce's Issues

Handling of designated initialisers

If designated initialisers are used remove-unused-struct-field creduce fails to remove the designator from the initialiser list. The field and the initialiser(s) are nevertheless removed which leads to invalid code.

Run test-case with:
$ clang_delta --transformation=remove-unused-field --counter=1 test.cl

Test-case:

typedef const unsigned int test;
typedef test test_second;

int foo(long t)
{
    return t + 8;
}

struct T;

struct Z
{
    int z1;
};

struct W
{
    int w_a1[5];
    //int w1;
};

struct X
{
    int x1;
    int x_a1[5];
    struct W x_w1[2];
    struct Z x_z1;
};

void bar(struct W blubb)
{
    struct W i = blubb;
}

__kernel void entry(__global long *input)
{
    uint test1;
    int4 test2;

    struct T
    {
        int t1;
        struct Z t_z1;
        struct Z t_z2;
    };

    struct X x = {1, {11,12,13,14,15,}, {{{21,22}}, {{211}}}, {3}};

    struct T t;
    struct Z z = {0};
    struct W w = {.w_a1 = {0, 0, 0,}, };
    struct W *wp = &w;

    bar(w);
    foo(z.z1);


    //test1 = s.f;

    get_global_id(0);
}

Output:

typedef const unsigned int test;
typedef test test_second;

int foo(long t)
{
    return t + 8;
}

struct T;

struct Z
{
    int z1;
};

struct W
{

    //int w1;
};

struct X
{
    int x1;
    int x_a1[5];
    struct W x_w1[2];
    struct Z x_z1;
};

void bar(struct W blubb)
{
    struct W i = blubb;
}

__kernel void entry(__global long *input)
{
    uint test1;
    int4 test2;

    struct T
    {
        int t1;
        struct Z t_z1;
        struct Z t_z2;
    };

    struct X x = {1, {11,12,13,14,15,}, {{}, {}}, {3}};

    struct T t;
    struct Z z = {0};
    struct W w = {.w_a1 =  };
    struct W *wp = &w;

    bar(w);
    foo(z.z1);


    //test1 = s.f;

    get_global_id(0);
}

Partial initialiser lists

For partial initialiser lists it can happen that remove-unused-field removes the last initialiser. But an empty list is only valid in GNU C.
Should then a zero be inserted into the list to make it valid again?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.