COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

LLVM

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Identify the LLVM code for the C statementint Bar(int value);
A
declare i32 @Bar(i32 %value)
B
define i32 @Bar() nounwind { }
C
define i32 @ ____ Z8Bar(i32 %a, i32 %b) #0 {}
D
declare i32 @ ____ Z8Bar(i32 %a, i32 %b)
Explanation: 

Detailed explanation-1: -LLVM is written in C++ and is designed for compile-time, link-time, run-time, and “idle-time” optimization.

Detailed explanation-2: -An LLVM module is the container that holds the generated code. Its contents includes the functions that make up the program, external declarations for runtime-system functions, and string literals. All executable code is contained in functions. Functions are named by globals and consist of one or more blocks.

Detailed explanation-3: -Download and install CMake. Open a shell. Create a build directory. Execute this command in the shell replacing path/to/llvm/source/root with the path to the root of your LLVM source tree: After CMake has finished running, proceed to use IDE project files, or start the build from the build directory: More items

There is 1 question to complete.