aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Utils.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2016-10-06 17:58:38 +0000
committerMichael Ilseman <milseman@apple.com>2016-10-06 17:58:38 +0000
commitd0a4db76324e40e38a23429c07eda76f9f26a153 (patch)
tree6ac35853dca1ba748f529745839c8d0e84ef4a16 /llvm/lib/Transforms/Utils/Utils.cpp
parent9a605f93a7e070b8a4a70043dc21825d9ced1e96 (diff)
downloadllvm-d0a4db76324e40e38a23429c07eda76f9f26a153.zip
llvm-d0a4db76324e40e38a23429c07eda76f9f26a153.tar.gz
llvm-d0a4db76324e40e38a23429c07eda76f9f26a153.tar.bz2
Add -strip-nonlinetable-debuginfo capability
This adds a new function to DebugInfo.cpp that takes an llvm::Module as input and removes all debug info metadata that is not directly needed for line tables, thus effectively stripping all type and variable information from the module. The primary motivation for this feature was the bitcode work flow (cf. http://lists.llvm.org/pipermail/llvm-dev/2016-June/100643.html for more background). This is not wired up yet, but will be in subsequent patches. For testing, the new functionality is exposed to opt with a -strip-nonlinetable-debuginfo option. The secondary use-case (and one that works right now!) is as a reduction pass in bugpoint. I added two new bugpoint options (-disable-strip-debuginfo and -disable-strip-debug-types) to control the new features. By default it will first attempt to remove all debug information, then only the type info, and then proceed to hack at any remaining MDNodes. llvm-svn: 283473
Diffstat (limited to 'llvm/lib/Transforms/Utils/Utils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Utils.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp
index aa23e80..35502df 100644
--- a/llvm/lib/Transforms/Utils/Utils.cpp
+++ b/llvm/lib/Transforms/Utils/Utils.cpp
@@ -30,6 +30,7 @@ void llvm::initializeTransformUtils(PassRegistry &Registry) {
initializeLowerSwitchPass(Registry);
initializeNameAnonGlobalLegacyPassPass(Registry);
initializePromoteLegacyPassPass(Registry);
+ initializeStripNonLineTableDebugInfoPass(Registry);
initializeUnifyFunctionExitNodesPass(Registry);
initializeInstSimplifierPass(Registry);
initializeMetaRenamerPass(Registry);