Emit debug info flag that indicates that a parameter has unchanged value through the course of a function.
This info will be used for emitting DW_OP_entry_value expressions for the parameter.
Authors: @asowda, @NikolaPrica, @djtodoro, @ivanbaev
Differential D58035
[clang/DIVar] Emit flag for params that have unchanged values djtodoro on Feb 11 2019, 3:21 AM. Authored by
Details Emit debug info flag that indicates that a parameter has unchanged value through the course of a function. This info will be used for emitting DW_OP_entry_value expressions for the parameter. Authors: @asowda, @NikolaPrica, @djtodoro, @ivanbaev
Diff Detail
Event Timeline
Comment Actions + rsmith, + bricci for review. I was under the impression that space inside VarDecl was quite constrained. Pardon the likely naive question, but: is there any way to make the representation more compact (maybe sneak a bit into ParmVarDeclBitfields)? Comment Actions If this bit is relevant to function parameters, why is getIsArgumentModified in VarDecl and not in ParamVarDecl ? What you can do is move the relevant methods to ParamVarDecl, and stash the bit in ParmVarDeclBitfields.
Comment Actions Oh and I think that you will also have to update the serialization code/de-serialization code in ASTReaderDecl.cpp / ASTWriterDecl.cpp. You might also have to update TreeTransform but I am less familiar with this. Comment Actions I am wondering about the semantics of this bit. I don't think that you can know for sure within clang whether a variable has been modified. The best you can do is know for sure that some variable has been modified, but I don't think you can prove that it has not been modified. Consequently I am wondering if you should change the name of this flag to something like IsArgumentKnownToBeModified. Orthogonal to this you need to also add tests for templates. Comment Actions
@vsk Thanks for the comment! Sure, it is better idea. Initially, we thought this could be used even for local variables, but since we are using it only for parameters it makes more sense.
Comment Actions @riccibruno Thanks for your comments!
I've added ASTReaderDecl.cpp / ASTWriterDecl.cpp, but looking at TreeTransform I'm not sure if there is a place for adding something regarding this.
I agree! You are right, good idea! Comment Actions
Comment Actions
Alternatively perhaps you could re-use getMemoryLocation() from D57660. It would handle for you members, references, structured bindings +more in a relatively self-contained code. Comment Actions
@lebedev.ri, @riccibruno Thanks for your advices! We'll check this also.
Comment Actions -Careful use of dyn_cast
Comment Actions -Add SPDefCache to speed up the process |