summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-as/llvm-as.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-10-02 18:31:29 +0000
committerAdrian Prantl <aprantl@apple.com>2017-10-02 18:31:29 +0000
commita8b2ddbde453fab0db90be21b9a1ff961a7770e0 (patch)
tree190712a839a2ce48d61e75501d2f68440891a2d8 /llvm/tools/llvm-as/llvm-as.cpp
parent6e17c00a88e23d0cc4cb491bfd0830f3df7fff66 (diff)
downloadbcm5719-llvm-a8b2ddbde453fab0db90be21b9a1ff961a7770e0.tar.gz
bcm5719-llvm-a8b2ddbde453fab0db90be21b9a1ff961a7770e0.zip
Move the stripping of invalid debug info from the Verifier to AutoUpgrade.
This came out of a recent discussion on llvm-dev (https://reviews.llvm.org/D38042). Currently the Verifier will strip the debug info metadata from a module if it finds the dbeug info to be malformed. This feature is very valuable since it allows us to improve the Verifier by making it stricter without breaking bcompatibility, but arguable the Verifier pass should not be modifying the IR. This patch moves the stripping of broken debug info into AutoUpgrade (UpgradeDebugInfo to be precise), which is a much better location for this since the stripping of malformed (i.e., produced by older, buggy versions of Clang) is a (harsh) form of AutoUpgrade. This change is mostly NFC in nature, the one big difference is the behavior when LLVM module passes are introducing malformed debug info. Prior to this patch, a NoAsserts build would have printed a warning and stripped the debug info, after this patch the Verifier will report a fatal error. I believe this behavior is actually more desirable anyway. Differential Revision: https://reviews.llvm.org/D38184 llvm-svn: 314699
Diffstat (limited to 'llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r--llvm/tools/llvm-as/llvm-as.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp
index dffe9e6ace3..9f0f162b74f 100644
--- a/llvm/tools/llvm-as/llvm-as.cpp
+++ b/llvm/tools/llvm-as/llvm-as.cpp
@@ -97,7 +97,8 @@ int main(int argc, char **argv) {
// Parse the file now...
SMDiagnostic Err;
- std::unique_ptr<Module> M = parseAssemblyFile(InputFilename, Err, Context);
+ std::unique_ptr<Module> M =
+ parseAssemblyFile(InputFilename, Err, Context, nullptr, !DisableVerify);
if (!M.get()) {
Err.print(argv[0], errs());
return 1;
OpenPOWER on IntegriCloud