[PATCH] D117801: [AMDGPU] Move const qualifier placement in AsmParser
Jacob Lambert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 20 15:28:17 PST 2022
lamb-j added a comment.
If I'm understanding correctly, moving const to the left of "MCSymbol *"' declares the object as const instead of the pointer. In this case, we get a compilation error on the following line:
llvm-project/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:1133:9: error: 'this' argument to member function 'setVariableValue' has type 'const llvm::MCSymbol', but function is not marked const
Sym->setVariableValue(MCConstantExpr::create(SgprIndexUnusedMin, *Ctx));
This error seems reasonable, as we're changing a member of Sym (Value). So in this case would we actually just want "MCSymbol *Sym" or "MCSymbol* const Sym"?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117801/new/
https://reviews.llvm.org/D117801
More information about the llvm-commits
mailing list