[llvm-commits] CVS: llvm-java/include/llvm/Java/Compiler.h

Alkis Evlogimenos alkis at cs.uiuc.edu
Mon May 24 15:04:04 PDT 2004


Changes in directory llvm-java/include/llvm/Java:

Compiler.h updated: 1.3 -> 1.4

---
Log message:

Create and initialize locals in the beginning of the function.

Ignore INVOKESPECIAL bytecodes so that we can compile simple methods
like (the <init> method is missing code for the INVOKESPECIAL
bytecode):

alkis at moro ClassFile $ cat Simple.java
package edu.uiuc.cs.llvm;

public class Simple
{
    public static int main(String[] args) {
        return 0;
    }
}
alkis at moro ClassFile $ ../../tools/Debug/class2llvm -debug < Simple.class

implementation   ; Functions:

void "<init>"() {
entry:
        alloca void*            ; <void**>:0 [#uses=2]
        store void* null, void** %0
        load void** %0          ; <void*>:0 [#uses=0]
        ret void
}

void %main() {
entry:
        ret int 0
}
alkis at moro ClassFile $


---
Diffs of the changes:  (+7 -1)

Index: llvm-java/include/llvm/Java/Compiler.h
diff -u llvm-java/include/llvm/Java/Compiler.h:1.3 llvm-java/include/llvm/Java/Compiler.h:1.4
--- llvm-java/include/llvm/Java/Compiler.h:1.3	Sat May 22 20:15:53 2004
+++ llvm-java/include/llvm/Java/Compiler.h	Mon May 24 15:00:23 2004
@@ -26,8 +26,14 @@
 
     private:
         void compileMethodInit(Function& function,
+                               const ClassFile& cf,
                                const CodeAttribute& codeAttr);
-        void compileMethod(Module& module, const Method& method);
+
+        Value* getOrCreateLocal(unsigned index, const Type* type);
+
+        void compileMethod(Module& module,
+                           const ClassFile& cf,
+                           const Method& method);
 
     private:
         typedef std::stack<Value*, std::vector<Value*> > OperandStack;





More information about the llvm-commits mailing list