[PATCH] D151073: [clang] Fix label (de-)serialization in ASM statements.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 05:06:37 PDT 2023


kadircet added inline comments.


================
Comment at: clang/test/PCH/asm-label.cpp:5
+#define HEADER_H
+#pragma once
+void MyMethod() {
----------------
you can drop `#pragma once` know, as it won't be parsed again anyways


================
Comment at: clang/test/PCH/asm-label.cpp:6
+#pragma once
+void MyMethod() {
+  void *bar;
----------------
let's still make sure this crashes with current version (I know i said we can simplify it, but it looks like we don't have any assertions, and moreover it's really hard to have any without significantly changing interfaces). So let's keep the template and at least 5 different operand names:

```
template <int = 0> void foo() {
label:
  void *bar;
  asm goto(""
           :
           : [op1] "r"(bar), [op2] "r"(bar), [op3] "r"(bar), [op4] "r"(bar)
           :
           : label);
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151073



More information about the cfe-commits mailing list