summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Utils.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2016-10-25 18:44:13 +0000
committerMichael Ilseman <milseman@apple.com>2016-10-25 18:44:13 +0000
commite542804343ac52f40b2310eff4b3f1f045d5e5f4 (patch)
tree0655ff42cccc766345ac4ce39d9aba63ddcc9910 /llvm/lib/Transforms/Utils/Utils.cpp
parente32564774c09344e80ea8f17bdc652412543f77b (diff)
downloadbcm5719-llvm-e542804343ac52f40b2310eff4b3f1f045d5e5f4.tar.gz
bcm5719-llvm-e542804343ac52f40b2310eff4b3f1f045d5e5f4.zip
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. Thanks to Adrian Prantl for stewarding this patch! llvm-svn: 285094
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 cfd85516108..7b9de2eadc6 100644
--- a/llvm/lib/Transforms/Utils/Utils.cpp
+++ b/llvm/lib/Transforms/Utils/Utils.cpp
@@ -31,6 +31,7 @@ void llvm::initializeTransformUtils(PassRegistry &Registry) {
initializeLowerSwitchPass(Registry);
initializeNameAnonGlobalLegacyPassPass(Registry);
initializePromoteLegacyPassPass(Registry);
+ initializeStripNonLineTableDebugInfoPass(Registry);
initializeUnifyFunctionExitNodesPass(Registry);
initializeInstSimplifierPass(Registry);
initializeMetaRenamerPass(Registry);
OpenPOWER on IntegriCloud