Commit e8517d5e authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

update regex to strip Dyn_Mem related functions in LC3plus

parent 68e96c49
Loading
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -140,6 +140,8 @@ if [ "$PROJECT" = "FLOAT" ]; then
    # Append LC3plus defines to options.h
    echo "
    /* LC3plus switches */
    #ifndef OPTIONS_H_LC3_DEFINES
    #define OPTIONS_H_LC3_DEFINES
    #define ENABLE_HR_MODE
    //#define DYNMEM_COUNT
    #define CR10_A_ATTENUATION_CURVE_SELECTOR
@@ -149,17 +151,15 @@ if [ "$PROJECT" = "FLOAT" ]; then
    #define SUBSET_SWB
    #define SUBSET_FB
    #define SUBSET_UB
    #ifndef OPTIONS_H_LC3_DEFINES
    #define OPTIONS_H_LC3_DEFINES
    $lc3plus_defines_filtered
    #endif /* OPTIONS_H_LC3_DEFINES */
    " >>$targetdir/lib_com/options.h

    # Clean out memory tool which breaks wmc_tool instrumentation
    perl -i -0777 -pe 's/Dyn_Mem_Deluxe_In\s*\((.*?)\)\s*;/$1/g' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/Dyn_Mem_Deluxe_In\(((.|\s)*?)\);/$1/g' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/Dyn_Mem_Deluxe_Out\s*\([^)]*\)\s*;//sg' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/Dyn_Mem_In\s*\((.*?)\)\s*;/$1/g' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/Dyn_Mem_Out\s*\([^)]*\)\s*;//sg' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/\sDyn_Mem_In\((.|\s)*?\);//g' $targetdir/lib_lc3plus/*.c
    perl -i -0777 -pe 's/Dyn_Mem_Out\s*\([^)]*\)\s*;/;/sg' $targetdir/lib_lc3plus/*.c

fi