Closed martong closed 5 years ago
It may be correct to check these values. But I am not sure if these are set correctly at the time of the check during import (in the imported FunctionProtoType
), these are copied at import but maybe updated later like isUsed
?
These are valid questions so I made my homework:
In VisitFunctionProtoType
or in VisitFunctionNoProtoType
we do not check any structural equivalency.
We do check, however, in VisitFunctionDecl
: in that function before we create the FunctionDecl
we first import the type which will end up calling VisitFunction[No]ProtoType
. Consequently, when we check for structural eq of two FunctionDecl
s we already have the ExtInfo
and their type properly initialized and set. Also I checked that the ExtInfo
is modified (copied) only in VisitFunctionProtoType
and in VisitFunctionNoProtoType
. So this seems safe to me.
Any objections to merge this?
This is related to: https://reviews.llvm.org/D53699
Alexey draws my attention to that we should not discard all info from the
ExtInfo
struct. We definitely want to check e.g. the calling convention bits.