[PATCH] D141381: [codegen] Store address of indirect arguments on the stack

Felipe de Azevedo Piovezan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 16:59:37 PST 2023


fdeazeve added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.h:494
+                           CGBuilderTy &Builder,
+                           const bool UsePointerValue = false);
 
----------------
dblaikie wrote:
> fdeazeve wrote:
> > FWIW I used a `const` bool here to match the style already present in this class
> Examples of the things you were trying to be consistent with? Because the other by-value parameter here isn't const at the top level & const at the top level on function declaration parameters has no meaning, so especially here it should probably be omitted (& probably also in the definition, but it's a somewhat separate issue/has different tradeoffs)
The function on line 475 uses this same style:


```
  llvm::DILocalVariable *
  EmitDeclareOfAutoVariable(const VarDecl *Decl, llvm::Value *AI,
                            CGBuilderTy &Builder,
                            const bool UsePointerValue = false);
```

That said, I agree with you and personally would not have added const here, I'll remove it and then later we can maybe clean up other functions in this file


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141381/new/

https://reviews.llvm.org/D141381



More information about the cfe-commits mailing list