[PATCH] D76863: Fix SelectionDAG Graph Printing on Windows

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 14:22:59 PDT 2020


rnk added a comment.

Sorry about the delay, I find this whole feature kind of concerning. Are you telling me that LLVM lets you write a file with an arbitrary filename, if not path?

So, if I want clang to overwrite some file, all I have to do is pass  `clang -mllvm -view-dag-combine1-dags` and I can create a file with a name from the input source? That seems dangerous.

Can you please move this code from the GraphWriter.h header to here?

  // Windows can't always handle long paths, so limit the length of the name.
  std::string N = Name.str();
  N = N.substr(0, std::min<std::size_t>(N.size(), 140));
  if (Filename.empty()) {
    Filename = createGraphFilename(N, FD);

`N` is only used if we call createGraphFilename anyway, and it feels related.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76863/new/

https://reviews.llvm.org/D76863





More information about the llvm-commits mailing list