[GSoC'16] Weekly Status - June 27 - Zhengyang Liu

Dear LLVM and SVA community:

This is to brief you the progress of this week. I mainly focused on minor fixes this week. Following is what I finished this week.

  1. Move the implementation of runOnModule of RegisterGlobalVar pass from .h back to .cpp file.
  2. Introduce two new functions to register and unregister function prototypes on llvm.compiler.used.
  3. Added two regression tests for PromoteArrayAllocas pases.
  4. Rewrite InitAllocas pass. This pass is originally written as a function pass. Rewrite this pass to Module pass to make the intrinsic function llvm.malloc
  5. The customized malloc, calloc, and realloc in safecode/runtime/BBRuntime/AlignedMalloc.cpp could be overrided by system implementation on some environments. Thus I added a _sc_bb prefix to these customized heap allocation functions. I also write a module pass to automatically rename all malloc / calloc / realloc to __sc_bb_malloc … Regression tests are also completed for this pass.

This week, I plan to

  1. Test SAFECode’s bbac implementation on more real-world programs, and fix possible crashes.
  2. Discuss with my mentor Prof. John Criswell about the insertion point of free in PromoteArrayAllocas pass.

Best regards,

Dear community,

This is to brief you the progress of this week. Following is what I
finished this week.

1. The GEPChecks in SAFECode was not able to handle the vectorized
getelementptr instrument. I fix this and make GEPChecks support
vectorized GEP.
2. Found a linkage bug in BaggyBoundsChecks pass. The original
implementation will automatically change a external with common linkage
to a global with external linkage. A global variable with common linkage
must have a zero initializer, which is not applicable in bbac. Rewrite
linkage will allow bbac style tentative global definition. However, the
target linkage is wrong in this case, the correct target linkage is
3. Found a bug in the poolcheck runtime functions. The check function
will do nothing if the length argument of function is 0.
4. Write a temp wrapper function for getline and getdelim.
5. Make RewriteOOB insert a pchk_getActualValue() call before each GEP

Best regards,