From f91a31b7a36d86d5f7f0d99a982a9f36024660ba Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Mon, 23 Oct 2017 18:11:31 +0000 Subject: [PATCH] Patch in llvm-svn: 316358 --- llvm/tools/llvm-cfi-verify/CMakeLists.txt | 5 ++--- llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt | 4 +++- llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h | 3 ++- llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/llvm/tools/llvm-cfi-verify/CMakeLists.txt b/llvm/tools/llvm-cfi-verify/CMakeLists.txt index bf65cf7..ae203e5 100644 --- a/llvm/tools/llvm-cfi-verify/CMakeLists.txt +++ b/llvm/tools/llvm-cfi-verify/CMakeLists.txt @@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos + CFIVerify MC MCParser Object @@ -11,8 +12,6 @@ set(LLVM_LINK_COMPONENTS ) add_llvm_tool(llvm-cfi-verify - llvm-cfi-verify.cpp - lib/FileAnalysis.cpp - ) + llvm-cfi-verify.cpp) add_subdirectory(lib) diff --git a/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt b/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt index 814e30a..8cbbc79c 100644 --- a/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt +++ b/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt @@ -1,7 +1,9 @@ add_library(LLVMCFIVerify STATIC FileAnalysis.cpp - FileAnalysis.h) + FileAnalysis.h + GraphBuilder.cpp + GraphBuilder.h) llvm_update_compile_flags(LLVMCFIVerify) llvm_map_components_to_libnames(libs diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h index df1ad60..3c24bcd 100644 --- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h +++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h @@ -10,6 +10,7 @@ #ifndef LLVM_CFI_VERIFY_FILE_ANALYSIS_H #define LLVM_CFI_VERIFY_FILE_ANALYSIS_H +#include "llvm/ADT/DenseMap.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" @@ -161,7 +162,7 @@ private: // Contains a mapping between a specific address, and a list of instructions // that use this address as a branch target (including call instructions). - std::unordered_map> StaticBranchTargetings; + DenseMap> StaticBranchTargetings; // A list of addresses of indirect control flow instructions. std::set IndirectInstructions; diff --git a/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt b/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt index f370400..938b90e 100644 --- a/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt +++ b/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt @@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos + CFIVerify MC MCParser Object @@ -13,6 +14,6 @@ set(LLVM_LINK_COMPONENTS list(FIND LLVM_TARGETS_TO_BUILD "X86" x86_idx) if (NOT x86_idx LESS 0) add_llvm_unittest(CFIVerifyTests - FileAnalysis.cpp) - target_link_libraries(CFIVerifyTests LLVMCFIVerify) + FileAnalysis.cpp + GraphBuilder.cpp) endif() -- 2.7.4