AaronBallman wrote: > So it seems that here seems to be the code piece that GCC uses to parse ASM > and the ATTRs: > > https://github.com/gcc-mirror/gcc/blob/ea05497d4a329f183ffb5428befc957c5522ef86/gcc/c/c-parser.cc#L2788-L2803 > > so it will peek for `RID_ASM` (which is the asm keyword), parse it, then go > to the next attributes. If `RID_ASM` is not provided, it will fall into the > attributes parsing and there is no code to parse the `RID_ASM` case. > Therefore, I think we will be fine if the ASM attributes are print before > anything else on the right side of a Decl.
FWIW, we shouldn't be looking at GCC's source code for inspiration due to potential licensing concerns (their source is under GPL). The custom parsing logic in Clang lives at: https://github.com/llvm/llvm-project/blob/327a89cbaebcc20b6b2484685be6ac8706944b12/clang/lib/Parse/ParseDecl.cpp#L2442 https://github.com/llvm/llvm-project/pull/162556 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
