diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-13 11:49:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-14 08:59:34 +0100 |
commit | a70b8111149944695a6b2647b552e41d56c2d9e0 (patch) | |
tree | ba51025f5803ce3b4807098f08a50b17acf51c46 /compilerplugins/clang | |
parent | 645fe53be0dc36535dba0ed684e21ca4cda80d70 (diff) |
deliver more useful message when I mess up a conversion to shared plugin
Change-Id: I6b5fb2977965b5366d698d960a2c75845cbd6ea6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/sharedvisitor/dummyplugin.hxx | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx index 7ea085c752de..ce5b352384b1 100644 --- a/compilerplugins/clang/sharedvisitor/dummyplugin.hxx +++ b/compilerplugins/clang/sharedvisitor/dummyplugin.hxx @@ -34,22 +34,24 @@ public: // but they should actually never get called in the shared-visitor mode. // This could be autogenerated too, but it's probably simpler to just extend // manually as needed. - bool TraverseDecl( Decl* ) { abort(); } - bool TraverseLinkageSpecDecl( LinkageSpecDecl* ) { abort(); } - bool TraverseStmt( Stmt* ) { abort(); } - bool TraverseUnaryLNot( UnaryOperator* ) { abort(); } - bool TraverseBinLAnd( BinaryOperator* ) { abort(); } - bool TraverseCXXCatchStmt( CXXCatchStmt* ) { abort(); } - bool TraverseCXXDestructorDecl( CXXDestructorDecl* ) { abort(); } - bool TraverseFunctionDecl( FunctionDecl* ) { abort(); } - bool TraverseSwitchStmt( SwitchStmt* ) { abort(); } - bool TraverseImplicitCastExpr( ImplicitCastExpr* ) { abort(); } - bool TraverseCStyleCastExpr( CStyleCastExpr* ) { abort(); } - bool TraverseCXXStaticCastExpr( CXXStaticCastExpr* ) { abort(); } - bool TraverseCXXFunctionalCastExpr( CXXFunctionalCastExpr* ) { abort(); } - bool TraverseFriendDecl( FriendDecl* ) { abort(); } - bool TraverseTypeLoc( TypeLoc ) { abort(); } - bool TraverseAlignedAttr( AlignedAttr* ) { abort(); } + bool TraverseDecl( Decl* ) { return complain(); } + bool TraverseLinkageSpecDecl( LinkageSpecDecl* ) { return complain(); } + bool TraverseStmt( Stmt* ) { return complain(); } + bool TraverseUnaryLNot( UnaryOperator* ) { return complain(); } + bool TraverseBinLAnd( BinaryOperator* ) { return complain(); } + bool TraverseCXXCatchStmt( CXXCatchStmt* ) { return complain(); } + bool TraverseCXXDestructorDecl( CXXDestructorDecl* ) { return complain(); } + bool TraverseFunctionDecl( FunctionDecl* ) { return complain(); } + bool TraverseSwitchStmt( SwitchStmt* ) { return complain(); } + bool TraverseImplicitCastExpr( ImplicitCastExpr* ) { return complain(); } + bool TraverseCStyleCastExpr( CStyleCastExpr* ) { return complain(); } + bool TraverseCXXStaticCastExpr( CXXStaticCastExpr* ) { return complain(); } + bool TraverseCXXFunctionalCastExpr( CXXFunctionalCastExpr* ) { return complain(); } + bool TraverseFriendDecl( FriendDecl* ) { return complain(); } + bool TraverseTypeLoc( TypeLoc ) { return complain(); } + bool TraverseAlignedAttr( AlignedAttr* ) { return complain(); } +private: + bool complain() { assert(false && "should not be calling this in sharedplugin mode"); abort(); return false; } }; template<typename Derived> |