diff options
| author | bloodstalker <thabogre@gmail.com> | 2016-11-19 19:52:34 +0000 | 
|---|---|---|
| committer | bloodstalker <thabogre@gmail.com> | 2016-11-19 19:52:34 +0000 | 
| commit | b892e7e6454bb6a4ef3d34940e6d65cfc1e6443d (patch) | |
| tree | 06b60519376c7201ab3b31ed547e793bcef1f298 | |
| parent | fixed a problem with build all. (diff) | |
| download | mutator-b892e7e6454bb6a4ef3d34940e6d65cfc1e6443d.tar.gz mutator-b892e7e6454bb6a4ef3d34940e6d65cfc1e6443d.zip | |
added 16.9
| -rw-r--r-- | mutator-lvl0.cpp | 29 | 
1 files changed, 28 insertions, 1 deletions
| diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp index 99763e7..31e79c0 100644 --- a/mutator-lvl0.cpp +++ b/mutator-lvl0.cpp @@ -497,6 +497,30 @@ private:    Rewriter &Rewrite;  };  /**********************************************************************************************************************/ +class MCFunction169 : public MatchFinder::MatchCallback +{ +public: +  MCFunction169 (Rewriter &Rewrite) : Rewrite (Rewrite) {} + +  virtual void run(const MatchFinder::MatchResult &MR) +  { +    const ImplicitCastExpr* ICE = MR.Nodes.getNodeAs<clang::ImplicitCastExpr>("mcfunc169"); + +    SourceLocation SL = ICE->getLocStart(); +    SL = Devi::SourceLocationHasMacro(SL, Rewrite, "start"); + +    CastKind CK = ICE->getCastKind(); + +    if (CK == CK_FunctionToPointerDecay) +    { +      std::cout << "16.9 : " << "FunctionToPointerDecay: " << std::endl; +      std::cout << SL.printToString(*MR.SourceManager) << "\n" << std::endl; +    } +  } + +private: +  Rewriter &Rewrite; +};  /**********************************************************************************************************************/  /**********************************************************************************************************************/  class MyASTConsumer : public ASTConsumer { @@ -504,7 +528,7 @@ class MyASTConsumer : public ASTConsumer {  public:    MyASTConsumer(Rewriter &R) : HandlerForCmpless(R), HandlerWhileCmpless(R), HandlerElseCmpless(R), HandlerIfCmpless(R), \      HandlerForIfElse(R), HandlerForSwitchBrkLess(R), HandlerForSwitchDftLEss(R), HandlerForMCSwitch151(R), HandlerForMCSwitch155(R), \ -    HandlerForMCFunction161(R), HandlerForFunction162(R), HandlerForFunction164(R), HandlerForFunction166(R), HandlerForFunction168(R) { +    HandlerForMCFunction161(R), HandlerForFunction162(R), HandlerForFunction164(R), HandlerForFunction166(R), HandlerForFunction168(R), HandlerForFunction169(R) {      /*forstmts whithout a compound statement.*/      Matcher.addMatcher(forStmt(unless(hasDescendant(compoundStmt()))).bind("mcfor"), &HandlerForCmpless); @@ -538,6 +562,8 @@ public:      Matcher.addMatcher(callExpr().bind("mcfunc166"), &HandlerForFunction166);      Matcher.addMatcher(functionDecl(forEachDescendant(returnStmt().bind("mcfunc168"))), &HandlerForFunction168); + +    Matcher.addMatcher(implicitCastExpr(unless(hasAncestor(callExpr()))).bind("mcfunc169"), &HandlerForFunction169);    }    void HandleTranslationUnit(ASTContext &Context) override { @@ -559,6 +585,7 @@ private:    MCFunction164 HandlerForFunction164;    MCFunction166 HandlerForFunction166;    MCFunction168 HandlerForFunction168; +  MCFunction169 HandlerForFunction169;    MatchFinder Matcher;  };  /**********************************************************************************************************************/ | 
