llvm.org GIT mirror llvm / f28411f
Tell Valgrind when we modify already-executed machine code so it knows to re-instrument the code. We depend on the system valgrind.h to avoid adding a new license. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8 Jeffrey Yasskin 9 years ago
11 changed file(s) with 290 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
12091209 AC_CHECK_HEADERS([utime.h windows.h])
12101210 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h])
12111211 AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h])
1212 AC_CHECK_HEADERS([valgrind/valgrind.h])
12121213 if test "$ENABLE_THREADS" -eq 1 ; then
12131214 AC_CHECK_HEADERS(pthread.h,
12141215 AC_SUBST(HAVE_PTHREAD, 1),
6666 check_include_file(termios.h HAVE_TERMIOS_H)
6767 check_include_file(unistd.h HAVE_UNISTD_H)
6868 check_include_file(utime.h HAVE_UTIME_H)
69 check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H)
6970 check_include_file(windows.h HAVE_WINDOWS_H)
7071
7172 # library checks
0 set(MSVC_LIB_DEPS_LLVMARMAsmParser LLVMARMInfo LLVMMCParser LLVMSupport)
1 set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
1 set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget)
22 set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
33 set(MSVC_LIB_DEPS_LLVMARMInfo LLVMSupport)
4 set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
4 set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget)
55 set(MSVC_LIB_DEPS_LLVMAlphaCodeGen LLVMAlphaInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
66 set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMSupport)
77 set(MSVC_LIB_DEPS_LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget)
1010 set(MSVC_LIB_DEPS_LLVMAsmPrinter LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
1111 set(MSVC_LIB_DEPS_LLVMBitReader LLVMCore LLVMSupport)
1212 set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport LLVMSystem)
13 set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
13 set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget)
1414 set(MSVC_LIB_DEPS_LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget)
1515 set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMSupport)
1616 set(MSVC_LIB_DEPS_LLVMCBackend LLVMAnalysis LLVMCBackendInfo LLVMCodeGen LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)
1717 set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMSupport)
18 set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
18 set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget)
1919 set(MSVC_LIB_DEPS_LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget)
2020 set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMSupport)
2121 set(MSVC_LIB_DEPS_LLVMCodeGen LLVMAnalysis LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils)
2828 set(MSVC_LIB_DEPS_LLVMInterpreter LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMSupport LLVMSystem LLVMTarget)
2929 set(MSVC_LIB_DEPS_LLVMJIT LLVMAnalysis LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMMC LLVMSupport LLVMSystem LLVMTarget)
3030 set(MSVC_LIB_DEPS_LLVMLinker LLVMArchive LLVMBitReader LLVMCore LLVMSupport LLVMSystem)
31 set(MSVC_LIB_DEPS_LLVMMBlazeAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMSupport LLVMTarget)
32 set(MSVC_LIB_DEPS_LLVMMBlazeCodeGen LLVMCodeGen LLVMCore LLVMMBlazeInfo LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
33 set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMSupport)
3134 set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem)
3235 set(MSVC_LIB_DEPS_LLVMMCParser LLVMMC LLVMSupport)
3336 set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMTarget LLVMTransformUtils LLVMipa)
3437 set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport)
35 set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget)
38 set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSupport LLVMTarget)
3639 set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
3740 set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMSupport)
38 set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMSystem LLVMTarget)
41 set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMTarget)
3942 set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMipsInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
4043 set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMSupport)
4144 set(MSVC_LIB_DEPS_LLVMPIC16 LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMTarget)
4245 set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMTarget)
4346 set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport)
44 set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSupport LLVMSystem LLVMTarget)
47 set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSupport LLVMTarget)
4548 set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
4649 set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMSupport)
4750 set(MSVC_LIB_DEPS_LLVMScalarOpts LLVMAnalysis LLVMCore LLVMInstCombine LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils)
48 set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
49 set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget)
51 set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
52 set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcInfo LLVMSupport LLVMTarget)
5053 set(MSVC_LIB_DEPS_LLVMSparcCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget)
5154 set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMSupport)
5255 set(MSVC_LIB_DEPS_LLVMSupport LLVMSystem)
5356 set(MSVC_LIB_DEPS_LLVMSystem )
54 set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMSystemZInfo LLVMTarget)
57 set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystemZInfo LLVMTarget)
5558 set(MSVC_LIB_DEPS_LLVMSystemZCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystemZInfo LLVMTarget)
5659 set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMSupport)
5760 set(MSVC_LIB_DEPS_LLVMTarget LLVMCore LLVMMC LLVMSupport)
5861 set(MSVC_LIB_DEPS_LLVMTransformUtils LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMipa)
59 set(MSVC_LIB_DEPS_LLVMX86AsmParser LLVMMC LLVMMCParser LLVMSupport LLVMX86Info)
60 set(MSVC_LIB_DEPS_LLVMX86AsmPrinter LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget LLVMX86CodeGen LLVMX86Info)
62 set(MSVC_LIB_DEPS_LLVMX86AsmParser LLVMMC LLVMMCParser LLVMSupport LLVMTarget LLVMX86Info)
63 set(MSVC_LIB_DEPS_LLVMX86AsmPrinter LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMX86CodeGen LLVMX86Info)
6164 set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86Info)
6265 set(MSVC_LIB_DEPS_LLVMX86Disassembler LLVMMC LLVMSupport LLVMX86Info)
6366 set(MSVC_LIB_DEPS_LLVMX86Info LLVMSupport)
6467 set(MSVC_LIB_DEPS_LLVMXCore LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMXCoreInfo)
65 set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo)
68 set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMXCoreInfo)
6669 set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMSupport)
6770 set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport LLVMSystem)
6871 set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)
1617616176
1617716177 done
1617816178
16179
16180 for ac_header in valgrind/valgrind.h
16181 do
16182 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16183 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16184 { echo "$as_me:$LINENO: checking for $ac_header" >&5
16185 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
16186 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16187 echo $ECHO_N "(cached) $ECHO_C" >&6
16188 fi
16189 ac_res=`eval echo '${'$as_ac_Header'}'`
16190 { echo "$as_me:$LINENO: result: $ac_res" >&5
16191 echo "${ECHO_T}$ac_res" >&6; }
16192 else
16193 # Is the header compilable?
16194 { echo "$as_me:$LINENO: checking $ac_header usability" >&5
16195 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
16196 cat >conftest.$ac_ext <<_ACEOF
16197 /* confdefs.h. */
16198 _ACEOF
16199 cat confdefs.h >>conftest.$ac_ext
16200 cat >>conftest.$ac_ext <<_ACEOF
16201 /* end confdefs.h. */
16202 $ac_includes_default
16203 #include <$ac_header>
16204 _ACEOF
16205 rm -f conftest.$ac_objext
16206 if { (ac_try="$ac_compile"
16207 case "(($ac_try" in
16208 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16209 *) ac_try_echo=$ac_try;;
16210 esac
16211 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16212 (eval "$ac_compile") 2>conftest.er1
16213 ac_status=$?
16214 grep -v '^ *+' conftest.er1 >conftest.err
16215 rm -f conftest.er1
16216 cat conftest.err >&5
16217 echo "$as_me:$LINENO: \$? = $ac_status" >&5
16218 (exit $ac_status); } &&
16219 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
16220 { (case "(($ac_try" in
16221 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16222 *) ac_try_echo=$ac_try;;
16223 esac
16224 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16225 (eval "$ac_try") 2>&5
16226 ac_status=$?
16227 echo "$as_me:$LINENO: \$? = $ac_status" >&5
16228 (exit $ac_status); }; } &&
16229 { ac_try='test -s conftest.$ac_objext'
16230 { (case "(($ac_try" in
16231 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16232 *) ac_try_echo=$ac_try;;
16233 esac
16234 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16235 (eval "$ac_try") 2>&5
16236 ac_status=$?
16237 echo "$as_me:$LINENO: \$? = $ac_status" >&5
16238 (exit $ac_status); }; }; then
16239 ac_header_compiler=yes
16240 else
16241 echo "$as_me: failed program was:" >&5
16242 sed 's/^/| /' conftest.$ac_ext >&5
16243
16244 ac_header_compiler=no
16245 fi
16246
16247 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16248 { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
16249 echo "${ECHO_T}$ac_header_compiler" >&6; }
16250
16251 # Is the header present?
16252 { echo "$as_me:$LINENO: checking $ac_header presence" >&5
16253 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
16254 cat >conftest.$ac_ext <<_ACEOF
16255 /* confdefs.h. */
16256 _ACEOF
16257 cat confdefs.h >>conftest.$ac_ext
16258 cat >>conftest.$ac_ext <<_ACEOF
16259 /* end confdefs.h. */
16260 #include <$ac_header>
16261 _ACEOF
16262 if { (ac_try="$ac_cpp conftest.$ac_ext"
16263 case "(($ac_try" in
16264 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16265 *) ac_try_echo=$ac_try;;
16266 esac
16267 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16268 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16269 ac_status=$?
16270 grep -v '^ *+' conftest.er1 >conftest.err
16271 rm -f conftest.er1
16272 cat conftest.err >&5
16273 echo "$as_me:$LINENO: \$? = $ac_status" >&5
16274 (exit $ac_status); } >/dev/null; then
16275 if test -s conftest.err; then
16276 ac_cpp_err=$ac_c_preproc_warn_flag
16277 ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
16278 else
16279 ac_cpp_err=
16280 fi
16281 else
16282 ac_cpp_err=yes
16283 fi
16284 if test -z "$ac_cpp_err"; then
16285 ac_header_preproc=yes
16286 else
16287 echo "$as_me: failed program was:" >&5
16288 sed 's/^/| /' conftest.$ac_ext >&5
16289
16290 ac_header_preproc=no
16291 fi
16292
16293 rm -f conftest.err conftest.$ac_ext
16294 { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
16295 echo "${ECHO_T}$ac_header_preproc" >&6; }
16296
16297 # So? What about this header?
16298 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
16299 yes:no: )
16300 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
16301 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16302 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
16303 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
16304 ac_header_preproc=yes
16305 ;;
16306 no:yes:* )
16307 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
16308 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
16309 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
16310 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
16311 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
16312 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
16313 { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
16314 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
16315 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16316 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16317 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
16318 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
16319 ( cat <<\_ASBOX
16320 ## ----------------------------------- ##
16321 ## Report this to llvmbugs@cs.uiuc.edu ##
16322 ## ----------------------------------- ##
16323 _ASBOX
16324 ) | sed "s/^/$as_me: WARNING: /" >&2
16325 ;;
16326 esac
16327 { echo "$as_me:$LINENO: checking for $ac_header" >&5
16328 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
16329 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16330 echo $ECHO_N "(cached) $ECHO_C" >&6
16331 else
16332 eval "$as_ac_Header=\$ac_header_preproc"
16333 fi
16334 ac_res=`eval echo '${'$as_ac_Header'}'`
16335 { echo "$as_me:$LINENO: result: $ac_res" >&5
16336 echo "${ECHO_T}$ac_res" >&6; }
16337
16338 fi
16339 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16340 cat >>confdefs.h <<_ACEOF
16341 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16342 _ACEOF
16343
16344 fi
16345
16346 done
16347
1617916348 if test "$ENABLE_THREADS" -eq 1 ; then
1618016349
1618116350 for ac_header in pthread.h
450450
451451 /* Define to 1 if the system has the type `u_int64_t'. */
452452 #undef HAVE_U_INT64_T
453
454 /* Define to 1 if you have the header file. */
455 #cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H}
453456
454457 /* Define to 1 if you have the header file. */
455458 #cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
439439 /* Define to 1 if the system has the type `u_int64_t'. */
440440 #undef HAVE_U_INT64_T
441441
442 /* Define to 1 if you have the header file. */
443 #undef HAVE_VALGRIND_VALGRIND_H
444
442445 /* Define to 1 if you have the header file. */
443446 #undef HAVE_WINDOWS_H
444447
0 //===- llvm/System/Valgrind.h - Communication with Valgrind -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Methods for communicating with a valgrind instance this program is running
10 // under. These are all no-ops unless LLVM was configured on a system with the
11 // valgrind headers installed and valgrind is controlling this process.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_SYSTEM_VALGRIND_H
16 #define LLVM_SYSTEM_VALGRIND_H
17
18 #include
19
20 namespace llvm {
21 namespace sys {
22 // True if Valgrind is controlling this process.
23 bool RunningOnValgrind();
24
25 // Discard valgrind's translation of code in the range [Addr .. Addr + Len).
26 // Otherwise valgrind may continue to execute the old version of the code.
27 void ValgrindDiscardTranslations(const void *Addr, size_t Len);
28 }
29 }
30
31 #endif
1616 ThreadLocal.cpp
1717 Threading.cpp
1818 TimeValue.cpp
19 Valgrind.cpp
1920 Unix/Alarm.inc
2021 Unix/Host.inc
2122 Unix/Memory.inc
1212 //===----------------------------------------------------------------------===//
1313
1414 #include "llvm/System/Memory.h"
15 #include "llvm/System/Valgrind.h"
1516 #include "llvm/Config/config.h"
1617
1718 namespace llvm {
6768 # endif
6869
6970 #endif // end apple
71
72 ValgrindDiscardTranslations(Addr, Len);
7073 }
0 //===-- Valgrind.cpp - Implement Valgrind communication ---------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Defines Valgrind communication methods, if HAVE_VALGRIND_VALGRIND_H is
10 // defined. If we have valgrind.h but valgrind isn't running, its macros are
11 // no-ops.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "llvm/System/Valgrind.h"
16 #include "llvm/Config/config.h"
17
18 #if HAVE_VALGRIND_VALGRIND_H
19 #include
20
21 static bool InitNotUnderValgrind() {
22 return !RUNNING_ON_VALGRIND;
23 }
24
25 // This bool is negated from what we'd expect because code may run before it
26 // gets initialized. If that happens, it will appear to be 0 (false), and we
27 // want that to cause the rest of the code in this file to run the
28 // Valgrind-provided macros.
29 static const bool NotUnderValgrind = InitNotUnderValgrind();
30
31 bool llvm::sys::RunningOnValgrind() {
32 if (NotUnderValgrind)
33 return false;
34 return RUNNING_ON_VALGRIND;
35 }
36
37 void llvm::sys::ValgrindDiscardTranslations(const void *Addr, size_t Len) {
38 if (NotUnderValgrind)
39 return;
40
41 VALGRIND_DISCARD_TRANSLATIONS(Addr, Len);
42 }
43
44 #else // !HAVE_VALGRIND_VALGRIND_H
45
46 bool llvm::sys::RunningOnValgrind() {
47 return false;
48 }
49
50 void llvm::sys::ValgrindDiscardTranslations(const void *Addr, size_t Len) {
51 }
52
53 #endif // !HAVE_VALGRIND_VALGRIND_H
1818 #include "llvm/Function.h"
1919 #include "llvm/Support/Compiler.h"
2020 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/System/Valgrind.h"
2122 #include
2223 #include
2324 using namespace llvm;
3637 unsigned NewAddr = (intptr_t)New;
3738 unsigned OldAddr = (intptr_t)OldWord;
3839 *OldWord = NewAddr - OldAddr - 4; // Emit PC-relative addr of New code.
40
41 // X86 doesn't need to invalidate the processor cache, so just invalidate
42 // Valgrind's cache directly.
43 sys::ValgrindDiscardTranslations(Old, 5);
3944 }
4045
4146
392397 *(intptr_t *)(RetAddr - 0xa) = NewVal;
393398 ((unsigned char*)RetAddr)[0] = (2 | (4 << 3) | (3 << 6));
394399 }
400 sys::ValgrindDiscardTranslations((void*)(RetAddr-0xc), 0xd);
395401 #else
396402 ((unsigned char*)RetAddr)[-1] = 0xE9;
403 sys::ValgrindDiscardTranslations((void*)(RetAddr-1), 5);
397404 #endif
398405 }
399406