Changeset View
Standalone View
include/clang/AST/Stmt.h
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | protected: | ||||
}; | }; | ||||
class CastExprBitfields { | class CastExprBitfields { | ||||
friend class CastExpr; | friend class CastExpr; | ||||
unsigned : NumExprBits; | unsigned : NumExprBits; | ||||
unsigned Kind : 6; | unsigned Kind : 6; | ||||
unsigned BasePathSize : 32 - 6 - NumExprBits; | bool PartOfExplicitCast : 1; | ||||
rjmccall: This needs to be `unsigned` to pack optimally on MSVC. | |||||
unsigned BasePathSize : 32 - 6 - 1 - NumExprBits; | |||||
rjmccallUnsubmitted This needs to be serialized. rjmccall: This needs to be serialized. | |||||
lebedev.riAuthorUnsubmitted Uhm, could you please explain what do you mean by 'serialized'? lebedev.ri: Uhm, could you please explain what do you mean by 'serialized'? | |||||
rjmccallUnsubmitted It needs to be preserved when writing an ICE into a PCH / module file. See the ASTWriter / ASTReader. rjmccall: It needs to be preserved when writing an ICE into a PCH / module file. See the ASTWriter /… | |||||
lebedev.riAuthorUnsubmitted Aha. I did add handling there but it raises questions:
lebedev.ri: Aha. I did add handling there but it raises questions:
# This will silently break with… | |||||
rsmithUnsubmitted Don't worry about breaking the serialization format. We do not maintain AST file format compatibility in general (neither between major releases nor between any two arbitrary SVN revisions). [We should probably maintain file format compatibility between patch releases, but I don't think that works right now because we check the full version number including the patch level when reading a file.] Please do add a test: what you need to do is create a PCH containing an implicit cast expression and then import that AST file and do anything to check that the value is preserved (such as inspecting the output of -ast-dump). Maybe you could add this to the existing test/PCH/cxx_exprs.cpp test, which already does most of what you want, but doesn't have any FileCheck tests on the -ast-dump output yet. rsmith: Don't worry about breaking the serialization format. We do not maintain AST file format… | |||||
lebedev.riAuthorUnsubmitted Uhm, so i have tried to add a test. |-TypedefDecl 0x55a348020b88 </build/clang/test/PCH/cxx_exprs.h:5:1, col:44> col:44 referenced static_cast_result 'typeof (static_cast<void *>(0))':'void *' | `-TypeOfExprType 0x55a348020b50 'typeof (static_cast<void *>(0))' sugar | |-ParenExpr 0x55a348020b28 <col:19, col:42> 'void *' | | `-CXXStaticCastExpr 0x55a348020af8 <col:20, col:41> 'void *' static_cast<void *> <NoOp> | | `-ImplicitCastExpr 0x55a348020ae0 <col:40> 'void *' <NullToPointer> | | `-IntegerLiteral 0x55a348020aa8 <col:40> 'int' 0 | `-PointerType 0x55a347fe6390 'void *' | `-BuiltinType 0x55a347fe5b90 'void' But the last runline (which uses PCH) does not have that. cxx_exprs.cpp.tmp.dump024 KBDownload cxx_exprs.cpp.tmp.dump15 KBDownload lebedev.ri: Uhm, so i have tried to add a test.
With git master, the `-ast-dump` from the first runline of… | |||||
}; | }; | ||||
class CallExprBitfields { | class CallExprBitfields { | ||||
friend class CallExpr; | friend class CallExpr; | ||||
unsigned : NumExprBits; | unsigned : NumExprBits; | ||||
unsigned NumPreArgs : 1; | unsigned NumPreArgs : 1; | ||||
▲ Show 20 Lines • Show All 2,070 Lines • Show Last 20 Lines |
This needs to be unsigned to pack optimally on MSVC.