rwl / ir-builder Goto Github PK
View Code? Open in Web Editor NEWPure Java library for creating LLVM IR
Pure Java library for creating LLVM IR
I tried to use the test example to generate a *.ll file and compiled it, but got following error
phosphorus15@ubuntu:~/ir$ llvm-as < test.ll > test.bc
llvm-as: <stdin>:7:24: error: '@puts' defined with type 'i32 (i8*)*'
%1 = call i32 (i8*)* @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @0, i32 0, i32 0))
The test code is below
StringValue hello = new StringValue("Hello world!\n");
IRBuilder ir = new IRBuilder("top");
GlobalVariable variable = ir.constant(null, hello, null, false, null);
FunctionType ft = new FunctionType(IntType.INT_32,
IntType.INT_8.pointerTo());
GlobalVariable puts = ir.functionDecl("puts", ft);
ir.beginFunction("main", new FunctionType(VoidType.INSTANCE), null, null);
ir.call(puts, Collections.singletonList(variable), null);
ir.endFunction(null);
System.out.println(ir.build());
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.