steakhal added a comment.

In D52957#2379330 <https://reviews.llvm.org/D52957#2379330>, @NoQ wrote:
> You cannot have an argument expression because there's no argument expression 
> anywhere in the AST. There's an argument, but it's not computed as a value of 
> any syntactic expression. If there was no argument, `getArgExpr(0)` would 
> have crashed; but it returns a `nullptr` which indicates that there's no 
> expression to return.

Aa, now I see. Thanks.

> The argument value can be computed by taking the size of the type (and 
> aligning to the requested alignment, i guess(?)) and multiplying it by array 
> size (for which there is an expression) in case of array new. It'd be great 
> to write down these computations once in the `CallEvent` class and then 
> re-use them.

Should I provide them as member functions to the `CXXAllocatorCall ` class?
Something like `size_t getAlignment()` and `size_t getAllocationSize()`?

> I guess the actual shocking truth here is that we've never performed these 
> computations when inlining the allocators; the size argument that's bound to 
> the size parameter in the Store while the allocator body is inlined ended up 
> being a fresh symbol, which is not correct.

I might miss something to understand this. Could you elaborate on that if you 
think is related?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D52957

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to