[all-commits] [llvm/llvm-project] ec12f5: [clang][codegen] Remember string used to create ll...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Tue Feb 9 02:12:34 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec12f5febed04dd32e7d4b766b2853d50fca9657
      https://github.com/llvm/llvm-project/commit/ec12f5febed04dd32e7d4b766b2853d50fca9657
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-02-09 (Tue, 09 Feb 2021)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [clang][codegen] Remember string used to create llvm::Regex for optimization remarks

Regular expression patterns passed through the command line are being used to create an instances of `llvm::Regex` and thrown away.

There is no API to serialize `Regex` back to the original pattern. This means we have no way to reconstruct the original pattern from command line. This is necessary for serializing `CompilerInvocation`.

This patch stores the original pattern string in `CodeGenOptions` alongside the `llvm::Regex` instance.

Reviewed By: dexonsmith, thegameg

Differential Revision: https://reviews.llvm.org/D96036




More information about the All-commits mailing list