From 4eaf66148ac7d99889325a2c3c78c78e130dba2a Mon Sep 17 00:00:00 2001 From: Marek Chalupa Date: Wed, 29 Nov 2023 13:41:23 +0100 Subject: [PATCH] tools/llvm-pta-dump: turn on `-ir` if `-dot` was turned on Dumping to graphviz works only for internal representation, so it make sense to turn it on if `-dot` is required. Other option would be to raise a warning or abort with the message, but I think automatically turning that on is better. Fixes #455. --- tools/llvm-pta-dump.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/llvm-pta-dump.cpp b/tools/llvm-pta-dump.cpp index 44cdfd859..28f9f6966 100644 --- a/tools/llvm-pta-dump.cpp +++ b/tools/llvm-pta-dump.cpp @@ -781,6 +781,11 @@ int main(int argc, char *argv[]) { callgraph = true; } + if (todot && !dump_ir) { + llvm::errs() << "Switch -dot requires -ir, switching -ir on."; + dump_ir = true; + } + llvm::LLVMContext context; std::unique_ptr M = parseModule("llvm-pta-dump", context, options);