Commit ef8e3e45 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[cleanup][codegen] Fix -Wshadow warnings

These helper macros declare the same variable (asm_code_comment),
when used in 2 scopes (one inside another), we get a shadow variable.
In all the current usages, we always have a ASM_CODE_COMMENT in
the outer scope (which adds a comment with the function name),
and in the inner scope uses a string. It is sufficient to fix these
cases by giving the first case (function name) a different variable
name.

Bug: v8:12244,v8:12245
Change-Id: Ib23d9796f10937f27ce29913c0fa648501edbda8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3283620Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77930}
parent 97390bdc
...@@ -470,7 +470,7 @@ class V8_EXPORT_PRIVATE V8_NODISCARD CpuFeatureScope { ...@@ -470,7 +470,7 @@ class V8_EXPORT_PRIVATE V8_NODISCARD CpuFeatureScope {
#ifdef V8_CODE_COMMENTS #ifdef V8_CODE_COMMENTS
#define ASM_CODE_COMMENT(asm) ASM_CODE_COMMENT_STRING(asm, __func__) #define ASM_CODE_COMMENT(asm) ASM_CODE_COMMENT_STRING(asm, __func__)
#define ASM_CODE_COMMENT_STRING(asm, comment) \ #define ASM_CODE_COMMENT_STRING(asm, comment) \
AssemblerBase::CodeComment asm_code_comment(asm, comment) AssemblerBase::CodeComment asm_code_comment##__LINE__(asm, comment)
#else #else
#define ASM_CODE_COMMENT(asm) #define ASM_CODE_COMMENT(asm)
#define ASM_CODE_COMMENT_STRING(asm, ...) #define ASM_CODE_COMMENT_STRING(asm, ...)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment