Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Stmt bits are not imported systematically #470

Closed martong closed 6 years ago

martong commented 6 years ago

Certain bits of the different subclasses of Stmt are not imported.

  union {
    StmtBitfields StmtBits;
    CompoundStmtBitfields CompoundStmtBits;
    IfStmtBitfields IfStmtBits;
    ExprBitfields ExprBits;
    CharacterLiteralBitfields CharacterLiteralBits;
    FloatingLiteralBitfields FloatingLiteralBits;
    UnaryExprOrTypeTraitExprBitfields UnaryExprOrTypeTraitExprBits;
    DeclRefExprBitfields DeclRefExprBits;
    CastExprBitfields CastExprBits;
    CallExprBitfields CallExprBits;
    ExprWithCleanupsBitfields ExprWithCleanupsBits;
    PseudoObjectExprBitfields PseudoObjectExprBits;
    ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits;
    InitListExprBitfields InitListExprBits;
    TypeTraitExprBitfields TypeTraitExprBits;
    CoawaitExprBitfields CoawaitBits;
  };

The special case of this generic issue is #469

martong commented 6 years ago

Most of these bits are handled in the constructors of the different subclasses of Stmt. One exception is InitListExpr where the ctor default sets some of the ExprBits, which may change later. There may be other subclasses too where ExprBits are not set properly, should we set these bits in ASTImporter::Import(Expr*) ?

gyorb commented 6 years ago

related issue #477