This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix label (de-)serialization in ASM statements.
ClosedPublic

Authored by VitaNuo on May 22 2023, 3:12 AM.

Diff Detail

Event Timeline

VitaNuo created this revision.May 22 2023, 3:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 3:12 AM
VitaNuo requested review of this revision.May 22 2023, 3:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 3:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
VitaNuo updated this revision to Diff 524211.May 22 2023, 3:14 AM

Remove template param.

kadircet added inline comments.May 22 2023, 5:06 AM
clang/test/PCH/asm-label.cpp
6

you can drop #pragma once know, as it won't be parsed again anyways

7

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);
}
kadircet accepted this revision.May 22 2023, 5:06 AM
This revision is now accepted and ready to land.May 22 2023, 5:06 AM
VitaNuo updated this revision to Diff 524342.May 22 2023, 8:53 AM
VitaNuo marked 2 inline comments as done.

Update test case.

This revision was landed with ongoing or failed builds.May 22 2023, 8:54 AM
This revision was automatically updated to reflect the committed changes.
nridge added a subscriber: nridge.Jul 6 2023, 7:39 PM