[PATCH] D146401: [clang-format] Don't squash Verilog escaped identifiers

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 25 13:51:38 PDT 2023


HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/unittests/Format/FormatTestVerilog.cpp:19
 protected:
-  static std::string format(llvm::StringRef Code, unsigned Offset,
-                            unsigned Length, const FormatStyle &Style) {
-    LLVM_DEBUG(llvm::errs() << "---\n");
-    LLVM_DEBUG(llvm::errs() << Code << "\n\n");
-    std::vector<tooling::Range> Ranges(1, tooling::Range(Offset, Length));
-    tooling::Replacements Replaces = reformat(Style, Code, Ranges);
-    auto Result = applyAllReplacements(Code, Replaces);
-    EXPECT_TRUE(static_cast<bool>(Result));
-    LLVM_DEBUG(llvm::errs() << "\n" << *Result << "\n\n");
-    return *Result;
-  }
-
-  static std::string
-  format(llvm::StringRef Code,
-         const FormatStyle &Style = getLLVMStyle(FormatStyle::LK_Verilog)) {
-    return format(Code, 0, Code.size(), Style);
+  virtual FormatStyle getDefaultStyle() const override {
+    return getLLVMStyle(FormatStyle::LK_Verilog);
----------------
Drop that virtual.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146401



More information about the cfe-commits mailing list