[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-20 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/99433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-20 Thread Hirofumi Nakamura via cfe-commits
https://github.com/hnakamura5 approved this pull request. https://github.com/llvm/llvm-project/pull/99433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/99433 >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH 1/3] [clang-format] Fix a bug in annotating `*` in `#define`s Fixes #99

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/99433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
owenca wrote: > How about judging whether the FunctionLBrace exists as the opener of the > outer context? That wouldn't work as we must also handle function calls at the top level when dealing with macro definitions. https://github.com/llvm/llvm-project/pull/99433

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-19 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/99433 >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating `*` in `#define`s Fixes #99

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-18 Thread Hirofumi Nakamura via cfe-commits
hnakamura5 wrote: This change certainly fixes the issue, but also seems specific for the reported code. For example it does not work well for the case the line contains something else as, ``` #define FN(N) void fn(void *addr) { a + f(addr, 0, N * two); } ``` This results the annotations where

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Fixes #99271. --- Full diff: https://github.com/llvm/llvm-project/pull/99433.diff 2 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+2-1) - (modified) clang/unittests/Format/TokenAnnot

[clang] [clang-format] Fix a bug in annotating `*` in `#define`s (PR #99433)

2024-07-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/99433 Fixes #99271. >From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 17 Jul 2024 22:30:21 -0700 Subject: [PATCH] [clang-format] Fix a bug in annotating `*` in `#define`s