<commit_before>Dynamic Hooks
=============

How to build xtern with dynamic hook module.
0. add $XTERN_ROOT into environment variables. make sure LLVM is correctly setup in debug mode. copy all the files from $LLVM_ROOT/llvm-obj/Debug/bin/ to $LLVM_ROOT/install/bin/
1. create $XTERN_ROOT/obj, go to obj.
2. do config as following. that's because xtern uses LLVM makefile.common
> ./../configure --with-llvmsrc=$LLVM_ROOT/llvm-2.7/ --with-llvmobj=$LLVM_ROOT/llvm-obj/ --with-llvmgccdir=$LLVM_ROOT/install/bin/ --prefix=$XTERN_ROOT/install
2.5 run "make ENABLE_OPTIMIZED=0" in obj directory. it fails this time. 
3. edit obj/lib/Makefile, and remove "instr" and "analysis"
4. edit obj/lib/runtime/Makefile, and remove the line of MODULE_NAME
5. do "make ENABLE_OPTIMIZED=0"

6. goto $XTERN_ROOT/dync_hook and run 'make'.

You can test the build by running 'make test_sc' in $XTERN_ROOT/dync_hook

Using LLVM Instrumentation
==========================
First you need setup LLVM from git repository following the instructions.
Where: <EMAIL>:llvm
Maybe you also need setup TERN from git repository<commit_msg>Test.<commit_after>Dynamic Hooks
=============

How to build xtern with dynamic hook module.
0. add $XTERN_ROOT into environment variables. make sure LLVM is correctly setup in debug mode. copy all the files from $LLVM_ROOT/llvm-obj/Debug/bin/ to $LLVM_ROOT/install/bin/
1. create $XTERN_ROOT/obj, go to obj.
2. do config as following. that's because xtern uses LLVM makefile.common
> ./../configure --with-llvmsrc=$LLVM_ROOT/llvm-2.7/ --with-llvmobj=$LLVM_ROOT/llvm-obj/ --with-llvmgccdir=$LLVM_ROOT/install/bin/ --prefix=$XTERN_ROOT/install
2.5 run "make ENABLE_OPTIMIZED=0" in obj directory. it fails this time. 
3. edit obj/lib/Makefile, and remove "instr" and "analysis"
4. edit obj/lib/runtime/Makefile, and remove the line of MODULE_NAME
5. do "make ENABLE_OPTIMIZED=0"
6. goto $XTERN_ROOT/dync_hook and run 'make'.

You can test the build by running 'make test_sc' in $XTERN_ROOT/dync_hook

Using LLVM Instrumentation
==========================
First you need setup LLVM from git repository following the instructions.
Where: <EMAIL>:llvm
Maybe you also need setup TERN from git repository
{'fraction_non_alphanumeric': 0.12755333635950977, 'fraction_numerical': 0.011802088061733999, 'mean_word_length': 4.579746835443038, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2162039', 'n_tokens_mistral': 718, 'n_tokens_neox': 711, 'n_words': 257}