Skip to content

Commit

Permalink
tools/llvm-pta-dump: turn on -ir if -dot was turned on
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mchalupa committed Nov 29, 2023
1 parent df6e4e2 commit 08b18a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/llvm-pta-dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<llvm::Module> M =
parseModule("llvm-pta-dump", context, options);
Expand Down

0 comments on commit 08b18a3

Please sign in to comment.