hfinkel added inline comments.
================ Comment at: lib/CodeGen/CGRecordLayoutBuilder.cpp:411 + // component so as it can be accessed directly with lower cost. + auto betterBeSingleFieldRun = [&](RecordDecl::field_iterator Field) { + if (!Types.getCodeGenOpts().FineGrainedBitfieldAccesses) ---------------- betterBeSingleFieldRun -> IsBetterAsSingleFieldRun ================ Comment at: lib/CodeGen/CGRecordLayoutBuilder.cpp:444 // Add bitfields to the run as long as they qualify. - if (Field != FieldEnd && Field->getBitWidthValue(Context) != 0 && - Tail == getFieldBitOffset(*Field)) { - Tail += Field->getBitWidthValue(Context); - ++Field; - continue; + if (Field != FieldEnd && !SingleFieldRun) { + SingleFieldRun = betterBeSingleFieldRun(Field); ---------------- The logic here is not obvious. Can you please add a comment. SingleFieldRun here is only not equal to `betterBeSingleFieldRun(Field)` if we've skipped 0-length bitfields, right? Please explain what's going on and also please make sure there's a test case. Repository: rL LLVM https://reviews.llvm.org/D36562 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits