19.01.2015 Views

Build Programming Language Runtime with LLVM

Build Programming Language Runtime with LLVM

Build Programming Language Runtime with LLVM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

測 試 SDK 內 建 範 例 RenderScript<br />

android­sdk­linux_x86/platform­tools$ ./llvm­rs­cc \<br />

../samples/android­11/<br />

RenderScript/HelloWorld/src/com/android/rs/helloworld/helloworld.rs \<br />

­I ../platforms/android­11/renderscript/include \<br />

­I ../platforms/android­11/renderscript/clang­include<br />

Llvm­dis < helloworld.bc<br />

@gTouchX = common global i32 0, align 4<br />

@gTouchY = common global i32 0, align 4<br />

// helloworld.rs<br />

// This is invoked automatically<br />

// when the script is created<br />

void init() {<br />

gTouchX = 50.0f;<br />

gTouchY = 50.0f;<br />

}<br />

define void @init() nounwind {<br />

store i32 50, i32* @gTouchX, align 4<br />

store i32 50, i32* @gTouchY, align 4<br />

ret void<br />

}<br />

34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!