[llvm] [LLVM][AsmParser] Add support for C style comments (PR #111554)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 18:01:43 PDT 2024


================
@@ -262,6 +274,38 @@ void LLLexer::SkipLineComment() {
   }
 }
 
+/// SkipCComment - This skips C-style /**/ comments.  The only difference from C
+/// is that we allow nesting.
+bool LLLexer::SkipCComment() {
+  getNextChar(); // skip the star.
+  unsigned CommentDepth = 1;
+
+  while (true) {
+    int CurChar = getNextChar();
+    switch (CurChar) {
+    case EOF:
+      LexError("Unterminated comment!");
----------------
jurahul wrote:

Done.

https://github.com/llvm/llvm-project/pull/111554


More information about the llvm-commits mailing list