Skip to content

Commit

Permalink
more changes not quite done
Browse files Browse the repository at this point in the history
  • Loading branch information
zingales committed Jul 1, 2011
1 parent 1e0eb5d commit 781a492
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FLISP = $(FLISPDIR)/libflisp.a

FLAGS = -falign-functions -Wall -Wno-strict-aliasing \
-I$(FLISPDIR) -I$(LLTDIR) $(HFILEDIRS:%=-I%) $(LIBDIRS:%=-L%) \
-I$(shell $(LLVMROOT)/bin/llvm-config --includedir) -fvisibility=hidden
-I$(shell $(LLVMROOT)/bin/llvm-config --includedir)
DEBUGFLAGS = -ggdb3 -DDEBUG $(FLAGS)
SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)

Expand Down Expand Up @@ -51,7 +51,7 @@ julia_flisp.boot: julia-parser.scm julia-syntax.scm \
boot.j.inc: boot.j preparse.scm julia_flisp.boot
$(FLISPDIR)/flisp ./preparse.scm < $< | $(FLISPDIR)/flisp ./bin2hex.scm > $@

codegen.o codegen.do: intrinsics.cpp
codegen.o codegen.do: intrinsics.cpp debuginfo.cpp
builtins.o builtins.do: table.c

$(LLT): $(LLTDIR)/*.h $(LLTDIR)/*.c
Expand Down
5 changes: 3 additions & 2 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static GlobalVariable *jlsysmod_var;
static GlobalVariable *jlpgcstack_var;
#endif
static GlobalVariable *jlexc_var;
JuliaJITEventListner *jl_jit_events;
JuliaJITEventListener *jl_jit_events;

// important functions
static Function *jlraise_func;
Expand Down Expand Up @@ -1808,6 +1808,7 @@ static void init_julia_llvm_env(Module *m)
extern "C" void jl_init_codegen()
{
printf ("you reached codegen");
puts("lala codegen");
llvm::JITEmitDebugInfo = true;

InitializeNativeTarget();
Expand All @@ -1818,7 +1819,7 @@ extern "C" void jl_init_codegen()
init_julia_llvm_env(jl_Module);

jl_init_intrinsic_functions();
jl_jit_events = new JuliaJITEventListner();
jl_jit_events = new JuliaJITEventListener();
jl_ExecutionEngine->RegisterJITEventListener(jl_jit_events);
//JIT::RegisterJITEventListener(jl_jit_events);
}
16 changes: 8 additions & 8 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ struct FuncInfo{
};


class JuliaJITEventListner: public JITEventListener {
class __attribute__ ((visibility("default"))) JuliaJITEventListener: public JITEventListener {
map<size_t, FuncInfo> info;


JuliaJITEventListner() {}
~JuliaJITEventListner();

void NotifyFunctionEmitted(const Function &F,
public:
virtual void NotifyFunctionEmitted(const Function &F,
void *Code, size_t Size, const EmittedFunctionDetails &Details) {
// Here i should write down the information into the map i want to know. Important Code name, location of code start, length (and or end),
FuncInfo tmp = {&F, Size};
//tmp.func = &F;
//tmp.lengthAdr = Size;
info[(size_t)(Code)] = tmp;
}

JuliaJITEventListener(){}
virtual ~JuliaJITEventListener() {}
public:

map<size_t, FuncInfo> getMap() {
Expand All @@ -38,7 +36,7 @@ class JuliaJITEventListner: public JITEventListener {

};

extern JuliaJITEventListner *jl_jit_events;
extern JuliaJITEventListener *jl_jit_events;

extern "C" char* getFunctionInfo(size_t pointer);

Expand All @@ -59,6 +57,8 @@ char* getFunctionInfo(size_t pointer) {
}

}

return "Something went wrong, left for loop too early.";
}


Expand Down

0 comments on commit 781a492

Please sign in to comment.