FunctionType::ExtInfo holds such properties of a function which are needed
mostly for code gen. We should not compare these bits when checking for
structural equivalency.
Checking ExtInfo caused false ODR errors during CTU analysis (of tmux).
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
Hi Gabor,
Thank you for the patch. The reason for this change looks clear. However, I don't think omitting this comparison completely is what we want here. Instead, we can do a dance similar to ASTContext::mergeFunctionTypes() where all attributes but NoReturn are compared. What do you think?
That's a good point. I agree, we should check some bits (calling convention bits) but not all (e.g. noreturn bit). I am going to create another patch which replaces this.
Hi @a_sidorin ,
I have updated the patch as you suggested, to check the equivalence based on ASTContext::mergeFunctionTypes().
lib/AST/ASTStructuralEquivalence.cpp | ||
---|---|---|
301 | This comment is confusing b/c it looks like the noreturn bits are the only one you are not checking. | |
unittests/AST/StructuralEquivalenceTest.cpp | ||
373 | Can we get some more tests to be a little more thorough and can we also get a test where it is expected to to be false as well? |
Ping @shafik, I have addressed you comments, could you please take another look? If you don't have any objections, could you please approve?
This comment is confusing b/c it looks like the noreturn bits are the only one you are not checking.