From e94afcc140c78b038f79f98ad4674327f4b60ad0 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sun, 25 Dec 2016 13:45:00 +0330 Subject: trying to figure out why all of a sudden the travis build is broken --- mutator-lvl0.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp index 3240baa..9fdbb97 100644 --- a/mutator-lvl0.cpp +++ b/mutator-lvl0.cpp @@ -1327,6 +1327,7 @@ public: virtual void run(const MatchFinder::MatchResult &MR) { + /*underdev*/ if (MR.Nodes.getNodeAs("mcexpr124") != nullptr) { const Expr* EXP = MR.Nodes.getNodeAs("mcexpr124"); @@ -1336,6 +1337,8 @@ public: ASTContext *const ASTC = MR.Context; + const SourceManager &SM = ASTC->getSourceManager(); + if (EXP->HasSideEffects(*ASTC, true)) { std::cout << "12.4 : " << "Righ-hand expr has side-effect : " << std::endl; @@ -1343,6 +1346,39 @@ public: XMLDocOut.XMLAddNode(MR.Context, SL, "12.4", "Righ-hand expr has side-effect"); } + + RawCommentList RCL = ASTC->Comments; + + ArrayRef RawCommentArrRef = RCL.getComments(); + + std::string RawText; + + size_t matchLoc = RawText.find("/*", 0); + unsigned MatchCounter = 0U; + + for (auto &iter : RawCommentArrRef) + { + std::string RawText = iter->getRawText(SM); + + std::cout << "ZZZZZZZZZZZZZZZZZZZZZ" << RawText << std::endl; + + SourceLocation RCSL = iter->getLocStart(); + + while (matchLoc != std::string::npos) + { + MatchCounter++; + matchLoc = RawText.find("/*", matchLoc + 1U); + } + + if (MatchCounter >= 2U) + { + /*flag and tag*/ + std::cout << "2.3 : " << "character sequence \"/*\" used inside the comment : " << std::endl; + std::cout << RCSL.printToString(*MR.SourceManager) << "\n" << std::endl; + + XMLDocOut.XMLAddNode(MR.Context, RCSL, "2.3", "character sequence \"/*\" used inside the comment : "); + } + } } } @@ -3131,7 +3167,7 @@ public: { if (iter.HasMoreThanOneDefinition) { -#if 0 +#if 1 std::cout << "8.8 : " << "External function or object (" + iter.XObjNameStr + ") is defined in more than one file: " << std::endl; std::cout << iter.XObjSLStr << "\n" << std::endl; -- cgit v1.2.3