aboutsummaryrefslogtreecommitdiffstats
path: root/mutator-lvl0.cpp
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2016-12-25 10:15:00 +0000
committerbloodstalker <thabogre@gmail.com>2016-12-25 10:15:00 +0000
commite94afcc140c78b038f79f98ad4674327f4b60ad0 (patch)
treee7b797eb5b5cdbd57c8f6a6ae8bf2b6f4e130a93 /mutator-lvl0.cpp
parentupdated (diff)
downloadmutator-e94afcc140c78b038f79f98ad4674327f4b60ad0.tar.gz
mutator-e94afcc140c78b038f79f98ad4674327f4b60ad0.zip
trying to figure out why all of a sudden the travis build is broken
Diffstat (limited to 'mutator-lvl0.cpp')
-rw-r--r--mutator-lvl0.cpp38
1 files changed, 37 insertions, 1 deletions
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<clang::Expr>("mcexpr124") != nullptr)
{
const Expr* EXP = MR.Nodes.getNodeAs<clang::Expr>("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<RawComment*> 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;