From fe6df26a8a75bb1bfb9b347302165e3d250d35d7 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Wed, 13 Apr 2016 17:20:10 +0000 Subject: Sanity check `opt` options compatibility: can't have module-summary or module-hash when emitting textual IR From: Mehdi Amini llvm-svn: 266216 --- llvm/tools/opt/opt.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/tools') diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 9a920ad6baf..a27ce735b53 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -620,9 +620,13 @@ int main(int argc, char **argv) { BOS = make_unique(Buffer); OS = BOS.get(); } - if (OutputAssembly) + if (OutputAssembly) { + if (EmitSummaryIndex) + report_fatal_error("Text output is incompatible with -module-summary"); + if (EmitModuleHash) + report_fatal_error("Text output is incompatible with -module-hash"); Passes.add(createPrintModulePass(*OS, "", PreserveAssemblyUseListOrder)); - else + } else Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder, EmitSummaryIndex, EmitModuleHash)); } -- cgit v1.2.3