diff --git a/.gitignore b/.gitignore index c736bbf..e45207e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ CMakeFiles CMakeCache *.cmake *.so +build +compile_commands.json +.cache +*.dot diff --git a/CMakeCache.txt b/CMakeCache.txt deleted file mode 100644 index 6f41893..0000000 --- a/CMakeCache.txt +++ /dev/null @@ -1,322 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/hebi/github/callgraph -# It was generated by CMake: /usr/local/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//For backwards compatibility, what version of CMake commands and -// syntax should this version of CMake try to support. -CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4 - -//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or -// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ - -//Flags used by the compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc - -//Flags used by the compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake - -//Flags used by the linker during the creation of modules. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=Project - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Flags used by the linker during the creation of dll's. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Single output directory for building all executables. -EXECUTABLE_OUTPUT_PATH:PATH= - -//Dependencies for target -HebiCallGraphPass_LIB_DEPENDS:STATIC= - -//Single output directory for building all libraries. -LIBRARY_OUTPUT_PATH:PATH= - -//The directory containing a CMake configuration file for LLVM. -LLVM_DIR:PATH=/usr/local/lib/cmake/llvm - -//Value Computed by CMake -Project_BINARY_DIR:STATIC=/home/hebi/github/callgraph - -//Value Computed by CMake -Project_SOURCE_DIR:STATIC=/home/hebi/github/callgraph - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/hebi/github/callgraph -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=4 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/local/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/hebi/github/callgraph -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=2 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/local/share/cmake-3.4 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/CMakeLists.txt b/CMakeLists.txt index e4258fc..258c201 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,16 @@ -find_package(LLVM REQUIRED CONFIG) +project(LLVMCallGraph) +cmake_minimum_required(VERSION 3.19) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) +find_package(LLVM REQUIRED CONFIG) +message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") +message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") add_definitions(${LLVM_DEFINITIONS}) -add_definitions(-std=c++11) include_directories(${LLVM_INCLUDE_DIRS}) -SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti") +list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") +include(AddLLVM) + +SET(CMAKE_CXX_FLAGS "-Wall -fno-rtti ") add_subdirectory(hebicg) diff --git a/Makefile b/Makefile deleted file mode 100644 index 3dc166b..0000000 --- a/Makefile +++ /dev/null @@ -1,148 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.4 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/bin/cmake - -# The command to remove a file. -RM = /usr/local/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/hebi/github/callgraph - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/hebi/github/callgraph - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/hebi/github/callgraph/CMakeFiles /home/hebi/github/callgraph/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/hebi/github/callgraph/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named HebiCallGraphPass - -# Build rule for target. -HebiCallGraphPass: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 HebiCallGraphPass -.PHONY : HebiCallGraphPass - -# fast build rule for target. -HebiCallGraphPass/fast: - $(MAKE) -f hebicg/CMakeFiles/HebiCallGraphPass.dir/build.make hebicg/CMakeFiles/HebiCallGraphPass.dir/build -.PHONY : HebiCallGraphPass/fast - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... HebiCallGraphPass" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/README.org b/README.org index d5810fc..b27587a 100644 --- a/README.org +++ b/README.org @@ -1,11 +1,11 @@ #+TITLE: Call Graph Construction -The code is tested under =LLVM 3.9.0= +The code is tested under =LLVM 11.0.1= * Compile and Run To compile the tool itself, run the following commands in root directory: #+BEGIN_SRC shell -cmake . -make +cmake -S . -B ./build/ +make -C ./build/ #+END_SRC This will generate =hebicg/libHebiCallGraphPass.so= @@ -42,7 +42,7 @@ llvm-link *.bc -o single.bc To run the tool against the bitcode file, issue the following command #+BEGIN_SRC shell -opt -load ../hebicg/libHebiCallGraphPass.so -hebicg /path/to/benchmark.bc +opt -load ../build/hebicg/libHebiCallGraphPass.so -hebicg /path/to/benchmark.bc #+END_SRC The call graph will be outputed as text format, as well as an =out.dot= file. @@ -88,3 +88,9 @@ Similarly, for another real world benchmark, the =make-4.1=, call graph for =mak the complete call graph is: [[./make-single.png]] + +* Related LLVM Documentation + +https://llvm.org/docs/WritingAnLLVMPass.html + +https://llvm.org/docs/CMake.html#cmake-out-of-source-pass diff --git a/benchmark/.gitignore b/benchmark/.gitignore new file mode 100644 index 0000000..52fe5b3 --- /dev/null +++ b/benchmark/.gitignore @@ -0,0 +1,3 @@ +*.bc +*.ll +*.dot diff --git a/benchmark/Makefile b/benchmark/Makefile index 5232177..544651c 100644 --- a/benchmark/Makefile +++ b/benchmark/Makefile @@ -9,8 +9,8 @@ simple-c-func.bc : simple-c-func.c llvm-dis $@ test: - opt -load ../hebicg/libHebiCallGraphPass.so -hebicg test1.bc - opt -load ../hebicg/libHebiCallGraphPass.so -hebicg simple-c-func.bc + opt -load ../build/hebicg/libHebiCallGraphPass.so -hebicg test1.bc + opt -load ../build/hebicg/libHebiCallGraphPass.so -hebicg simple-c-func.bc png: dot -Tpng out.dot -o out.png diff --git a/benchmark/out.dot b/benchmark/out.dot deleted file mode 100644 index cf77b6f..0000000 --- a/benchmark/out.dot +++ /dev/null @@ -1,1068 +0,0 @@ -digraph { -main -> debug_prog; -debug_prog -> push_cmd_src; -push_cmd_src -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -r_fatal -> err; -err -> gawk_exit; -gawk_exit -> final_exit; -final_exit -> close_extensions; -final_exit -> run_ext_exit_handlers; -debug_prog -> unserialize; -unserialize -> unserialize_breakpoint; -unserialize_breakpoint -> set_breakpoint_at; -set_breakpoint_at -> add_breakpoint; -add_breakpoint -> mk_breakpoint; -mk_breakpoint -> emalloc_real; -mk_breakpoint -> bcalloc; -bcalloc -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -unserialize_breakpoint -> unserialize_commands; -unserialize_commands -> push_cmd_src; -unserialize_commands -> pop_cmd_src; -unserialize_commands -> zzparse; -zzparse -> has_break_or_watch_point; -zzparse -> find_option; -zzparse -> negate_num; -zzparse -> in_cmd_src; -zzparse -> find_command; -zzparse -> zzlex; -zzlex -> pop_cmd_src; -zzlex -> make_str_node; -make_str_node -> set_loc; -make_str_node -> more_blocks; -more_blocks -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -make_str_node -> emalloc_real; -make_str_node -> parse_escape; -parse_escape -> r_warning; -r_warning -> err; -parse_escape -> set_loc; -make_str_node -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -zzlex -> is_alpha; -zzlex -> is_identchar; -is_identchar -> is_alnum; -is_alnum -> is_alpha; -zzlex -> get_eof_status; -zzlex -> find_command; -zzlex -> zzerror; -zzlex -> mk_cmdarg; -mk_cmdarg -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -zzlex -> emalloc_real; -zzlex -> append_cmdarg; -zzlex -> unref; -unref -> r_unref; -r_unref -> mpfr_unset; -r_unref -> r_free_wstr; -zzlex -> d_error; -zzlex -> estrdup; -estrdup -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -zzparse -> zzerror; -zzparse -> mk_cmdarg; -zzparse -> append_cmdarg; -zzparse -> free_cmdarg; -free_cmdarg -> unref; -zzparse -> append_statement; -append_statement -> mk_cmdarg; -append_statement -> emalloc_real; -append_statement -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -zzparse -> find_argument; -zzparse -> concat_args; -concat_args -> make_str_node; -concat_args -> emalloc_real; -concat_args -> force_string; -concat_args -> dupnode; -dupnode -> r_dupnode; -r_dupnode -> more_blocks; -r_dupnode -> emalloc_real; -zzparse -> yydestruct; -zzparse -> lookup; -lookup -> make_str_node; -lookup -> in_array; -lookup -> unref; -unref -> r_unref; -zzparse -> estrdup; -unserialize_breakpoint -> source_find; -source_find -> d_error; -source_find -> files_are_same; -source_find -> find_source; -find_source -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -find_source -> do_find_source; -do_find_source -> ispath; -do_find_source -> emalloc_real; -do_find_source -> init_awkpath; -init_awkpath -> isdirpunct; -init_awkpath -> emalloc_real; -init_awkpath -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -unserialize_breakpoint -> parse_condition; -parse_condition -> add_srcfile; -add_srcfile -> set_loc; -add_srcfile -> r_fatal; -add_srcfile -> lintwarn_ln; -lintwarn_ln -> err; -lintwarn_ln -> gawk_exit; -lintwarn_ln -> print_included_from; -print_included_from -> msg; -msg -> err; -add_srcfile -> do_add_srcfile; -do_add_srcfile -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -do_add_srcfile -> estrdup; -add_srcfile -> files_are_same; -add_srcfile -> find_source; -parse_condition -> parse_program; -parse_program -> yyparse; -yyparse -> msg; -yyparse -> set_loc; -yyparse -> r_fatal; -yyparse -> make_str_node; -yyparse -> yylex; -yylex -> r_warning; -yylex -> set_loc; -yylex -> get_numbase; -yylex -> make_str_node; -yylex -> nextc; -nextc -> get_src_buf; -get_src_buf -> error; -error -> err; -get_src_buf -> set_loc; -get_src_buf -> emalloc_real; -get_src_buf -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -get_src_buf -> optimal_bufsize; -optimal_bufsize -> set_loc; -optimal_bufsize -> r_fatal; -get_src_buf -> srcopen; -srcopen -> os_setbinmode; -srcopen -> devopen; -devopen -> os_close_on_exec; -os_close_on_exec -> r_warning; -os_close_on_exec -> set_loc; -devopen -> devopen_simple; -devopen_simple -> os_devopen; -devopen_simple -> os_close_on_exec; -devopen_simple -> str2mode; -str2mode -> r_fatal; -devopen -> str2mode; -devopen -> inetfile; -devopen -> socketopen; -socketopen -> set_loc; -socketopen -> r_fatal; -nextc -> check_bad_char; -check_bad_char -> set_loc; -check_bad_char -> r_fatal; -yylex -> check_special; -yylex -> emalloc_real; -yylex -> newline_eof; -newline_eof -> set_loc; -newline_eof -> pushback; -yylex -> pushback; -yylex -> yyerror; -yyerror -> err; -yyerror -> msg; -yyerror -> emalloc_real; -yyerror -> print_included_from; -yylex -> tokexpand; -tokexpand -> emalloc_real; -tokexpand -> erealloc_real; -yylex -> allow_newline; -allow_newline -> nextc; -allow_newline -> pushback; -yylex -> dumpintlstr; -dumpintlstr -> pp_string_fp; -pp_string_fp -> pp_string; -pp_string -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -pp_string -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -yylex -> is_alpha; -yylex -> is_identchar; -yylex -> error_ln; -error_ln -> err; -error_ln -> print_included_from; -yylex -> nondec2awknum; -yylex -> bcalloc; -yylex -> estrdup; -yyparse -> count_expressions; -count_expressions -> list_merge; -list_merge -> bcfree; -count_expressions -> bcfree; -yyparse -> optimize_assignment; -optimize_assignment -> list_append; -optimize_assignment -> bcfree; -optimize_assignment -> bcalloc; -yyparse -> force_number; -yyparse -> negate_num; -yyparse -> mk_condition; -mk_condition -> list_append; -mk_condition -> list_prepend; -mk_condition -> list_create; -list_create -> bcalloc; -mk_condition -> list_merge; -mk_condition -> add_lint; -add_lint -> list_append; -add_lint -> lintwarn_ln; -add_lint -> isnoeffect; -add_lint -> bcalloc; -mk_condition -> bcfree; -mk_condition -> bcalloc; -yyparse -> mk_expression_list; -mk_expression_list -> bcalloc; -yyparse -> mk_assignment; -mk_assignment -> opcode2str; -opcode2str -> set_loc; -opcode2str -> r_fatal; -mk_assignment -> yyerror; -mk_assignment -> list_append; -mk_assignment -> list_merge; -mk_assignment -> bcalloc; -yyparse -> mk_boolean; -mk_boolean -> list_append; -mk_boolean -> list_merge; -mk_boolean -> add_lint; -mk_boolean -> bcalloc; -yyparse -> mk_binary; -mk_binary -> calc_exp; -calc_exp -> calc_exp_posint; -mk_binary -> force_number; -mk_binary -> error_ln; -mk_binary -> list_append; -mk_binary -> list_create; -mk_binary -> list_merge; -mk_binary -> unref; -unref -> r_unref; -mk_binary -> bcfree; -yyparse -> emalloc_real; -yyparse -> erealloc_real; -yyparse -> yyerror; -yyparse -> error_ln; -yyparse -> next_sourcefile; -yyparse -> append_rule; -append_rule -> list_append; -append_rule -> list_prepend; -append_rule -> find_line; -append_rule -> list_create; -append_rule -> list_merge; -append_rule -> bcalloc; -yyparse -> list_append; -yyparse -> list_prepend; -yyparse -> list_create; -yyparse -> list_merge; -yyparse -> mk_function; -mk_function -> list_append; -mk_function -> list_prepend; -mk_function -> dupnode; -dupnode -> r_dupnode; -mk_function -> func_use; -func_use -> emalloc_real; -mk_function -> remove_params; -remove_params -> make_str_node; -remove_params -> in_array; -remove_params -> unref; -mk_function -> bcfree; -mk_function -> bcalloc; -yyparse -> dupnode; -yyparse -> func_use; -yyparse -> include_source; -include_source -> error_ln; -include_source -> lintwarn_ln; -include_source -> add_srcfile; -yyparse -> lintwarn_ln; -yyparse -> load_library; -load_library -> error_ln; -load_library -> lintwarn_ln; -load_library -> add_srcfile; -load_library -> load_ext; -load_ext -> r_warning; -load_ext -> set_loc; -load_ext -> r_fatal; -yyparse -> add_lint; -yyparse -> warning_ln; -warning_ln -> err; -warning_ln -> print_included_from; -yyparse -> install_function; -install_function -> error_ln; -install_function -> check_params; -check_params -> emalloc_real; -check_params -> error_ln; -check_params -> bcfree; -check_params -> is_std_var; -install_function -> install_symbol; -install_symbol -> install; -install -> make_str_node; -install -> make_symbol; -make_symbol -> more_blocks; -make_symbol -> null_array; -make_symbol -> dupnode; -dupnode -> r_dupnode; -install -> in_array; -install -> unref; -install_function -> lookup; -install_function -> make_params; -make_params -> emalloc_real; -install_function -> install_params; -install_params -> install; -yyparse -> make_regnode; -make_regnode -> more_blocks; -make_regnode -> make_regexp; -make_regexp -> error; -make_regexp -> set_loc; -make_regexp -> r_fatal; -make_regexp -> parse_escape; -make_regexp -> re_compile_pattern; -re_compile_pattern -> re_compile_internal; -re_compile_internal -> test_realloc; -re_compile_internal -> init_dfa; -init_dfa -> test_malloc; -re_compile_internal -> free_dfa_content; -free_dfa_content -> free_token; -free_token -> free_charset; -free_dfa_content -> free_state; -re_compile_internal -> re_string_construct; -re_string_construct -> re_string_construct_common; -re_string_construct -> re_string_realloc_buffers; -re_string_realloc_buffers -> test_realloc; -re_string_realloc_buffers -> MAX; -re_string_construct -> build_wcs_upper_buffer; -build_wcs_upper_buffer -> test_malloc; -re_string_construct -> build_upper_buffer; -re_string_construct -> build_wcs_buffer; -re_string_construct -> re_string_translate_buffer; -re_compile_internal -> free_workarea_compile; -re_compile_internal -> re_string_destruct; -re_compile_internal -> parse; -parse -> fetch_token; -fetch_token -> peek_token; -peek_token -> peek_token; -peek_token -> re_string_peek_byte_case; -peek_token -> re_string_wchar_at; -parse -> parse_reg_exp; -parse_reg_exp -> fetch_token; -parse_reg_exp -> parse_branch; -parse_branch -> parse_expression; -parse_expression -> fetch_token; -parse_expression -> parse_expression; -parse_expression -> create_token_tree; -create_token_tree -> test_malloc; -parse_expression -> create_tree; -create_tree -> create_token_tree; -parse_expression -> parse_sub_exp; -parse_sub_exp -> fetch_token; -parse_sub_exp -> parse_reg_exp; -parse_sub_exp -> create_tree; -parse_sub_exp -> postorder; -parse_expression -> postorder; -parse_expression -> parse_bracket_exp; -parse_bracket_exp -> test_realloc; -parse_bracket_exp -> free_charset; -parse_bracket_exp -> create_token_tree; -parse_bracket_exp -> create_tree; -parse_bracket_exp -> peek_token_bracket; -parse_bracket_exp -> parse_bracket_element; -parse_bracket_element -> re_string_wchar_at; -parse_bracket_element -> peek_token_bracket; -parse_bracket_element -> re_string_char_size_at; -parse_bracket_element -> parse_bracket_symbol; -parse_bracket_symbol -> re_string_fetch_byte_case; -re_string_fetch_byte_case -> re_string_char_size_at; -parse_bracket_exp -> build_range_exp; -build_range_exp -> test_realloc; -parse_bracket_exp -> build_equiv_class; -parse_bracket_exp -> build_collating_symbol; -parse_bracket_exp -> build_charclass; -build_charclass -> test_realloc; -build_charclass -> is_blank; -parse_bracket_exp -> bitset_not; -parse_bracket_exp -> bitset_mask; -parse_expression -> init_word_char; -parse_expression -> build_charclass_op; -build_charclass_op -> free_charset; -build_charclass_op -> create_token_tree; -build_charclass_op -> create_tree; -build_charclass_op -> build_charclass; -build_charclass_op -> bitset_not; -build_charclass_op -> bitset_mask; -parse_expression -> parse_dup_op; -parse_dup_op -> fetch_token; -parse_dup_op -> create_tree; -parse_dup_op -> postorder; -parse_dup_op -> fetch_number; -fetch_number -> fetch_token; -parse_dup_op -> duplicate_tree; -duplicate_tree -> create_token_tree; -parse_branch -> create_tree; -parse_branch -> postorder; -parse_reg_exp -> create_tree; -parse_reg_exp -> postorder; -parse -> create_tree; -re_compile_internal -> analyze; -analyze -> test_malloc; -analyze -> postorder; -analyze -> preorder; -analyze -> calc_eclosure; -calc_eclosure -> calc_eclosure_iter; -calc_eclosure_iter -> calc_eclosure_iter; -calc_eclosure_iter -> re_node_set_alloc; -re_node_set_alloc -> test_malloc; -calc_eclosure_iter -> duplicate_node_closure; -duplicate_node_closure -> duplicate_node_closure; -duplicate_node_closure -> duplicate_node; -duplicate_node -> re_dfa_add_node; -re_dfa_add_node -> test_realloc; -re_dfa_add_node -> MAX; -duplicate_node_closure -> re_node_set_insert; -re_node_set_insert -> test_realloc; -re_node_set_insert -> re_node_set_init_1; -re_node_set_init_1 -> test_malloc; -duplicate_node_closure -> search_duplicated_node; -calc_eclosure_iter -> re_node_set_insert; -calc_eclosure_iter -> re_node_set_merge; -re_node_set_merge -> test_realloc; -analyze -> calc_inveclosure; -calc_inveclosure -> re_node_set_insert_last; -re_node_set_insert_last -> test_realloc; -re_compile_internal -> optimize_utf8; -re_compile_internal -> create_initial_state; -create_initial_state -> re_node_set_merge; -create_initial_state -> re_node_set_init_copy; -re_node_set_init_copy -> test_malloc; -create_initial_state -> re_node_set_contains; -create_initial_state -> re_acquire_state_context; -re_acquire_state_context -> calc_state_hash; -re_acquire_state_context -> re_node_set_compare; -re_acquire_state_context -> create_cd_newstate; -create_cd_newstate -> test_malloc; -create_cd_newstate -> free_state; -create_cd_newstate -> re_node_set_init_copy; -create_cd_newstate -> re_node_set_remove_at; -create_cd_newstate -> register_state; -register_state -> test_realloc; -register_state -> re_node_set_alloc; -register_state -> re_node_set_insert_last; -make_regexp -> dfacomp; -dfacomp -> dfaanalyze; -dfaanalyze -> xnmalloc; -xnmalloc -> xalloc_die; -xalloc_die -> r_fatal; -xnmalloc -> xmalloc; -xmalloc -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -dfaanalyze -> alloc_position_set; -alloc_position_set -> xnmalloc; -dfaanalyze -> merge; -merge -> maybe_realloc; -maybe_realloc -> x2nrealloc; -x2nrealloc -> xrealloc; -xrealloc -> xalloc_die; -x2nrealloc -> xalloc_die; -dfaanalyze -> copy; -copy -> x2nrealloc; -dfaanalyze -> epsclosure; -epsclosure -> delete; -epsclosure -> insert; -insert -> maybe_realloc; -dfaanalyze -> insert; -dfaanalyze -> state_separate_contexts; -dfaanalyze -> state_index; -state_index -> alloc_position_set; -state_index -> copy; -state_index -> maybe_realloc; -dfaanalyze -> xcalloc; -xcalloc -> xmalloc; -dfacomp -> dfainit; -dfacomp -> dfambcache; -dfacomp -> dfamust; -dfamust -> tstbit; -dfamust -> allocmust; -allocmust -> xzalloc; -xzalloc -> xmalloc; -allocmust -> xmalloc; -dfamust -> resetmust; -resetmust -> freelist; -dfamust -> freelist; -dfamust -> inboth; -inboth -> freelist; -inboth -> comsubs; -comsubs -> enlist; -enlist -> xnrealloc; -xnrealloc -> xrealloc; -xnrealloc -> xalloc_die; -enlist -> xmalloc; -comsubs -> xzalloc; -inboth -> addlists; -addlists -> enlist; -inboth -> xzalloc; -dfamust -> enlist; -dfamust -> addlists; -dfamust -> freemust; -freemust -> freelist; -dfamust -> icatalloc; -icatalloc -> xrealloc; -dfamust -> xstrdup; -xstrdup -> r_fatal; -xstrdup -> xmemdup; -xmemdup -> xmalloc; -dfamust -> xmalloc; -dfacomp -> dfassbuild; -dfassbuild -> xnmalloc; -dfassbuild -> dfaalloc; -dfaalloc -> xmalloc; -dfassbuild -> dfafree; -dfafree -> dfafree; -dfafree -> free_mbdata; -dfassbuild -> zeroset; -dfassbuild -> notset; -dfassbuild -> dfa_charclass_index; -dfa_charclass_index -> equal; -dfa_charclass_index -> maybe_realloc; -dfa_charclass_index -> copyset; -dfacomp -> dfaoptimize; -dfaoptimize -> dfafree; -dfaoptimize -> free_mbdata; -dfaoptimize -> using_utf8; -dfacomp -> dfaparse; -dfaparse -> regexp; -regexp -> branch; -branch -> closure; -closure -> closure; -closure -> atom; -atom -> case_folded_counterparts; -atom -> regexp; -atom -> addtok; -addtok -> addtok; -addtok -> addtok_wc; -addtok_wc -> addtok; -addtok_wc -> addtok_mb; -addtok_mb -> xnrealloc; -addtok_mb -> x2nrealloc; -addtok -> addtok_mb; -atom -> addtok_wc; -atom -> add_utf8_anychar; -add_utf8_anychar -> addtok; -add_utf8_anychar -> clrbit; -add_utf8_anychar -> charclass_index; -charclass_index -> dfa_charclass_index; -add_utf8_anychar -> copyset; -atom -> using_utf8; -atom -> lex; -lex -> setbit_case_fold_c; -setbit_case_fold_c -> setbit; -lex -> setbit; -lex -> mbs_to_wchar; -lex -> to_uchar; -lex -> zeroset; -lex -> notset; -lex -> clrbit; -lex -> charclass_index; -lex -> parse_bracket_exp; -parse_bracket_exp -> setbit_case_fold_c; -parse_bracket_exp -> case_folded_counterparts; -parse_bracket_exp -> setbit_wc; -setbit_wc -> setbit; -parse_bracket_exp -> setbit; -parse_bracket_exp -> mbs_to_wchar; -parse_bracket_exp -> to_uchar; -parse_bracket_exp -> notset; -parse_bracket_exp -> clrbit; -parse_bracket_exp -> charclass_index; -parse_bracket_exp -> equal; -parse_bracket_exp -> maybe_realloc; -parse_bracket_exp -> using_simple_locale; -parse_bracket_exp -> find_pred; -parse_bracket_exp -> dfaerror; -dfaerror -> set_loc; -dfaerror -> r_fatal; -parse_bracket_exp -> dfawarn; -lex -> dfaerror; -atom -> dfaerror; -closure -> addtok; -closure -> nsubtoks; -nsubtoks -> nsubtoks; -closure -> copytoks; -copytoks -> addtok_mb; -closure -> lex; -branch -> addtok; -regexp -> addtok; -regexp -> lex; -dfaparse -> addtok; -dfaparse -> lex; -dfaparse -> dfaerror; -make_regexp -> dfaalloc; -make_regexp -> dfasyntax; -dfasyntax -> char_context; -dfasyntax -> setbit; -make_regexp -> re_set_syntax; -make_regexp -> check_bracket_exp; -check_bracket_exp -> r_warning; -check_bracket_exp -> set_loc; -make_regexp -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -make_regexp -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -make_regexp -> refree; -refree -> dfafree; -refree -> regfree; -regfree -> free_dfa_content; -yyparse -> unref; -yyparse -> force_string; -yyparse -> fix_break_continue; -yyparse -> make_assignable; -yyparse -> variable; -variable -> error_ln; -variable -> install_symbol; -variable -> lookup; -yyparse -> mk_for_loop; -mk_for_loop -> list_append; -mk_for_loop -> list_prepend; -mk_for_loop -> list_create; -mk_for_loop -> list_merge; -mk_for_loop -> add_lint; -mk_for_loop -> fix_break_continue; -mk_for_loop -> bcalloc; -yyparse -> mk_getline; -mk_getline -> list_append; -mk_getline -> list_create; -mk_getline -> list_merge; -mk_getline -> make_assignable; -mk_getline -> bcfree; -mk_getline -> bcalloc; -yyparse -> snode; -snode -> r_warning; -snode -> set_loc; -snode -> r_fatal; -snode -> count_expressions; -snode -> mk_expression_list; -snode -> yyerror; -snode -> dumpintlstr; -snode -> list_append; -snode -> list_prepend; -snode -> list_create; -snode -> make_assignable; -snode -> mk_rexp; -mk_rexp -> make_regnode; -mk_rexp -> bcalloc; -snode -> dumpintlstr2; -dumpintlstr2 -> pp_string_fp; -snode -> bcalloc; -yyparse -> param_sanity; -param_sanity -> warning_ln; -yyparse -> yydestruct; -yyparse -> lookup; -yyparse -> bcfree; -yyparse -> bcalloc; -yyparse -> estrdup; -yyparse -> is_std_var; -parse_program -> emalloc_real; -parse_program -> erealloc_real; -parse_program -> tokexpand; -parse_program -> mk_program; -mk_program -> list_append; -mk_program -> list_prepend; -mk_program -> list_create; -mk_program -> list_merge; -mk_program -> bcfree; -mk_program -> bcalloc; -parse_program -> check_funcs; -check_funcs -> set_loc; -parse_program -> check_param_names; -check_param_names -> error; -check_param_names -> assoc_list; -assoc_list -> set_loc; -assoc_list -> r_fatal; -assoc_list -> PUSH_CODE; -PUSH_CODE -> more_blocks; -PUSH_CODE -> grow_stack; -grow_stack -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -assoc_list -> POP_CODE; -assoc_list -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -assoc_list -> lookup; -assoc_list -> bcfree; -assoc_list -> bcalloc; -check_param_names -> in_array; -parse_program -> bcalloc; -parse_condition -> find_frame; -parse_condition -> find_breakpoint; -parse_condition -> find_rule; -parse_condition -> find_item; -parse_condition -> install_params; -parse_condition -> remove_params; -parse_condition -> bcalloc; -parse_condition -> new_context; -new_context -> emalloc_real; -parse_condition -> push_context; -push_context -> set_context; -parse_condition -> free_context; -free_context -> release_symbols; -release_symbols -> destroy_symbol; -destroy_symbol -> unref; -destroy_symbol -> remove_symbol; -remove_symbol -> dupnode; -remove_symbol -> in_array; -destroy_symbol -> bcfree; -free_context -> free_bcpool; -free_bcpool -> free_bc_internal; -free_bc_internal -> r_fatal; -free_bc_internal -> unref; -free_bc_internal -> refree; -unserialize_breakpoint -> find_rule; -unserialize_breakpoint -> estrdup; -unserialize -> unserialize_list_item; -unserialize_list_item -> initialize_watch_item; -initialize_watch_item -> find_subscript; -find_subscript -> in_array; -initialize_watch_item -> d_error; -initialize_watch_item -> dupnode; -dupnode -> r_dupnode; -initialize_watch_item -> get_field; -get_field -> rebuild_record; -rebuild_record -> more_blocks; -rebuild_record -> r_free_wstr; -rebuild_record -> make_str_node; -rebuild_record -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -rebuild_record -> force_string; -rebuild_record -> unref; -unref -> r_unref; -get_field -> grow_fields_arr; -grow_fields_arr -> more_blocks; -grow_fields_arr -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -unserialize_list_item -> unserialize_commands; -unserialize_list_item -> make_str_node; -unserialize_list_item -> find_symbol; -find_symbol -> find_param; -find_param -> find_frame; -find_symbol -> lookup; -unserialize_list_item -> emalloc_real; -unserialize_list_item -> add_item; -add_item -> emalloc_real; -unserialize_list_item -> parse_condition; -unserialize_list_item -> estrdup; -unserialize -> unserialize_option; -unserialize_option -> estrdup; -debug_prog -> do_run; -do_run -> pop_cmd_src; -do_run -> restart; -restart -> serialize; -serialize -> serialize_subscript; -serialize -> emalloc_real; -serialize -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -restart -> close_all; -close_all -> set_gawk_output; -set_gawk_output -> d_error; -set_gawk_output -> os_devopen; -set_gawk_output -> os_isatty; -set_gawk_output -> estrdup; -close_all -> close_extensions; -close_all -> nextfile; -nextfile -> set_loc; -nextfile -> r_fatal; -nextfile -> make_str_node; -nextfile -> update_ERRNO_int; -update_ERRNO_int -> make_str_node; -update_ERRNO_int -> unref; -unref -> r_unref; -nextfile -> iop_close; -iop_close -> r_warning; -iop_close -> set_loc; -iop_close -> make_str_node; -iop_close -> remap_std_file; -remap_std_file -> os_devopen; -iop_close -> unref; -unref -> r_unref; -nextfile -> unref; -nextfile -> force_string; -nextfile -> in_array; -nextfile -> dupnode; -dupnode -> r_dupnode; -nextfile -> devopen; -nextfile -> close_one; -close_one -> r_warning; -close_one -> set_loc; -close_one -> r_fatal; -nextfile -> iop_alloc; -iop_alloc -> emalloc_real; -nextfile -> iop_finish; -iop_finish -> set_loc; -iop_finish -> optimal_bufsize; -iop_finish -> os_isreadable; -iop_finish -> os_isatty; -iop_finish -> emalloc_real; -nextfile -> arg_assign; -arg_assign -> final_exit; -arg_assign -> set_loc; -arg_assign -> r_fatal; -arg_assign -> make_str_node; -arg_assign -> r_get_lhs; -r_get_lhs -> set_loc; -r_get_lhs -> r_fatal; -r_get_lhs -> dupnode; -dupnode -> r_dupnode; -r_get_lhs -> array_vname; -array_vname -> make_aname; -make_aname -> make_aname; -make_aname -> erealloc_real; -make_aname -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -array_vname -> erealloc_real; -array_vname -> emalloc_real; -arg_assign -> check_special; -arg_assign -> is_alpha; -arg_assign -> is_identchar; -arg_assign -> variable; -arg_assign -> lookup; -arg_assign -> usage; -usage -> r_warning; -usage -> set_loc; -arg_assign -> estrdup; -arg_assign -> unref; -unref -> r_unref; -arg_assign -> force_number; -close_all -> close_io; -close_io -> r_warning; -close_io -> set_loc; -close_io -> close_redir; -close_redir -> r_warning; -close_redir -> set_loc; -close_redir -> update_ERRNO_int; -close_redir -> close_rp; -close_rp -> os_setbinmode; -close_rp -> iop_close; -close_rp -> gawk_pclose; -gawk_pclose -> iop_close; -gawk_pclose -> wait_any; -close_redir -> free_rp; -do_run -> prompt_yes_no; -debug_prog -> open_readfd; -open_readfd -> os_isdir; -debug_prog -> zzparse; -debug_prog -> os_isatty; -debug_prog -> estrdup; -main -> final_exit; -main -> r_warning; -main -> set_loc; -main -> r_fatal; -main -> make_str_node; -main -> init_profiling_signals; -main -> dump_prog; -dump_prog -> print_lib_list; -dump_prog -> pprint; -pprint -> set_loc; -pprint -> r_fatal; -pprint -> pprint; -pprint -> indent; -pprint -> pp_pop; -pprint -> pp_free; -pprint -> indent_in; -pprint -> indent_out; -pprint -> pp_push; -pp_push -> more_blocks; -pprint -> pp_number; -pp_number -> emalloc_real; -pprint -> emalloc_real; -pprint -> pp_string; -pprint -> pp_group3; -pp_group3 -> emalloc_real; -pprint -> pp_node; -pp_node -> pp_number; -pp_node -> pp_string; -pprint -> pp_list; -pp_list -> pp_pop; -pp_list -> pp_free; -pp_list -> emalloc_real; -pp_list -> erealloc_real; -pprint -> parenthesize; -parenthesize -> prec_level; -parenthesize -> div_on_left_mul_on_right; -parenthesize -> pp_parenthesize; -pp_parenthesize -> emalloc_real; -pprint -> prec_level; -pprint -> pp_parenthesize; -pprint -> is_binary; -pprint -> pp_concat; -pp_concat -> pp_pop; -pp_concat -> pp_free; -pp_concat -> emalloc_real; -pp_concat -> erealloc_real; -pp_concat -> prec_level; -pp_concat -> is_unary_minus; -pp_concat -> is_scalar; -pprint -> redir2str; -redir2str -> set_loc; -redir2str -> r_fatal; -pprint -> nodetype2str; -pprint -> op2str; -op2str -> set_loc; -op2str -> r_fatal; -pprint -> getfname; -main -> array_init; -array_init -> register_array_func; -main -> add_srcfile; -main -> parse_program; -main -> dump_vars; -dump_vars -> r_warning; -dump_vars -> set_loc; -dump_vars -> print_vars; -print_vars -> valinfo; -valinfo -> pp_string_fp; -valinfo -> flags2str; -flags2str -> genflags2str; -genflags2str -> set_loc; -genflags2str -> r_fatal; -main -> dump_funcs; -dump_funcs -> function_list; -function_list -> get_symbols; -get_symbols -> assoc_list; -get_symbols -> emalloc_real; -dump_funcs -> foreach_func; -main -> shadow_funcs; -shadow_funcs -> set_loc; -shadow_funcs -> r_fatal; -shadow_funcs -> function_list; -shadow_funcs -> foreach_func; -main -> install_builtins; -install_builtins -> install_symbol; -main -> init_interpret; -init_interpret -> getenv_long; -init_interpret -> more_blocks; -init_interpret -> emalloc_real; -emalloc_real -> set_loc; -emalloc_real -> r_fatal; -main -> load_ext; -main -> release_all_vars; -main -> new_context; -main -> push_context; -main -> init_fields; -init_fields -> more_blocks; -init_fields -> emalloc_real; -init_fields -> dupnode; -dupnode -> r_dupnode; -main -> init_ext_api; -main -> gawk_name; -main -> os_arg_fixup; -main -> os_is_setuid; -main -> os_setbinmode; -main -> os_isatty; -main -> init_io; -init_io -> getenv_long; -init_io -> init_sockets; -main -> usage; -main -> emalloc_real; -main -> init_fds; -init_fds -> devopen; -main -> parse_args; -parse_args -> r_warning; -parse_args -> set_loc; -parse_args -> set_prof_file; -set_prof_file -> r_warning; -set_prof_file -> set_loc; -set_prof_file -> devopen_simple; -parse_args -> add_srcfile; -parse_args -> getopt_long; -getopt_long -> _getopt_internal; -_getopt_internal -> _getopt_internal_r; -_getopt_internal_r -> _getopt_initialize; -_getopt_internal_r -> exchange; -parse_args -> usage; -parse_args -> save_argv; -save_argv -> emalloc_real; -save_argv -> estrdup; -parse_args -> add_preassign; -add_preassign -> emalloc_real; -add_preassign -> estrdup; -add_preassign -> erealloc_real; -erealloc_real -> set_loc; -erealloc_real -> r_fatal; -parse_args -> copyleft; -copyleft -> r_warning; -copyleft -> set_loc; -main -> set_locale_stuff; -set_locale_stuff -> init_locale; -init_locale -> estrdup; -main -> nostalgia; -main -> init_groupset; -init_groupset -> emalloc_real; -main -> init_vars; -init_vars -> make_str_node; -init_vars -> install_symbol; -init_vars -> estrdup; -init_vars -> load_procinfo; -load_procinfo -> set_loc; -load_procinfo -> r_fatal; -load_procinfo -> install_symbol; -load_procinfo -> current_field_sep; -load_procinfo -> update_PROCINFO_str; -update_PROCINFO_str -> make_str_node; -update_PROCINFO_str -> unref; -load_procinfo -> update_PROCINFO_num; -update_PROCINFO_num -> make_str_node; -update_PROCINFO_num -> unref; -load_procinfo -> estrdup; -init_vars -> load_environ; -load_environ -> make_str_node; -load_environ -> install_symbol; -load_environ -> estrdup; -load_environ -> unref; -load_environ -> path_environ; -path_environ -> make_str_node; -path_environ -> unref; -main -> arg_assign; -main -> cmdline_fs; -cmdline_fs -> set_loc; -cmdline_fs -> make_str_node; -cmdline_fs -> set_FS; -set_FS -> r_warning; -set_FS -> set_loc; -set_FS -> dupnode; -set_FS -> force_string; -set_FS -> unref; -set_FS -> get_field; -set_FS -> current_field_sep; -set_FS -> update_PROCINFO_str; -set_FS -> make_regexp; -set_FS -> refree; -cmdline_fs -> unref; -main -> version; -version -> print_ext_versions; -version -> copyleft; -main -> init_args; -init_args -> make_str_node; -init_args -> install_symbol; -init_args -> estrdup; -init_args -> unref; -main -> resetup; -resetup -> dfasyntax; -resetup -> re_set_syntax; -} - diff --git a/benchmark/simple-c-func.bc b/benchmark/simple-c-func.bc deleted file mode 100644 index 1c265a1..0000000 Binary files a/benchmark/simple-c-func.bc and /dev/null differ diff --git a/benchmark/simple-c-func.ll b/benchmark/simple-c-func.ll deleted file mode 100644 index f4f23b5..0000000 --- a/benchmark/simple-c-func.ll +++ /dev/null @@ -1,93 +0,0 @@ -; ModuleID = 'simple-c-func.bc' -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; Function Attrs: nounwind uwtable -define void @foo() #0 !dbg !4 { -entry: - call void @bar(), !dbg !17 - ret void, !dbg !18 -} - -; Function Attrs: nounwind uwtable -define void @bar() #0 !dbg !7 { -entry: - call void @bar2(), !dbg !19 - call void @foo2(), !dbg !20 - ret void, !dbg !21 -} - -; Function Attrs: nounwind uwtable -define void @bar2() #0 !dbg !8 { -entry: - call void @foo2(), !dbg !22 - ret void, !dbg !23 -} - -; Function Attrs: nounwind uwtable -define void @foo2() #0 !dbg !9 { -entry: - ret void, !dbg !24 -} - -; Function Attrs: nounwind uwtable -define i32 @main() #0 !dbg !10 { -entry: - %retval = alloca i32, align 4 - %fp = alloca void (...)*, align 8 - store i32 0, i32* %retval, align 4 - call void @llvm.dbg.declare(metadata void (...)** %fp, metadata !25, metadata !29), !dbg !30 - store void (...)* bitcast (void ()* @bar2 to void (...)*), void (...)** %fp, align 8, !dbg !31 - %0 = load void (...)*, void (...)** %fp, align 8, !dbg !32 - call void (...) %0(), !dbg !32 - call void @foo(), !dbg !33 - call void @bar(), !dbg !34 - ret i32 0, !dbg !35 -} - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 - -attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { nounwind readnone } - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!14, !15} -!llvm.ident = !{!16} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 259875) (llvm/trunk 259862)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) -!1 = !DIFile(filename: "simple-c-func.c", directory: "/home/hebi/github/callgraph/benchmark") -!2 = !{} -!3 = !{!4, !7, !8, !9, !10} -!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, scopeLine: 8, isOptimized: false, variables: !2) -!5 = !DISubroutineType(types: !6) -!6 = !{null} -!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: false, variables: !2) -!8 = distinct !DISubprogram(name: "bar2", scope: !1, file: !1, line: 17, type: !5, isLocal: false, isDefinition: true, scopeLine: 17, isOptimized: false, variables: !2) -!9 = distinct !DISubprogram(name: "foo2", scope: !1, file: !1, line: 21, type: !5, isLocal: false, isDefinition: true, scopeLine: 21, isOptimized: false, variables: !2) -!10 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 23, type: !11, isLocal: false, isDefinition: true, scopeLine: 23, isOptimized: false, variables: !2) -!11 = !DISubroutineType(types: !12) -!12 = !{!13} -!13 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!14 = !{i32 2, !"Dwarf Version", i32 4} -!15 = !{i32 2, !"Debug Info Version", i32 3} -!16 = !{!"clang version 3.9.0 (trunk 259875) (llvm/trunk 259862)"} -!17 = !DILocation(line: 9, column: 3, scope: !4) -!18 = !DILocation(line: 10, column: 1, scope: !4) -!19 = !DILocation(line: 13, column: 3, scope: !7) -!20 = !DILocation(line: 14, column: 3, scope: !7) -!21 = !DILocation(line: 15, column: 1, scope: !7) -!22 = !DILocation(line: 18, column: 3, scope: !8) -!23 = !DILocation(line: 19, column: 1, scope: !8) -!24 = !DILocation(line: 21, column: 14, scope: !9) -!25 = !DILocalVariable(name: "fp", scope: !10, file: !1, line: 24, type: !26) -!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !27, size: 64, align: 64) -!27 = !DISubroutineType(types: !28) -!28 = !{null, null} -!29 = !DIExpression() -!30 = !DILocation(line: 24, column: 10, scope: !10) -!31 = !DILocation(line: 25, column: 6, scope: !10) -!32 = !DILocation(line: 26, column: 3, scope: !10) -!33 = !DILocation(line: 27, column: 3, scope: !10) -!34 = !DILocation(line: 28, column: 3, scope: !10) -!35 = !DILocation(line: 29, column: 3, scope: !10) diff --git a/benchmark/test.sh b/benchmark/test.sh index d40c923..d11e68e 100755 --- a/benchmark/test.sh +++ b/benchmark/test.sh @@ -1,2 +1,2 @@ #!/bin/bash -opt -load ../hebicg/libHebiCallGraphPass.so -hebicg $1 +opt -load ../build/hebicg/libHebiCallGraphPass.so -hebicg $1 diff --git a/benchmark/test1.bc b/benchmark/test1.bc deleted file mode 100644 index e7360c6..0000000 Binary files a/benchmark/test1.bc and /dev/null differ diff --git a/benchmark/test1.ll b/benchmark/test1.ll deleted file mode 100644 index a53be88..0000000 --- a/benchmark/test1.ll +++ /dev/null @@ -1,923 +0,0 @@ -; ModuleID = 'test1.bc' -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%"class.std::ios_base::Init" = type { i8 } -%class.A = type { i32 (...)** } -%class.C = type { i32 (...)** } -%class.E = type { %class.D } -%class.D = type { %class.C } -%class.B = type { %class.A } - -$_ZN1AC2Ev = comdat any - -$_ZN1EC2Ev = comdat any - -$_ZN1A3fooEv = comdat any - -$_ZN1DC2Ev = comdat any - -$_ZN1E4foo2Ev = comdat any - -$_ZN1CC2Ev = comdat any - -$_ZN1D4foo2Ev = comdat any - -$_ZN1C4foo2Ev = comdat any - -$_ZN1BC2Ev = comdat any - -$_ZN1B3fooEv = comdat any - -$_ZTV1A = comdat any - -$_ZTS1A = comdat any - -$_ZTI1A = comdat any - -$_ZTV1E = comdat any - -$_ZTS1E = comdat any - -$_ZTS1D = comdat any - -$_ZTS1C = comdat any - -$_ZTI1C = comdat any - -$_ZTI1D = comdat any - -$_ZTI1E = comdat any - -$_ZTV1D = comdat any - -$_ZTV1C = comdat any - -$_ZTV1B = comdat any - -$_ZTS1B = comdat any - -$_ZTI1B = comdat any - -@_ZStL8__ioinit = internal global %"class.std::ios_base::Init" zeroinitializer, align 1 -@__dso_handle = external global i8 -@_ZTV1A = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%class.A*)* @_ZN1A3fooEv to i8*)], comdat, align 8 -@_ZTVN10__cxxabiv117__class_type_infoE = external global i8* -@_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00", comdat -@_ZTI1A = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }, comdat -@_ZTV1E = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1E to i8*), i8* bitcast (void (%class.E*)* @_ZN1E4foo2Ev to i8*)], comdat, align 8 -@_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8* -@_ZTS1E = linkonce_odr constant [3 x i8] c"1E\00", comdat -@_ZTS1D = linkonce_odr constant [3 x i8] c"1D\00", comdat -@_ZTS1C = linkonce_odr constant [3 x i8] c"1C\00", comdat -@_ZTI1C = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1C, i32 0, i32 0) }, comdat -@_ZTI1D = linkonce_odr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1D, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI1C to i8*) }, comdat -@_ZTI1E = linkonce_odr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1E, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*) }, comdat -@_ZTV1D = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*), i8* bitcast (void (%class.D*)* @_ZN1D4foo2Ev to i8*)], comdat, align 8 -@_ZTV1C = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1C to i8*), i8* bitcast (void (%class.C*)* @_ZN1C4foo2Ev to i8*)], comdat, align 8 -@_ZTV1B = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1B to i8*), i8* bitcast (void (%class.B*)* @_ZN1B3fooEv to i8*)], comdat, align 8 -@_ZTS1B = linkonce_odr constant [3 x i8] c"1B\00", comdat -@_ZTI1B = linkonce_odr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1B, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*) }, comdat -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_test1.cpp, i8* null }] - -; Function Attrs: uwtable -define internal void @__cxx_global_var_init() #0 section ".text.startup" !dbg !82 { -entry: - call void @_ZNSt8ios_base4InitC1Ev(%"class.std::ios_base::Init"* @_ZStL8__ioinit), !dbg !472 - %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"class.std::ios_base::Init"*)* @_ZNSt8ios_base4InitD1Ev to void (i8*)*), i8* getelementptr inbounds (%"class.std::ios_base::Init", %"class.std::ios_base::Init"* @_ZStL8__ioinit, i32 0, i32 0), i8* @__dso_handle) #2, !dbg !473 - ret void, !dbg !472 -} - -declare void @_ZNSt8ios_base4InitC1Ev(%"class.std::ios_base::Init"*) #1 - -declare void @_ZNSt8ios_base4InitD1Ev(%"class.std::ios_base::Init"*) #1 - -; Function Attrs: nounwind -declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) #2 - -; Function Attrs: norecurse uwtable -define i32 @main(i32 %argc, i8** %argv) #3 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !86 { -entry: - %argc.addr = alloca i32, align 4 - %argv.addr = alloca i8**, align 8 - %a = alloca %class.A*, align 8 - %exn.slot = alloca i8* - %ehselector.slot = alloca i32 - %e = alloca %class.C*, align 8 - store i32 %argc, i32* %argc.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !475, metadata !476), !dbg !477 - store i8** %argv, i8*** %argv.addr, align 8 - call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !478, metadata !476), !dbg !479 - call void @_ZL6foobarv(), !dbg !480 - call void @llvm.dbg.declare(metadata %class.A** %a, metadata !481, metadata !476), !dbg !483 - %call = call noalias i8* @_Znwm(i64 8) #10, !dbg !484 - %0 = bitcast i8* %call to %class.A*, !dbg !484 - invoke void @_ZN1AC2Ev(%class.A* %0) - to label %invoke.cont unwind label %lpad, !dbg !485 - -invoke.cont: ; preds = %entry - store %class.A* %0, %class.A** %a, align 8, !dbg !486 - %1 = load %class.A*, %class.A** %a, align 8, !dbg !488 - %2 = bitcast %class.A* %1 to void (%class.A*)***, !dbg !488 - %vtable = load void (%class.A*)**, void (%class.A*)*** %2, align 8, !dbg !488 - %vfn = getelementptr inbounds void (%class.A*)*, void (%class.A*)** %vtable, i64 0, !dbg !488 - %3 = load void (%class.A*)*, void (%class.A*)** %vfn, align 8, !dbg !488 - call void %3(%class.A* %1), !dbg !488 - %4 = load %class.A*, %class.A** %a, align 8, !dbg !489 - %5 = bitcast %class.A* %4 to void (%class.A*)***, !dbg !490 - %vtable1 = load void (%class.A*)**, void (%class.A*)*** %5, align 8, !dbg !490 - %vfn2 = getelementptr inbounds void (%class.A*)*, void (%class.A*)** %vtable1, i64 0, !dbg !490 - %6 = load void (%class.A*)*, void (%class.A*)** %vfn2, align 8, !dbg !490 - call void %6(%class.A* %4), !dbg !490 - call void @llvm.dbg.declare(metadata %class.C** %e, metadata !491, metadata !476), !dbg !493 - %call3 = call noalias i8* @_Znwm(i64 8) #10, !dbg !494 - %7 = bitcast i8* %call3 to %class.E*, !dbg !494 - %8 = bitcast %class.E* %7 to i8*, !dbg !495 - call void @llvm.memset.p0i8.i64(i8* %8, i8 0, i64 8, i32 8, i1 false), !dbg !496 - call void @_ZN1EC2Ev(%class.E* %7) #2, !dbg !497 - %9 = bitcast %class.E* %7 to %class.C*, !dbg !494 - store %class.C* %9, %class.C** %e, align 8, !dbg !493 - %10 = load %class.C*, %class.C** %e, align 8, !dbg !499 - %11 = bitcast %class.C* %10 to void (%class.C*)***, !dbg !499 - %vtable4 = load void (%class.C*)**, void (%class.C*)*** %11, align 8, !dbg !499 - %vfn5 = getelementptr inbounds void (%class.C*)*, void (%class.C*)** %vtable4, i64 0, !dbg !499 - %12 = load void (%class.C*)*, void (%class.C*)** %vfn5, align 8, !dbg !499 - call void %12(%class.C* %10), !dbg !499 - %13 = load %class.C*, %class.C** %e, align 8, !dbg !500 - call void @_ZN1C4bar2Ev(%class.C* %13), !dbg !500 - ret i32 0, !dbg !501 - -lpad: ; preds = %entry - %14 = landingpad { i8*, i32 } - cleanup, !dbg !502 - %15 = extractvalue { i8*, i32 } %14, 0, !dbg !502 - store i8* %15, i8** %exn.slot, align 8, !dbg !502 - %16 = extractvalue { i8*, i32 } %14, 1, !dbg !502 - store i32 %16, i32* %ehselector.slot, align 4, !dbg !502 - call void @_ZdlPv(i8* %call) #11, !dbg !503 - br label %eh.resume, !dbg !503 - -eh.resume: ; preds = %lpad - %exn = load i8*, i8** %exn.slot, align 8, !dbg !504 - %sel = load i32, i32* %ehselector.slot, align 4, !dbg !504 - %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0, !dbg !504 - %lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1, !dbg !504 - resume { i8*, i32 } %lpad.val6, !dbg !504 -} - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.declare(metadata, metadata, metadata) #4 - -; Function Attrs: nounwind uwtable -define internal void @_ZL6foobarv() #5 !dbg !92 { -entry: - ret void, !dbg !506 -} - -; Function Attrs: nobuiltin -declare noalias i8* @_Znwm(i64) #6 - -; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1AC2Ev(%class.A* %this) unnamed_addr #5 comdat align 2 !dbg !93 { -entry: - %this.addr = alloca %class.A*, align 8 - store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !507, metadata !476), !dbg !508 - %this1 = load %class.A*, %class.A** %this.addr, align 8 - %0 = bitcast %class.A* %this1 to i32 (...)***, !dbg !509 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8, !dbg !509 - ret void, !dbg !510 -} - -declare i32 @__gxx_personality_v0(...) - -; Function Attrs: nobuiltin nounwind -declare void @_ZdlPv(i8*) #7 - -; Function Attrs: argmemonly nounwind -declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #8 - -; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN1EC2Ev(%class.E* %this) unnamed_addr #9 comdat align 2 !dbg !95 { -entry: - %this.addr = alloca %class.E*, align 8 - store %class.E* %this, %class.E** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.E** %this.addr, metadata !511, metadata !476), !dbg !513 - %this1 = load %class.E*, %class.E** %this.addr, align 8 - %0 = bitcast %class.E* %this1 to %class.D*, !dbg !514 - call void @_ZN1DC2Ev(%class.D* %0) #2, !dbg !514 - %1 = bitcast %class.E* %this1 to i32 (...)***, !dbg !514 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1E, i64 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !dbg !514 - ret void, !dbg !514 -} - -declare void @_ZN1C4bar2Ev(%class.C*) #1 - -; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1A3fooEv(%class.A* %this) unnamed_addr #5 comdat align 2 !dbg !94 { -entry: - %this.addr = alloca %class.A*, align 8 - store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !515, metadata !476), !dbg !516 - %this1 = load %class.A*, %class.A** %this.addr, align 8 - ret void, !dbg !517 -} - -; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN1DC2Ev(%class.D* %this) unnamed_addr #9 comdat align 2 !dbg !97 { -entry: - %this.addr = alloca %class.D*, align 8 - store %class.D* %this, %class.D** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.D** %this.addr, metadata !518, metadata !476), !dbg !520 - %this1 = load %class.D*, %class.D** %this.addr, align 8 - %0 = bitcast %class.D* %this1 to %class.C*, !dbg !521 - call void @_ZN1CC2Ev(%class.C* %0) #2, !dbg !521 - %1 = bitcast %class.D* %this1 to i32 (...)***, !dbg !521 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !dbg !521 - ret void, !dbg !521 -} - -; Function Attrs: uwtable -define linkonce_odr void @_ZN1E4foo2Ev(%class.E* %this) unnamed_addr #0 comdat align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !103 { -entry: - %this.addr = alloca %class.E*, align 8 - %a = alloca %class.A*, align 8 - %exn.slot = alloca i8* - %ehselector.slot = alloca i32 - store %class.E* %this, %class.E** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.E** %this.addr, metadata !522, metadata !476), !dbg !523 - %this1 = load %class.E*, %class.E** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %a, metadata !524, metadata !476), !dbg !525 - %call = call noalias i8* @_Znwm(i64 8) #10, !dbg !526 - %0 = bitcast i8* %call to %class.B*, !dbg !526 - %1 = bitcast %class.B* %0 to i8*, !dbg !527 - call void @llvm.memset.p0i8.i64(i8* %1, i8 0, i64 8, i32 8, i1 false), !dbg !528 - invoke void @_ZN1BC2Ev(%class.B* %0) - to label %invoke.cont unwind label %lpad, !dbg !527 - -invoke.cont: ; preds = %entry - %2 = bitcast %class.B* %0 to %class.A*, !dbg !530 - store %class.A* %2, %class.A** %a, align 8, !dbg !532 - %3 = load %class.A*, %class.A** %a, align 8, !dbg !533 - %4 = bitcast %class.A* %3 to void (%class.A*)***, !dbg !533 - %vtable = load void (%class.A*)**, void (%class.A*)*** %4, align 8, !dbg !533 - %vfn = getelementptr inbounds void (%class.A*)*, void (%class.A*)** %vtable, i64 0, !dbg !533 - %5 = load void (%class.A*)*, void (%class.A*)** %vfn, align 8, !dbg !533 - call void %5(%class.A* %3), !dbg !533 - ret void, !dbg !534 - -lpad: ; preds = %entry - %6 = landingpad { i8*, i32 } - cleanup, !dbg !535 - %7 = extractvalue { i8*, i32 } %6, 0, !dbg !535 - store i8* %7, i8** %exn.slot, align 8, !dbg !535 - %8 = extractvalue { i8*, i32 } %6, 1, !dbg !535 - store i32 %8, i32* %ehselector.slot, align 4, !dbg !535 - call void @_ZdlPv(i8* %call) #11, !dbg !536 - br label %eh.resume, !dbg !536 - -eh.resume: ; preds = %lpad - %exn = load i8*, i8** %exn.slot, align 8, !dbg !538 - %sel = load i32, i32* %ehselector.slot, align 4, !dbg !538 - %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0, !dbg !538 - %lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1, !dbg !538 - resume { i8*, i32 } %lpad.val2, !dbg !538 -} - -; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN1CC2Ev(%class.C* %this) unnamed_addr #9 comdat align 2 !dbg !99 { -entry: - %this.addr = alloca %class.C*, align 8 - store %class.C* %this, %class.C** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.C** %this.addr, metadata !540, metadata !476), !dbg !541 - %this1 = load %class.C*, %class.C** %this.addr, align 8 - %0 = bitcast %class.C* %this1 to i32 (...)***, !dbg !542 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1C, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8, !dbg !542 - ret void, !dbg !542 -} - -; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1D4foo2Ev(%class.D* %this) unnamed_addr #5 comdat align 2 !dbg !102 { -entry: - %this.addr = alloca %class.D*, align 8 - store %class.D* %this, %class.D** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.D** %this.addr, metadata !543, metadata !476), !dbg !544 - %this1 = load %class.D*, %class.D** %this.addr, align 8 - ret void, !dbg !545 -} - -; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1C4foo2Ev(%class.C* %this) unnamed_addr #5 comdat align 2 !dbg !101 { -entry: - %this.addr = alloca %class.C*, align 8 - store %class.C* %this, %class.C** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.C** %this.addr, metadata !546, metadata !476), !dbg !547 - %this1 = load %class.C*, %class.C** %this.addr, align 8 - ret void, !dbg !548 -} - -; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN1BC2Ev(%class.B* %this) unnamed_addr #9 comdat align 2 !dbg !104 { -entry: - %this.addr = alloca %class.B*, align 8 - store %class.B* %this, %class.B** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !549, metadata !476), !dbg !551 - %this1 = load %class.B*, %class.B** %this.addr, align 8 - %0 = bitcast %class.B* %this1 to %class.A*, !dbg !552 - call void @_ZN1AC2Ev(%class.A* %0), !dbg !552 - %1 = bitcast %class.B* %this1 to i32 (...)***, !dbg !552 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !dbg !552 - ret void, !dbg !552 -} - -; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1B3fooEv(%class.B* %this) unnamed_addr #5 comdat align 2 !dbg !106 { -entry: - %this.addr = alloca %class.B*, align 8 - store %class.B* %this, %class.B** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !553, metadata !476), !dbg !554 - %this1 = load %class.B*, %class.B** %this.addr, align 8 - ret void, !dbg !555 -} - -; Function Attrs: uwtable -define internal void @_GLOBAL__sub_I_test1.cpp() #0 section ".text.startup" !dbg !107 { -entry: - call void @__cxx_global_var_init(), !dbg !556 - ret void -} - -attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind } -attributes #3 = { norecurse uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #4 = { nounwind readnone } -attributes #5 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #6 = { nobuiltin "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #7 = { nobuiltin nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #8 = { argmemonly nounwind } -attributes #9 = { inlinehint nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #10 = { builtin } -attributes #11 = { builtin nounwind } - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!469, !470} -!llvm.ident = !{!471} - -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 259875) (llvm/trunk 259862)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !81, globals: !109, imports: !111) -!1 = !DIFile(filename: "test1.cpp", directory: "/home/hebi/github/callgraph/benchmark") -!2 = !{} -!3 = !{!4, !6, !8, !16, !17, !19, !23, !36, !49, !57, !65, !73} -!4 = !DICompositeType(tag: DW_TAG_structure_type, file: !5, line: 82, size: 64, align: 32, flags: DIFlagFwdDecl, identifier: "_ZTS11__mbstate_t") -!5 = !DIFile(filename: "/usr/include/wchar.h", directory: "/home/hebi/github/callgraph/benchmark") -!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "_IO_FILE", file: !7, line: 44, flags: DIFlagFwdDecl, identifier: "_ZTS8_IO_FILE") -!7 = !DIFile(filename: "/usr/include/stdio.h", directory: "/home/hebi/github/callgraph/benchmark") -!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "__va_list_tag", file: !1, size: 192, align: 64, elements: !9, identifier: "_ZTS13__va_list_tag") -!9 = !{!10, !12, !13, !15} -!10 = !DIDerivedType(tag: DW_TAG_member, name: "gp_offset", scope: !"_ZTS13__va_list_tag", file: !1, baseType: !11, size: 32, align: 32) -!11 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!12 = !DIDerivedType(tag: DW_TAG_member, name: "fp_offset", scope: !"_ZTS13__va_list_tag", file: !1, baseType: !11, size: 32, align: 32, offset: 32) -!13 = !DIDerivedType(tag: DW_TAG_member, name: "overflow_arg_area", scope: !"_ZTS13__va_list_tag", file: !1, baseType: !14, size: 64, align: 64, offset: 64) -!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64) -!15 = !DIDerivedType(tag: DW_TAG_member, name: "reg_save_area", scope: !"_ZTS13__va_list_tag", file: !1, baseType: !14, size: 64, align: 64, offset: 128) -!16 = !DICompositeType(tag: DW_TAG_structure_type, name: "tm", file: !5, line: 137, flags: DIFlagFwdDecl, identifier: "_ZTS2tm") -!17 = !DICompositeType(tag: DW_TAG_structure_type, name: "lconv", file: !18, line: 54, size: 768, align: 64, flags: DIFlagFwdDecl, identifier: "_ZTS5lconv") -!18 = !DIFile(filename: "/usr/include/locale.h", directory: "/home/hebi/github/callgraph/benchmark") -!19 = !DICompositeType(tag: DW_TAG_class_type, name: "ios_base", scope: !21, file: !20, line: 199, size: 1728, align: 64, flags: DIFlagFwdDecl, identifier: "_ZTSSt8ios_base") -!20 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/ios_base.h", directory: "/home/hebi/github/callgraph/benchmark") -!21 = !DINamespace(name: "std", scope: null, file: !22, line: 1855) -!22 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/bits/c++config.h", directory: "/home/hebi/github/callgraph/benchmark") -!23 = !DICompositeType(tag: DW_TAG_class_type, name: "Init", scope: !"_ZTSSt8ios_base", file: !20, line: 533, size: 8, align: 8, elements: !24, identifier: "_ZTSNSt8ios_base4InitE") -!24 = !{!25, !29, !31, !35} -!25 = !DIDerivedType(tag: DW_TAG_member, name: "_S_refcount", scope: !"_ZTSNSt8ios_base4InitE", file: !20, line: 541, baseType: !26, flags: DIFlagStaticMember) -!26 = !DIDerivedType(tag: DW_TAG_typedef, name: "_Atomic_word", file: !27, line: 32, baseType: !28) -!27 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux/bits/atomic_word.h", directory: "/home/hebi/github/callgraph/benchmark") -!28 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!29 = !DIDerivedType(tag: DW_TAG_member, name: "_S_synced_with_stdio", scope: !"_ZTSNSt8ios_base4InitE", file: !20, line: 542, baseType: !30, flags: DIFlagStaticMember) -!30 = !DIBasicType(name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) -!31 = !DISubprogram(name: "Init", scope: !"_ZTSNSt8ios_base4InitE", file: !20, line: 537, type: !32, isLocal: false, isDefinition: false, scopeLine: 537, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!32 = !DISubroutineType(types: !33) -!33 = !{null, !34} -!34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSNSt8ios_base4InitE", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!35 = !DISubprogram(name: "~Init", scope: !"_ZTSNSt8ios_base4InitE", file: !20, line: 538, type: !32, isLocal: false, isDefinition: false, scopeLine: 538, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!36 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, line: 9, size: 64, align: 64, elements: !37, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") -!37 = !{!38, !43, !47, !48} -!38 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !1, file: !1, baseType: !39, size: 64, flags: DIFlagArtificial) -!39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !40, size: 64) -!40 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !41, size: 64) -!41 = !DISubroutineType(types: !42) -!42 = !{!28} -!43 = !DISubprogram(name: "A", scope: !"_ZTS1A", file: !1, line: 11, type: !44, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!44 = !DISubroutineType(types: !45) -!45 = !{null, !46} -!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!47 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", scope: !"_ZTS1A", file: !1, line: 12, type: !44, isLocal: false, isDefinition: false, scopeLine: 12, containingType: !"_ZTS1A", virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!48 = !DISubprogram(name: "bar", linkageName: "_ZN1A3barEv", scope: !"_ZTS1A", file: !1, line: 14, type: !44, isLocal: false, isDefinition: false, scopeLine: 14, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!49 = !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !1, line: 22, size: 64, align: 64, elements: !50, vtableHolder: !"_ZTS1C", identifier: "_ZTS1C") -!50 = !{!51, !52, !56} -!51 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C", scope: !1, file: !1, baseType: !39, size: 64, flags: DIFlagArtificial) -!52 = !DISubprogram(name: "foo2", linkageName: "_ZN1C4foo2Ev", scope: !"_ZTS1C", file: !1, line: 24, type: !53, isLocal: false, isDefinition: false, scopeLine: 24, containingType: !"_ZTS1C", virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!53 = !DISubroutineType(types: !54) -!54 = !{null, !55} -!55 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1C", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!56 = !DISubprogram(name: "bar2", linkageName: "_ZN1C4bar2Ev", scope: !"_ZTS1C", file: !1, line: 25, type: !53, isLocal: false, isDefinition: false, scopeLine: 25, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) -!57 = !DICompositeType(tag: DW_TAG_class_type, name: "E", file: !1, line: 33, size: 64, align: 64, elements: !58, vtableHolder: !"_ZTS1C", identifier: "_ZTS1E") -!58 = !{!59, !60, !64} -!59 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !"_ZTS1E", baseType: !"_ZTS1D", flags: DIFlagPublic) -!60 = !DISubprogram(name: "foo2", linkageName: "_ZN1E4foo2Ev", scope: !"_ZTS1E", file: !1, line: 34, type: !61, isLocal: false, isDefinition: false, scopeLine: 34, containingType: !"_ZTS1E", virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: false) -!61 = !DISubroutineType(types: !62) -!62 = !{null, !63} -!63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1E", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!64 = !DISubprogram(name: "bar2", linkageName: "_ZN1E4bar2Ev", scope: !"_ZTS1E", file: !1, line: 38, type: !61, isLocal: false, isDefinition: false, scopeLine: 38, flags: DIFlagPrototyped, isOptimized: false) -!65 = !DICompositeType(tag: DW_TAG_class_type, name: "D", file: !1, line: 28, size: 64, align: 64, elements: !66, vtableHolder: !"_ZTS1C", identifier: "_ZTS1D") -!66 = !{!67, !68, !72} -!67 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !"_ZTS1D", baseType: !"_ZTS1C", flags: DIFlagPublic) -!68 = !DISubprogram(name: "foo2", linkageName: "_ZN1D4foo2Ev", scope: !"_ZTS1D", file: !1, line: 29, type: !69, isLocal: false, isDefinition: false, scopeLine: 29, containingType: !"_ZTS1D", virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: false) -!69 = !DISubroutineType(types: !70) -!70 = !{null, !71} -!71 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1D", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!72 = !DISubprogram(name: "bar2", linkageName: "_ZN1D4bar2Ev", scope: !"_ZTS1D", file: !1, line: 30, type: !69, isLocal: false, isDefinition: false, scopeLine: 30, flags: DIFlagPrototyped, isOptimized: false) -!73 = !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, line: 17, size: 64, align: 64, elements: !74, vtableHolder: !"_ZTS1A", identifier: "_ZTS1B") -!74 = !{!75, !76, !80} -!75 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !"_ZTS1B", baseType: !"_ZTS1A", flags: DIFlagPublic) -!76 = !DISubprogram(name: "foo", linkageName: "_ZN1B3fooEv", scope: !"_ZTS1B", file: !1, line: 18, type: !77, isLocal: false, isDefinition: false, scopeLine: 18, containingType: !"_ZTS1B", virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: false) -!77 = !DISubroutineType(types: !78) -!78 = !{null, !79} -!79 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1B", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) -!80 = !DISubprogram(name: "bar", linkageName: "_ZN1B3barEv", scope: !"_ZTS1B", file: !1, line: 19, type: !77, isLocal: false, isDefinition: false, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false) -!81 = !{!82, !86, !92, !93, !94, !95, !97, !99, !101, !102, !103, !104, !106, !107} -!82 = distinct !DISubprogram(name: "__cxx_global_var_init", scope: !83, file: !83, line: 74, type: !84, isLocal: true, isDefinition: true, scopeLine: 74, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!83 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/iostream", directory: "/home/hebi/github/callgraph/benchmark") -!84 = !DISubroutineType(types: !85) -!85 = !{null} -!86 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 45, type: !87, isLocal: false, isDefinition: true, scopeLine: 45, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!87 = !DISubroutineType(types: !88) -!88 = !{!28, !28, !89} -!89 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !90, size: 64, align: 64) -!90 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !91, size: 64, align: 64) -!91 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!92 = distinct !DISubprogram(name: "foobar", linkageName: "_ZL6foobarv", scope: !1, file: !1, line: 41, type: !84, isLocal: true, isDefinition: true, scopeLine: 41, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!93 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", scope: !"_ZTS1A", file: !1, line: 11, type: !44, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false, declaration: !43, variables: !2) -!94 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", scope: !"_ZTS1A", file: !1, line: 12, type: !44, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, declaration: !47, variables: !2) -!95 = distinct !DISubprogram(name: "E", linkageName: "_ZN1EC2Ev", scope: !"_ZTS1E", file: !1, line: 33, type: !61, isLocal: false, isDefinition: true, scopeLine: 33, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, declaration: !96, variables: !2) -!96 = !DISubprogram(name: "E", scope: !"_ZTS1E", type: !61, isLocal: false, isDefinition: false, flags: DIFlagPublic | DIFlagArtificial | DIFlagPrototyped, isOptimized: false) -!97 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2Ev", scope: !"_ZTS1D", file: !1, line: 28, type: !69, isLocal: false, isDefinition: true, scopeLine: 28, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, declaration: !98, variables: !2) -!98 = !DISubprogram(name: "D", scope: !"_ZTS1D", type: !69, isLocal: false, isDefinition: false, flags: DIFlagPublic | DIFlagArtificial | DIFlagPrototyped, isOptimized: false) -!99 = distinct !DISubprogram(name: "C", linkageName: "_ZN1CC2Ev", scope: !"_ZTS1C", file: !1, line: 22, type: !53, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, declaration: !100, variables: !2) -!100 = !DISubprogram(name: "C", scope: !"_ZTS1C", type: !53, isLocal: false, isDefinition: false, flags: DIFlagPublic | DIFlagArtificial | DIFlagPrototyped, isOptimized: false) -!101 = distinct !DISubprogram(name: "foo2", linkageName: "_ZN1C4foo2Ev", scope: !"_ZTS1C", file: !1, line: 24, type: !53, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, declaration: !52, variables: !2) -!102 = distinct !DISubprogram(name: "foo2", linkageName: "_ZN1D4foo2Ev", scope: !"_ZTS1D", file: !1, line: 29, type: !69, isLocal: false, isDefinition: true, scopeLine: 29, flags: DIFlagPrototyped, isOptimized: false, declaration: !68, variables: !2) -!103 = distinct !DISubprogram(name: "foo2", linkageName: "_ZN1E4foo2Ev", scope: !"_ZTS1E", file: !1, line: 34, type: !61, isLocal: false, isDefinition: true, scopeLine: 34, flags: DIFlagPrototyped, isOptimized: false, declaration: !60, variables: !2) -!104 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", scope: !"_ZTS1B", file: !1, line: 17, type: !77, isLocal: false, isDefinition: true, scopeLine: 17, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, declaration: !105, variables: !2) -!105 = !DISubprogram(name: "B", scope: !"_ZTS1B", type: !77, isLocal: false, isDefinition: false, flags: DIFlagPublic | DIFlagArtificial | DIFlagPrototyped, isOptimized: false) -!106 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1B3fooEv", scope: !"_ZTS1B", file: !1, line: 18, type: !77, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, declaration: !76, variables: !2) -!107 = distinct !DISubprogram(linkageName: "_GLOBAL__sub_I_test1.cpp", scope: !1, file: !1, type: !108, isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, variables: !2) -!108 = !DISubroutineType(types: !2) -!109 = !{!110} -!110 = !DIGlobalVariable(name: "__ioinit", linkageName: "_ZStL8__ioinit", scope: !21, file: !83, line: 74, type: !"_ZTSNSt8ios_base4InitE", isLocal: true, isDefinition: true, variable: %"class.std::ios_base::Init"* @_ZStL8__ioinit) -!111 = !{!112, !115, !118, !122, !128, !136, !140, !147, !151, !155, !157, !159, !163, !174, !178, !184, !190, !192, !196, !200, !204, !208, !213, !215, !219, !223, !227, !229, !234, !238, !242, !244, !246, !250, !257, !261, !265, !269, !271, !277, !279, !286, !291, !295, !300, !304, !308, !312, !314, !316, !320, !324, !328, !330, !334, !338, !340, !342, !346, !353, !358, !363, !364, !365, !366, !370, !371, !375, !380, !385, !387, !389, !391, !393, !395, !397, !399, !401, !403, !405, !407, !409, !411, !413, !420, !422, !423, !425, !427, !429, !431, !435, !437, !439, !441, !443, !445, !447, !449, !451, !455, !459, !461, !465} -!112 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !113, line: 64) -!113 = !DIDerivedType(tag: DW_TAG_typedef, name: "mbstate_t", file: !5, line: 106, baseType: !114) -!114 = !DIDerivedType(tag: DW_TAG_typedef, name: "__mbstate_t", file: !5, line: 94, baseType: !"_ZTS11__mbstate_t") -!115 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !116, line: 139) -!116 = !DIDerivedType(tag: DW_TAG_typedef, name: "wint_t", file: !117, line: 132, baseType: !11) -!117 = !DIFile(filename: "/usr/local/bin/../lib/clang/3.9.0/include/stddef.h", directory: "/home/hebi/github/callgraph/benchmark") -!118 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !119, line: 141) -!119 = !DISubprogram(name: "btowc", scope: !5, file: !5, line: 353, type: !120, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!120 = !DISubroutineType(types: !121) -!121 = !{!116, !28} -!122 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !123, line: 142) -!123 = !DISubprogram(name: "fgetwc", scope: !5, file: !5, line: 745, type: !124, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!124 = !DISubroutineType(types: !125) -!125 = !{!116, !126} -!126 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !127, size: 64, align: 64) -!127 = !DIDerivedType(tag: DW_TAG_typedef, name: "__FILE", file: !7, line: 64, baseType: !"_ZTS8_IO_FILE") -!128 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !129, line: 143) -!129 = !DISubprogram(name: "fgetws", scope: !5, file: !5, line: 774, type: !130, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!130 = !DISubroutineType(types: !131) -!131 = !{!132, !134, !28, !135} -!132 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !133, size: 64, align: 64) -!133 = !DIBasicType(name: "wchar_t", size: 32, align: 32, encoding: DW_ATE_signed) -!134 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !132) -!135 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !126) -!136 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !137, line: 144) -!137 = !DISubprogram(name: "fputwc", scope: !5, file: !5, line: 759, type: !138, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!138 = !DISubroutineType(types: !139) -!139 = !{!116, !133, !126} -!140 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !141, line: 145) -!141 = !DISubprogram(name: "fputws", scope: !5, file: !5, line: 781, type: !142, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!142 = !DISubroutineType(types: !143) -!143 = !{!28, !144, !135} -!144 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !145) -!145 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !146, size: 64, align: 64) -!146 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !133) -!147 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !148, line: 146) -!148 = !DISubprogram(name: "fwide", scope: !5, file: !5, line: 587, type: !149, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!149 = !DISubroutineType(types: !150) -!150 = !{!28, !126, !28} -!151 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !152, line: 147) -!152 = !DISubprogram(name: "fwprintf", scope: !5, file: !5, line: 594, type: !153, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!153 = !DISubroutineType(types: !154) -!154 = !{!28, !135, !144, null} -!155 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !156, line: 148) -!156 = !DISubprogram(name: "fwscanf", scope: !5, file: !5, line: 635, type: !153, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!157 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !158, line: 149) -!158 = !DISubprogram(name: "getwc", scope: !5, file: !5, line: 746, type: !124, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!159 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !160, line: 150) -!160 = !DISubprogram(name: "getwchar", scope: !5, file: !5, line: 752, type: !161, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!161 = !DISubroutineType(types: !162) -!162 = !{!116} -!163 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !164, line: 151) -!164 = !DISubprogram(name: "mbrlen", scope: !5, file: !5, line: 376, type: !165, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!165 = !DISubroutineType(types: !166) -!166 = !{!167, !169, !167, !172} -!167 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !117, line: 62, baseType: !168) -!168 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) -!169 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !170) -!170 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !171, size: 64, align: 64) -!171 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !91) -!172 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !173) -!173 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !113, size: 64, align: 64) -!174 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !175, line: 152) -!175 = !DISubprogram(name: "mbrtowc", scope: !5, file: !5, line: 365, type: !176, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!176 = !DISubroutineType(types: !177) -!177 = !{!167, !134, !169, !167, !172} -!178 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !179, line: 153) -!179 = !DISubprogram(name: "mbsinit", scope: !5, file: !5, line: 361, type: !180, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!180 = !DISubroutineType(types: !181) -!181 = !{!28, !182} -!182 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !183, size: 64, align: 64) -!183 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !113) -!184 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !185, line: 154) -!185 = !DISubprogram(name: "mbsrtowcs", scope: !5, file: !5, line: 408, type: !186, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!186 = !DISubroutineType(types: !187) -!187 = !{!167, !134, !188, !167, !172} -!188 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !189) -!189 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !170, size: 64, align: 64) -!190 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !191, line: 155) -!191 = !DISubprogram(name: "putwc", scope: !5, file: !5, line: 760, type: !138, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!192 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !193, line: 156) -!193 = !DISubprogram(name: "putwchar", scope: !5, file: !5, line: 766, type: !194, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!194 = !DISubroutineType(types: !195) -!195 = !{!116, !133} -!196 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !197, line: 158) -!197 = !DISubprogram(name: "swprintf", scope: !5, file: !5, line: 604, type: !198, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!198 = !DISubroutineType(types: !199) -!199 = !{!28, !134, !167, !144, null} -!200 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !201, line: 160) -!201 = !DISubprogram(name: "swscanf", scope: !5, file: !5, line: 645, type: !202, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!202 = !DISubroutineType(types: !203) -!203 = !{!28, !144, !144, null} -!204 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !205, line: 161) -!205 = !DISubprogram(name: "ungetwc", scope: !5, file: !5, line: 789, type: !206, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!206 = !DISubroutineType(types: !207) -!207 = !{!116, !116, !126} -!208 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !209, line: 162) -!209 = !DISubprogram(name: "vfwprintf", scope: !5, file: !5, line: 612, type: !210, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!210 = !DISubroutineType(types: !211) -!211 = !{!28, !135, !144, !212} -!212 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS13__va_list_tag", size: 64, align: 64) -!213 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !214, line: 164) -!214 = !DISubprogram(name: "vfwscanf", scope: !5, file: !5, line: 689, type: !210, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!215 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !216, line: 167) -!216 = !DISubprogram(name: "vswprintf", scope: !5, file: !5, line: 625, type: !217, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!217 = !DISubroutineType(types: !218) -!218 = !{!28, !134, !167, !144, !212} -!219 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !220, line: 170) -!220 = !DISubprogram(name: "vswscanf", scope: !5, file: !5, line: 701, type: !221, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!221 = !DISubroutineType(types: !222) -!222 = !{!28, !144, !144, !212} -!223 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !224, line: 172) -!224 = !DISubprogram(name: "vwprintf", scope: !5, file: !5, line: 620, type: !225, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!225 = !DISubroutineType(types: !226) -!226 = !{!28, !144, !212} -!227 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !228, line: 174) -!228 = !DISubprogram(name: "vwscanf", scope: !5, file: !5, line: 697, type: !225, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!229 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !230, line: 176) -!230 = !DISubprogram(name: "wcrtomb", scope: !5, file: !5, line: 370, type: !231, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!231 = !DISubroutineType(types: !232) -!232 = !{!167, !233, !133, !172} -!233 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !90) -!234 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !235, line: 177) -!235 = !DISubprogram(name: "wcscat", scope: !5, file: !5, line: 155, type: !236, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!236 = !DISubroutineType(types: !237) -!237 = !{!132, !134, !144} -!238 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !239, line: 178) -!239 = !DISubprogram(name: "wcscmp", scope: !5, file: !5, line: 163, type: !240, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!240 = !DISubroutineType(types: !241) -!241 = !{!28, !145, !145} -!242 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !243, line: 179) -!243 = !DISubprogram(name: "wcscoll", scope: !5, file: !5, line: 192, type: !240, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!244 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !245, line: 180) -!245 = !DISubprogram(name: "wcscpy", scope: !5, file: !5, line: 147, type: !236, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!246 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !247, line: 181) -!247 = !DISubprogram(name: "wcscspn", scope: !5, file: !5, line: 252, type: !248, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!248 = !DISubroutineType(types: !249) -!249 = !{!167, !145, !145} -!250 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !251, line: 182) -!251 = !DISubprogram(name: "wcsftime", scope: !5, file: !5, line: 855, type: !252, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!252 = !DISubroutineType(types: !253) -!253 = !{!167, !134, !167, !144, !254} -!254 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !255) -!255 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !256, size: 64, align: 64) -!256 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS2tm") -!257 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !258, line: 183) -!258 = !DISubprogram(name: "wcslen", scope: !5, file: !5, line: 287, type: !259, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!259 = !DISubroutineType(types: !260) -!260 = !{!167, !145} -!261 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !262, line: 184) -!262 = !DISubprogram(name: "wcsncat", scope: !5, file: !5, line: 158, type: !263, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!263 = !DISubroutineType(types: !264) -!264 = !{!132, !134, !144, !167} -!265 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !266, line: 185) -!266 = !DISubprogram(name: "wcsncmp", scope: !5, file: !5, line: 166, type: !267, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!267 = !DISubroutineType(types: !268) -!268 = !{!28, !145, !145, !167} -!269 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !270, line: 186) -!270 = !DISubprogram(name: "wcsncpy", scope: !5, file: !5, line: 150, type: !263, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!271 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !272, line: 187) -!272 = !DISubprogram(name: "wcsrtombs", scope: !5, file: !5, line: 414, type: !273, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!273 = !DISubroutineType(types: !274) -!274 = !{!167, !233, !275, !167, !172} -!275 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !276) -!276 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !145, size: 64, align: 64) -!277 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !278, line: 188) -!278 = !DISubprogram(name: "wcsspn", scope: !5, file: !5, line: 256, type: !248, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!279 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !280, line: 189) -!280 = !DISubprogram(name: "wcstod", scope: !5, file: !5, line: 450, type: !281, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!281 = !DISubroutineType(types: !282) -!282 = !{!283, !144, !284} -!283 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) -!284 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !285) -!285 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !132, size: 64, align: 64) -!286 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !287, line: 191) -!287 = !DISubprogram(name: "wcstof", scope: !5, file: !5, line: 457, type: !288, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!288 = !DISubroutineType(types: !289) -!289 = !{!290, !144, !284} -!290 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) -!291 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !292, line: 193) -!292 = !DISubprogram(name: "wcstok", scope: !5, file: !5, line: 282, type: !293, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!293 = !DISubroutineType(types: !294) -!294 = !{!132, !134, !144, !284} -!295 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !296, line: 194) -!296 = !DISubprogram(name: "wcstol", scope: !5, file: !5, line: 468, type: !297, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!297 = !DISubroutineType(types: !298) -!298 = !{!299, !144, !284, !28} -!299 = !DIBasicType(name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) -!300 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !301, line: 195) -!301 = !DISubprogram(name: "wcstoul", scope: !5, file: !5, line: 473, type: !302, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!302 = !DISubroutineType(types: !303) -!303 = !{!168, !144, !284, !28} -!304 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !305, line: 196) -!305 = !DISubprogram(name: "wcsxfrm", scope: !5, file: !5, line: 196, type: !306, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!306 = !DISubroutineType(types: !307) -!307 = !{!167, !134, !144, !167} -!308 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !309, line: 197) -!309 = !DISubprogram(name: "wctob", scope: !5, file: !5, line: 357, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!310 = !DISubroutineType(types: !311) -!311 = !{!28, !116} -!312 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !313, line: 198) -!313 = !DISubprogram(name: "wmemcmp", scope: !5, file: !5, line: 325, type: !267, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!314 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !315, line: 199) -!315 = !DISubprogram(name: "wmemcpy", scope: !5, file: !5, line: 329, type: !263, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!316 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !317, line: 200) -!317 = !DISubprogram(name: "wmemmove", scope: !5, file: !5, line: 334, type: !318, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!318 = !DISubroutineType(types: !319) -!319 = !{!132, !132, !145, !167} -!320 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !321, line: 201) -!321 = !DISubprogram(name: "wmemset", scope: !5, file: !5, line: 338, type: !322, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!322 = !DISubroutineType(types: !323) -!323 = !{!132, !132, !133, !167} -!324 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !325, line: 202) -!325 = !DISubprogram(name: "wprintf", scope: !5, file: !5, line: 601, type: !326, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!326 = !DISubroutineType(types: !327) -!327 = !{!28, !144, null} -!328 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !329, line: 203) -!329 = !DISubprogram(name: "wscanf", scope: !5, file: !5, line: 642, type: !326, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!330 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !331, line: 204) -!331 = !DISubprogram(name: "wcschr", scope: !5, file: !5, line: 227, type: !332, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!332 = !DISubroutineType(types: !333) -!333 = !{!132, !145, !133} -!334 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !335, line: 205) -!335 = !DISubprogram(name: "wcspbrk", scope: !5, file: !5, line: 266, type: !336, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!336 = !DISubroutineType(types: !337) -!337 = !{!132, !145, !145} -!338 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !339, line: 206) -!339 = !DISubprogram(name: "wcsrchr", scope: !5, file: !5, line: 237, type: !332, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!340 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !341, line: 207) -!341 = !DISubprogram(name: "wcsstr", scope: !5, file: !5, line: 277, type: !336, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!342 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !343, line: 208) -!343 = !DISubprogram(name: "wmemchr", scope: !5, file: !5, line: 320, type: !344, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!344 = !DISubroutineType(types: !345) -!345 = !{!132, !145, !133, !167} -!346 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !347, entity: !349, line: 248) -!347 = !DINamespace(name: "__gnu_cxx", scope: null, file: !348, line: 241) -!348 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/cwchar", directory: "/home/hebi/github/callgraph/benchmark") -!349 = !DISubprogram(name: "wcstold", scope: !5, file: !5, line: 459, type: !350, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!350 = !DISubroutineType(types: !351) -!351 = !{!352, !144, !284} -!352 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float) -!353 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !347, entity: !354, line: 257) -!354 = !DISubprogram(name: "wcstoll", scope: !5, file: !5, line: 483, type: !355, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!355 = !DISubroutineType(types: !356) -!356 = !{!357, !144, !284, !28} -!357 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed) -!358 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !347, entity: !359, line: 258) -!359 = !DISubprogram(name: "wcstoull", scope: !5, file: !5, line: 490, type: !360, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!360 = !DISubroutineType(types: !361) -!361 = !{!362, !144, !284, !28} -!362 = !DIBasicType(name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) -!363 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !349, line: 264) -!364 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !354, line: 265) -!365 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !359, line: 266) -!366 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !367, entity: !369, line: 56) -!367 = !DINamespace(name: "__gnu_debug", scope: null, file: !368, line: 54) -!368 = !DIFile(filename: "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/debug/debug.h", directory: "/home/hebi/github/callgraph/benchmark") -!369 = !DINamespace(name: "__debug", scope: !21, file: !368, line: 48) -!370 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !"_ZTS5lconv", line: 53) -!371 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !372, line: 54) -!372 = !DISubprogram(name: "setlocale", scope: !18, file: !18, line: 125, type: !373, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!373 = !DISubroutineType(types: !374) -!374 = !{!90, !28, !170} -!375 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !376, line: 55) -!376 = !DISubprogram(name: "localeconv", scope: !18, file: !18, line: 128, type: !377, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!377 = !DISubroutineType(types: !378) -!378 = !{!379} -!379 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS5lconv", size: 64, align: 64) -!380 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !381, line: 64) -!381 = !DISubprogram(name: "isalnum", scope: !382, file: !382, line: 111, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!382 = !DIFile(filename: "/usr/include/ctype.h", directory: "/home/hebi/github/callgraph/benchmark") -!383 = !DISubroutineType(types: !384) -!384 = !{!28, !28} -!385 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !386, line: 65) -!386 = !DISubprogram(name: "isalpha", scope: !382, file: !382, line: 112, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!387 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !388, line: 66) -!388 = !DISubprogram(name: "iscntrl", scope: !382, file: !382, line: 113, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!389 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !390, line: 67) -!390 = !DISubprogram(name: "isdigit", scope: !382, file: !382, line: 114, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!391 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !392, line: 68) -!392 = !DISubprogram(name: "isgraph", scope: !382, file: !382, line: 116, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!393 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !394, line: 69) -!394 = !DISubprogram(name: "islower", scope: !382, file: !382, line: 115, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!395 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !396, line: 70) -!396 = !DISubprogram(name: "isprint", scope: !382, file: !382, line: 117, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!397 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !398, line: 71) -!398 = !DISubprogram(name: "ispunct", scope: !382, file: !382, line: 118, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!399 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !400, line: 72) -!400 = !DISubprogram(name: "isspace", scope: !382, file: !382, line: 119, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!401 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !402, line: 73) -!402 = !DISubprogram(name: "isupper", scope: !382, file: !382, line: 120, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!403 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !404, line: 74) -!404 = !DISubprogram(name: "isxdigit", scope: !382, file: !382, line: 121, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!405 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !406, line: 75) -!406 = !DISubprogram(name: "tolower", scope: !382, file: !382, line: 125, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!407 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !408, line: 76) -!408 = !DISubprogram(name: "toupper", scope: !382, file: !382, line: 128, type: !383, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!409 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !347, entity: !410, line: 44) -!410 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", scope: !21, file: !22, line: 1857, baseType: !168) -!411 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !347, entity: !412, line: 45) -!412 = !DIDerivedType(tag: DW_TAG_typedef, name: "ptrdiff_t", scope: !21, file: !22, line: 1858, baseType: !299) -!413 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !414, line: 82) -!414 = !DIDerivedType(tag: DW_TAG_typedef, name: "wctrans_t", file: !415, line: 186, baseType: !416) -!415 = !DIFile(filename: "/usr/include/wctype.h", directory: "/home/hebi/github/callgraph/benchmark") -!416 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !417, size: 64, align: 64) -!417 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !418) -!418 = !DIDerivedType(tag: DW_TAG_typedef, name: "__int32_t", file: !419, line: 40, baseType: !28) -!419 = !DIFile(filename: "/usr/include/bits/types.h", directory: "/home/hebi/github/callgraph/benchmark") -!420 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !421, line: 83) -!421 = !DIDerivedType(tag: DW_TAG_typedef, name: "wctype_t", file: !415, line: 52, baseType: !168) -!422 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !116, line: 84) -!423 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !424, line: 86) -!424 = !DISubprogram(name: "iswalnum", scope: !415, file: !415, line: 111, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!425 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !426, line: 87) -!426 = !DISubprogram(name: "iswalpha", scope: !415, file: !415, line: 117, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!427 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !428, line: 89) -!428 = !DISubprogram(name: "iswblank", scope: !415, file: !415, line: 162, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!429 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !430, line: 91) -!430 = !DISubprogram(name: "iswcntrl", scope: !415, file: !415, line: 120, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!431 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !432, line: 92) -!432 = !DISubprogram(name: "iswctype", scope: !415, file: !415, line: 175, type: !433, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!433 = !DISubroutineType(types: !434) -!434 = !{!28, !116, !421} -!435 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !436, line: 93) -!436 = !DISubprogram(name: "iswdigit", scope: !415, file: !415, line: 124, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!437 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !438, line: 94) -!438 = !DISubprogram(name: "iswgraph", scope: !415, file: !415, line: 128, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!439 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !440, line: 95) -!440 = !DISubprogram(name: "iswlower", scope: !415, file: !415, line: 133, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!441 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !442, line: 96) -!442 = !DISubprogram(name: "iswprint", scope: !415, file: !415, line: 136, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!443 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !444, line: 97) -!444 = !DISubprogram(name: "iswpunct", scope: !415, file: !415, line: 141, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!445 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !446, line: 98) -!446 = !DISubprogram(name: "iswspace", scope: !415, file: !415, line: 146, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!447 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !448, line: 99) -!448 = !DISubprogram(name: "iswupper", scope: !415, file: !415, line: 151, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!449 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !450, line: 100) -!450 = !DISubprogram(name: "iswxdigit", scope: !415, file: !415, line: 156, type: !310, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!451 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !452, line: 101) -!452 = !DISubprogram(name: "towctrans", scope: !415, file: !415, line: 221, type: !453, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!453 = !DISubroutineType(types: !454) -!454 = !{!116, !116, !414} -!455 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !456, line: 102) -!456 = !DISubprogram(name: "towlower", scope: !415, file: !415, line: 194, type: !457, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!457 = !DISubroutineType(types: !458) -!458 = !{!116, !116} -!459 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !460, line: 103) -!460 = !DISubprogram(name: "towupper", scope: !415, file: !415, line: 197, type: !457, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!461 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !462, line: 104) -!462 = !DISubprogram(name: "wctrans", scope: !415, file: !415, line: 218, type: !463, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!463 = !DISubroutineType(types: !464) -!464 = !{!414, !170} -!465 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !21, entity: !466, line: 105) -!466 = !DISubprogram(name: "wctype", scope: !415, file: !415, line: 171, type: !467, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) -!467 = !DISubroutineType(types: !468) -!468 = !{!421, !170} -!469 = !{i32 2, !"Dwarf Version", i32 4} -!470 = !{i32 2, !"Debug Info Version", i32 3} -!471 = !{!"clang version 3.9.0 (trunk 259875) (llvm/trunk 259862)"} -!472 = !DILocation(line: 74, column: 25, scope: !82) -!473 = !DILocation(line: 74, column: 25, scope: !474) -!474 = !DILexicalBlockFile(scope: !82, file: !83, discriminator: 1) -!475 = !DILocalVariable(name: "argc", arg: 1, scope: !86, file: !1, line: 45, type: !28) -!476 = !DIExpression() -!477 = !DILocation(line: 45, column: 14, scope: !86) -!478 = !DILocalVariable(name: "argv", arg: 2, scope: !86, file: !1, line: 45, type: !89) -!479 = !DILocation(line: 45, column: 26, scope: !86) -!480 = !DILocation(line: 46, column: 3, scope: !86) -!481 = !DILocalVariable(name: "a", scope: !86, file: !1, line: 47, type: !482) -!482 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A", size: 64, align: 64) -!483 = !DILocation(line: 47, column: 6, scope: !86) -!484 = !DILocation(line: 47, column: 10, scope: !86) -!485 = !DILocation(line: 47, column: 14, scope: !86) -!486 = !DILocation(line: 47, column: 6, scope: !487) -!487 = !DILexicalBlockFile(scope: !86, file: !1, discriminator: 1) -!488 = !DILocation(line: 48, column: 3, scope: !86) -!489 = !DILocation(line: 49, column: 5, scope: !86) -!490 = !DILocation(line: 49, column: 3, scope: !86) -!491 = !DILocalVariable(name: "e", scope: !86, file: !1, line: 50, type: !492) -!492 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1C", size: 64, align: 64) -!493 = !DILocation(line: 50, column: 6, scope: !86) -!494 = !DILocation(line: 50, column: 10, scope: !86) -!495 = !DILocation(line: 50, column: 14, scope: !86) -!496 = !DILocation(line: 50, column: 14, scope: !487) -!497 = !DILocation(line: 50, column: 14, scope: !498) -!498 = !DILexicalBlockFile(scope: !86, file: !1, discriminator: 2) -!499 = !DILocation(line: 51, column: 3, scope: !86) -!500 = !DILocation(line: 52, column: 3, scope: !86) -!501 = !DILocation(line: 53, column: 1, scope: !86) -!502 = !DILocation(line: 53, column: 1, scope: !487) -!503 = !DILocation(line: 47, column: 10, scope: !498) -!504 = !DILocation(line: 47, column: 10, scope: !505) -!505 = !DILexicalBlockFile(scope: !86, file: !1, discriminator: 3) -!506 = !DILocation(line: 42, column: 1, scope: !92) -!507 = !DILocalVariable(name: "this", arg: 1, scope: !93, type: !482, flags: DIFlagArtificial | DIFlagObjectPointer) -!508 = !DILocation(line: 0, scope: !93) -!509 = !DILocation(line: 11, column: 7, scope: !93) -!510 = !DILocation(line: 11, column: 8, scope: !93) -!511 = !DILocalVariable(name: "this", arg: 1, scope: !95, type: !512, flags: DIFlagArtificial | DIFlagObjectPointer) -!512 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1E", size: 64, align: 64) -!513 = !DILocation(line: 0, scope: !95) -!514 = !DILocation(line: 33, column: 7, scope: !95) -!515 = !DILocalVariable(name: "this", arg: 1, scope: !94, type: !482, flags: DIFlagArtificial | DIFlagObjectPointer) -!516 = !DILocation(line: 0, scope: !94) -!517 = !DILocation(line: 13, column: 3, scope: !94) -!518 = !DILocalVariable(name: "this", arg: 1, scope: !97, type: !519, flags: DIFlagArtificial | DIFlagObjectPointer) -!519 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1D", size: 64, align: 64) -!520 = !DILocation(line: 0, scope: !97) -!521 = !DILocation(line: 28, column: 7, scope: !97) -!522 = !DILocalVariable(name: "this", arg: 1, scope: !103, type: !512, flags: DIFlagArtificial | DIFlagObjectPointer) -!523 = !DILocation(line: 0, scope: !103) -!524 = !DILocalVariable(name: "a", scope: !103, file: !1, line: 35, type: !482) -!525 = !DILocation(line: 35, column: 8, scope: !103) -!526 = !DILocation(line: 35, column: 12, scope: !103) -!527 = !DILocation(line: 35, column: 16, scope: !103) -!528 = !DILocation(line: 35, column: 16, scope: !529) -!529 = !DILexicalBlockFile(scope: !103, file: !1, discriminator: 4) -!530 = !DILocation(line: 35, column: 12, scope: !531) -!531 = !DILexicalBlockFile(scope: !103, file: !1, discriminator: 1) -!532 = !DILocation(line: 35, column: 8, scope: !531) -!533 = !DILocation(line: 36, column: 5, scope: !103) -!534 = !DILocation(line: 37, column: 3, scope: !103) -!535 = !DILocation(line: 37, column: 3, scope: !531) -!536 = !DILocation(line: 35, column: 12, scope: !537) -!537 = !DILexicalBlockFile(scope: !103, file: !1, discriminator: 2) -!538 = !DILocation(line: 35, column: 12, scope: !539) -!539 = !DILexicalBlockFile(scope: !103, file: !1, discriminator: 3) -!540 = !DILocalVariable(name: "this", arg: 1, scope: !99, type: !492, flags: DIFlagArtificial | DIFlagObjectPointer) -!541 = !DILocation(line: 0, scope: !99) -!542 = !DILocation(line: 22, column: 7, scope: !99) -!543 = !DILocalVariable(name: "this", arg: 1, scope: !102, type: !519, flags: DIFlagArtificial | DIFlagObjectPointer) -!544 = !DILocation(line: 0, scope: !102) -!545 = !DILocation(line: 29, column: 24, scope: !102) -!546 = !DILocalVariable(name: "this", arg: 1, scope: !101, type: !492, flags: DIFlagArtificial | DIFlagObjectPointer) -!547 = !DILocation(line: 0, scope: !101) -!548 = !DILocation(line: 24, column: 24, scope: !101) -!549 = !DILocalVariable(name: "this", arg: 1, scope: !104, type: !550, flags: DIFlagArtificial | DIFlagObjectPointer) -!550 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1B", size: 64, align: 64) -!551 = !DILocation(line: 0, scope: !104) -!552 = !DILocation(line: 17, column: 7, scope: !104) -!553 = !DILocalVariable(name: "this", arg: 1, scope: !106, type: !550, flags: DIFlagArtificial | DIFlagObjectPointer) -!554 = !DILocation(line: 0, scope: !106) -!555 = !DILocation(line: 18, column: 23, scope: !106) -!556 = !DILocation(line: 0, scope: !107) diff --git a/hebicg/CMakeLists.txt b/hebicg/CMakeLists.txt index b84e51a..e9bad08 100644 --- a/hebicg/CMakeLists.txt +++ b/hebicg/CMakeLists.txt @@ -1,2 +1,2 @@ -# add_library(HebiPass MODULE Pass.cpp) -add_library(HebiCallGraphPass MODULE hebicg.cpp) + +add_llvm_library(HebiCallGraphPass MODULE hebicg.cpp PLUGIN_TOOL opt) diff --git a/hebicg/Makefile b/hebicg/Makefile deleted file mode 100644 index a791536..0000000 --- a/hebicg/Makefile +++ /dev/null @@ -1,168 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.4 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/bin/cmake - -# The command to remove a file. -RM = /usr/local/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/hebi/github/callgraph - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/hebi/github/callgraph - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - cd /home/hebi/github/callgraph && $(CMAKE_COMMAND) -E cmake_progress_start /home/hebi/github/callgraph/CMakeFiles /home/hebi/github/callgraph/hebicg/CMakeFiles/progress.marks - cd /home/hebi/github/callgraph && $(MAKE) -f CMakeFiles/Makefile2 hebicg/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/hebi/github/callgraph/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/hebi/github/callgraph && $(MAKE) -f CMakeFiles/Makefile2 hebicg/clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/hebi/github/callgraph && $(MAKE) -f CMakeFiles/Makefile2 hebicg/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/hebi/github/callgraph && $(MAKE) -f CMakeFiles/Makefile2 hebicg/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/hebi/github/callgraph && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Convenience name for target. -hebicg/CMakeFiles/HebiCallGraphPass.dir/rule: - cd /home/hebi/github/callgraph && $(MAKE) -f CMakeFiles/Makefile2 hebicg/CMakeFiles/HebiCallGraphPass.dir/rule -.PHONY : hebicg/CMakeFiles/HebiCallGraphPass.dir/rule - -# Convenience name for target. -HebiCallGraphPass: hebicg/CMakeFiles/HebiCallGraphPass.dir/rule - -.PHONY : HebiCallGraphPass - -# fast build rule for target. -HebiCallGraphPass/fast: - cd /home/hebi/github/callgraph && $(MAKE) -f hebicg/CMakeFiles/HebiCallGraphPass.dir/build.make hebicg/CMakeFiles/HebiCallGraphPass.dir/build -.PHONY : HebiCallGraphPass/fast - -# target to build an object file -hebicg.o: - cd /home/hebi/github/callgraph && $(MAKE) -f hebicg/CMakeFiles/HebiCallGraphPass.dir/build.make hebicg/CMakeFiles/HebiCallGraphPass.dir/hebicg.o -.PHONY : hebicg.o - -# target to preprocess a source file -hebicg.i: - cd /home/hebi/github/callgraph && $(MAKE) -f hebicg/CMakeFiles/HebiCallGraphPass.dir/build.make hebicg/CMakeFiles/HebiCallGraphPass.dir/hebicg.i -.PHONY : hebicg.i - -# target to generate assembly for a file -hebicg.s: - cd /home/hebi/github/callgraph && $(MAKE) -f hebicg/CMakeFiles/HebiCallGraphPass.dir/build.make hebicg/CMakeFiles/HebiCallGraphPass.dir/hebicg.s -.PHONY : hebicg.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... HebiCallGraphPass" - @echo "... hebicg.o" - @echo "... hebicg.i" - @echo "... hebicg.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/hebi/github/callgraph && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/hebicg/hebicg.cpp b/hebicg/hebicg.cpp index e93fc97..20a28bb 100644 --- a/hebicg/hebicg.cpp +++ b/hebicg/hebicg.cpp @@ -1,19 +1,23 @@ #include "hebicg.h" #include +#include +#include #include #include #include #include #include + std::string func_name(Function *func) { if (func->getName() == "main") return "main"; DISubprogram *disubprogram = func->getSubprogram(); if (disubprogram) { - return disubprogram->getName().str(); + return "\"" + disubprogram->getName().str() + "\""; } return ""; } + class HebiCallGraph { public: HebiCallGraph(Function *main_func) : m_main(main_func) {} @@ -151,6 +155,8 @@ class HebiCallGraphPass : public ModulePass { public: static char ID; HebiCallGraphPass() : ModulePass(ID) {} + + virtual bool runOnModule (Module &M) override { // errs() << "hello world\n"; // for (Function &F : M) { @@ -211,7 +217,7 @@ class HebiCallGraphPass : public ModulePass { unsigned num = call_inst->getNumArgOperands(); if (num >0) { } - Value *v = call_inst->getCalledValue(); + Value *v = call_inst->getCalledOperand(); if (v) { errs() << "=== value: " << "\n"; errs() << *v << "\n"; @@ -254,3 +260,10 @@ char HebiCallGraphPass::ID = 0; static RegisterPass X("hebicg", "Hebi Call Graph Pass", false, false); + +#if 0 +static RegisterStandardPasses Y( + PassManagerBuilder::EP_EarlyAsPossible, + [](const PassManagerBuilder &Builder, + legacy::PassManagerBase &PM) { PM.add(new HebiCallGraphPass()); }); +#endif diff --git a/test.sh b/test.sh index 348141c..5cb5545 100755 --- a/test.sh +++ b/test.sh @@ -1,3 +1,5 @@ #!/bin/bash -opt -load ./hebicg/libHebiCallGraphPass.so -hebicg benchmark/test1.bc -opt -load ./hebicg/libHebiCallGraphPass.so -hebicg benchmark/simple-c-func.bc +set -x +make -C ./benchmark/ +opt -load ./build/hebicg/libHebiCallGraphPass.so -hebicg benchmark/test1.bc +opt -load ./build/hebicg/libHebiCallGraphPass.so -hebicg benchmark/simple-c-func.bc diff --git a/test_macos.sh b/test_macos.sh new file mode 100755 index 0000000..429571f --- /dev/null +++ b/test_macos.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -x +make -C ./benchmark/ +opt -load ./build/hebicg/HebiCallGraphPass.dylib -hebicg benchmark/test1.bc +opt -load ./build/hebicg/HebiCallGraphPass.dylib -hebicg benchmark/simple-c-func.bc