[PATCH] D125421: [TableGen] Add generation of argument register lists

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 15:18:11 PDT 2022


void added inline comments.


================
Comment at: llvm/utils/TableGen/CallingConvEmitter.cpp:106-108
+                                 std::string Name =
+                                     Class.first->getNameInitAsString();
+                                 return StringRef(Name).startswith("CCIfSwift");
----------------
void wrote:
> nickdesaulniers wrote:
> > nickdesaulniers wrote:
> > > void wrote:
> > > > nickdesaulniers wrote:
> > > > > ```
> > > > > StringRef Name = Class.first->getNameInitAsString();
> > > > > return Name.startswith("CCIfSwift");
> > > > > ```
> > > > > Not sure if that would fit on one line if it was a single statement?
> > > > It goes over 80 columns.
> > > I still think the pair of expressions need not make any mention of `std::string` if you just construct a `StringRef` from the get go.
> > s/expressions/statements/
> Oh, sorry. I misunderstood what you wanted. Done.
The reason I did that initially was to avoid this warning:

```
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/TableGen/CallingConvEmitter.cpp:108:38: error: object backing the pointer will be destroyed at the end of the full-expression [-Werror,-Wdangling-gsl]
                                     Class.first->getNameInitAsString();
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125421



More information about the llvm-commits mailing list