Details
- Reviewers
nikic - Commits
- rG9709bea4e084: [clang] Convert a few tests to opaque pointers
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM
clang/test/CodeGenCXX/const-init-cxx11.cpp | ||
---|---|---|
353 | Not sure why exactly this happened, but should be harmless. I believe we sometimes generate anon structs for initializaton because the types used for initialization are not always compatible with the nominal LLVM memory type -- I guess there previously was a mismatch in pointer types here or something. |
clang/test/CodeGenCXX/const-init-cxx11.cpp | ||
---|---|---|
353 | This is where the behavior diverges: llvm::Constant *ConstantAggregateBuilder::buildFrom( CodeGenModule &CGM, ArrayRef<llvm::Constant *> Elems, ArrayRef<CharUnits> Offsets, CharUnits StartOffset, CharUnits Size, bool NaturalLayout, llvm::Type *DesiredTy, bool AllowOversized) { ... // Pick the type to use. If the type is layout identical to the desired // type then use it, otherwise use whatever the builder produced for us. if (llvm::StructType *DesiredSTy = dyn_cast<llvm::StructType>(DesiredTy)) { if (DesiredSTy->isLayoutIdentical(STy)) STy = DesiredSTy; } ... With typed pointers, STy and DesiredSTy respectively are: { i8** } %struct.nsMemoryImpl = type { i32 (...)** } isLayoutIdentical, despite its name, actually checks for full equivalence of structs, not just the layout. That is, it is no different from operator==. The code snippet above is the only use of isLayoutIdentical. |
clang/test/CodeGenCXX/const-init-cxx11.cpp | ||
---|---|---|
353 |
Quick test shows this is not true... |
I wanted to check whether you plan to do more opaque pointer test conversions in clang. Just to make sure we don't duplicate work...
This was one suspicious change. An anonymous struct became named.