Hi,

I would like to add a new option to clang: -fbounds-checking. It emits  
run-time bounds checks for array/pointers dereferencing based on  
LLVM's object size built-in. The code to emit the checks is already in  
clang; it's just a matter of wiring the flag.
The other change is to make -fcatch-undefined-behavior imply  
-fbounds-checking (so that it keeps doing these kinds of checks).

This flag supports an additional integer parameter to control the  
amount of run-time performance penalty you're willing to afford. For  
example, -fbounds-checking=1 will only resolve stuff at compile-time,  
while at level 2 it can defer some stuff to run-time. This will come  
in a separate patch to LLVM.

Comments, ideas, etc?

Thanks,
Nuno
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to