From c76f67329dc55a406f2f2f255da9949947f72ffa Mon Sep 17 00:00:00 2001 From: amimo <61569276@qq.com> Date: Mon, 28 Oct 2019 21:53:58 +0800 Subject: [PATCH] delete unused decrypt fucntion --- llvm/lib/Transforms/Obfuscation/StringEncryption.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/Transforms/Obfuscation/StringEncryption.cpp b/llvm/lib/Transforms/Obfuscation/StringEncryption.cpp index 5e483d84e..387d460fa 100644 --- a/llvm/lib/Transforms/Obfuscation/StringEncryption.cpp +++ b/llvm/lib/Transforms/Obfuscation/StringEncryption.cpp @@ -191,6 +191,11 @@ bool StringEncryption::runOnModule(Module &M) { // delete unused global variables deleteUnusedGlobalVariable(); + for (CSPEntry *Entry: ConstantStringPool) { + if (Entry->DecFunc->use_empty()) { + Entry->DecFunc->eraseFromParent(); + } + } return Changed; }