[PATCH] D136088: [AArch64]SME2 instructions that use ZTO operand

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 03:13:53 PDT 2022


c-rhodes added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:74
+  Matrix,
+  LookupTable
 };
----------------
this new RegKind is causing a warning
```/home/culrho01/llvm-project/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:2823:11: warning: enumeration value 'LookupTable' not handled in switch [-Wswitch]
  switch (K) {
          ^```


================
Comment at: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:4346-4347
+  SMLoc StartLoc = getLoc();
+  const AsmToken &Tok = getTok();
+  StringRef Name = Tok.getString().lower();
+
----------------
this is causing a warning:

```/home/culrho01/llvm-project/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:4347:20: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
  StringRef Name = Tok.getString().lower();
                   ^~~~~~~~~~~~~~~~~~~~~~~```

you have to be careful with `StringRef::lower` it returns an `std::string` and storing back to StringRef can cause weird behavior. In this case you don't need to lower at all anyway since `matchRegisterNameAlias` does a case insensitive match.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136088



More information about the llvm-commits mailing list