Giter Site home page Giter Site logo

Assert of 'clang_delta' about cvise HOT 8 CLOSED

marxin avatar marxin commented on May 26, 2024
Assert of 'clang_delta'

from cvise.

Comments (8)

marxin avatar marxin commented on May 26, 2024

Thanks for the report.
What version of LLVM do you use for CVise as a run-time library?
I can run the transformation with success:

$ clang_delta/clang_delta  --transformation=remove-unused-function  tc.C --counter=1 --std=c++17
#include <variant>
#include <vector>
struct A {
         std::basic_string<wchar_t> m;
       };
        struct B {
         B(A a);
         std::variant<A> m;
       };
        struct C : B {
         using B::B;
       };

Can you please attach output of pre-processed source file -E option for clang?

from cvise.

JVApen avatar JVApen commented on May 26, 2024

I'm using LLVM 10, let me see if I can do so easily

from cvise.

JVApen avatar JVApen commented on May 26, 2024
C:\path\to\build-cvise\clang_delta\Debug\clang_delta.exe --transformation=remove-unused-function
t.cpp.preprocessed.cpp --counter=1 --std=c++17
Warning: number of transformation instances exceeded
Assertion failed: RWBuf && "Empty RewriteBuffer!", file G:\llvm\cvise-master\clang_delta\Transformation.cpp, line 103

The file: t.cpp.preprocessed.zip

from cvise.

marxin avatar marxin commented on May 26, 2024

I'm sorry but I can't compile it on Linux:

clang++ x.ii -std=c++17
In file included from .\t.cpp:1:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\variant:9:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals.h:9:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals_core.h:253:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:58:
In file included from c:\path\to\LLVM_10_0_0\lib\clang\10.0.0\include\vadefs.h:18:
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vadefs.h:28:33: error: expected ';' after top level declarator
        typedef unsigned __int64 uintptr_t;
                                ^
In file included from .\t.cpp:1:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\variant:9:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals.h:9:
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals_core.h:253:
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:190:29: error: expected ';' after top level declarator
    typedef unsigned __int64 size_t;
                            ^
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:245:42: error: unknown type name 'size_t'
        template <typename _CountofType, size_t _SizeOfArray>
                                         ^
$ g++ x.ii -std=c++17 -fmax-errors=3
In file included from c:\path\to\LLVM_10_0_0\lib\clang\10.0.0\include\vadefs.h:18,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:58,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals_core.h:253,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals.h:9,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\variant:9,
                 from .\t.cpp:1:
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vadefs.h:28:34: error: expected initializer before ‘uintptr_t’
In file included from c:\path\to\LLVM_10_0_0\lib\clang\10.0.0\include\vadefs.h:18,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:58,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals_core.h:253,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals.h:9,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\variant:9,
                 from .\t.cpp:1:
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vadefs.h:112:18: error: expected initializer before ‘__va_start’
In file included from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals_core.h:253,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\yvals.h:9,
                 from c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\variant:9,
                 from .\t.cpp:1:
c:\path\to\Vs2019\VC\Tools\MSVC\14.24.28314\include\vcruntime.h:190:30: error: expected initializer before ‘size_t’
compilation terminated due to -fmax-errors=3.

from cvise.

JVApen avatar JVApen commented on May 26, 2024

I guess you can replace __int64 by std::int64_t if you add the include

from cvise.

marxin avatar marxin commented on May 26, 2024

It will require much more adjustments. You can try it here:
https://godbolt.org/

from cvise.

JVApen avatar JVApen commented on May 26, 2024

-fms-extensions does a lot, however, I seem to always have 32bit-64bit mismatches.
Any tips for me to debug it myself?

from cvise.

marxin avatar marxin commented on May 26, 2024

Maybe -m32 can help.
Anyway, that's more a LLVM issue than C-Vise issue. The code is invalid so it's partially understandable.

from cvise.

Related Issues (20)

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.