diff options
-rw-r--r-- | mutator-lvl0.cpp | 1131 |
1 files changed, 762 insertions, 369 deletions
diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp index b7e4974..fdded89 100644 --- a/mutator-lvl0.cpp +++ b/mutator-lvl0.cpp @@ -137,11 +137,14 @@ public: return void(); } - std::cout << "14.9:" << "\"Else\" statement has no braces {}:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.9:" << "\"Else\" statement has no braces {}:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.9", "\"Else\" statement has no braces {}: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.9", "\"Else\" statement has no braces {}: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.9", "\"Else\" statement has no braces {}: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.9", "\"Else\" statement has no braces {}: "); + } } else { @@ -171,11 +174,14 @@ public: return void(); } - std::cout << "14.9:" << "\"If\" statement has no braces {}:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.9:" << "\"If\" statement has no braces {}:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.9", "\"If\" statement has no braces {}: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.9", "\"If\" statement has no braces {}: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.9", "\"If\" statement has no braces {}: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.9", "\"If\" statement has no braces {}: "); + } } else { @@ -206,11 +212,14 @@ public: return void(); } - std::cout << "14.10:" << "\"If-Else If\" statement has no ending Else:"; - std::cout << IFESL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, IFESL)) + { + std::cout << "14.10:" << "\"If-Else If\" statement has no ending Else:"; + std::cout << IFESL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, IFESL, "14.10", "\"If-Else If\" statement has no ending Else: "); - JSONDocOUT.JSONAddElement(MR.Context, IFESL, "14.10", "\"If-Else If\" statement has no ending Else: "); + XMLDocOut.XMLAddNode(MR.Context, IFESL, "14.10", "\"If-Else If\" statement has no ending Else: "); + JSONDocOUT.JSONAddElement(MR.Context, IFESL, "14.10", "\"If-Else If\" statement has no ending Else: "); + } } else { @@ -280,11 +289,14 @@ public: return void(); } - std::cout << "15.3:" << "\"SwitchStmt\" does not have a defaultStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "15.3:" << "\"SwitchStmt\" does not have a defaultStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "15.3", "\"SwitchStmt\" does not have a defaultStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "15.3", "\"SwitchStmt\" does not have a defaultStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "15.3", "\"SwitchStmt\" does not have a defaultStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "15.3", "\"SwitchStmt\" does not have a defaultStmt: "); + } } else { @@ -321,7 +333,7 @@ public: ASTContext::DynTypedNodeList NodeList = ASTC->getParents(*CS); - /*assumptions:nothing has more than one parent in C.*/ + /*@DEVI-assumptions:nothing has more than one parent in C.*/ ast_type_traits::DynTypedNode ParentNode = NodeList[0]; ast_type_traits::ASTNodeKind ParentNodeKind = ParentNode.getNodeKind(); @@ -330,11 +342,14 @@ public: if (StringKind != "SwitchStmt") { - std::cout << "15.1:" << "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "15.1:" << "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "15.1", "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "15.1", "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "15.1", "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "15.1", "\"CaseStmt\" has a CompoundStmt ancestor that is not the child of the SwitchStmt: "); + } } } else @@ -366,11 +381,14 @@ public: return void(); } - std::cout << "15.5:" << "\"SwitchStmt\" does not have a CaseStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "15.5:" << "\"SwitchStmt\" does not have a CaseStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "15.5", "\"SwitchStmt\" does not have a CaseStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "15.5", "\"SwitchStmt\" does not have a CaseStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "15.5", "\"SwitchStmt\" does not have a CaseStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "15.5", "\"SwitchStmt\" does not have a CaseStmt: "); + } } else { @@ -403,11 +421,14 @@ public: return void(); } - std::cout << "16.1:" << "\"FunctionDecl\" is variadic:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "16.1:" << "\"FunctionDecl\" is variadic:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "16.1", "\"FunctionDecl\" is variadic: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "16.1", "\"FunctionDecl\" is variadic: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "16.1", "\"FunctionDecl\" is variadic: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "16.1", "\"FunctionDecl\" is variadic: "); + } } } else @@ -440,6 +461,16 @@ public: return void(); } + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*intentionally left blank*/ + } + else + { + return void(); + } + + std::string FuncNameStr = FD->getNameInfo().getAsString(); if (CE->getDirectCallee()) @@ -498,6 +529,15 @@ public: return void(); } + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*intentionally left blank*/ + } + else + { + return void(); + } + SourceLocation SLDcl = FDcl->getLocStart(); SLDcl = Devi::SourceLocationHasMacro(SLDcl, Rewrite, "start"); @@ -577,11 +617,14 @@ public: } else { - std::cout << "20.4:" << "Dynamic heap memory allocation used:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "20.4:" << "Dynamic heap memory allocation used:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "20.4", "Dynamic heap memory allocation used: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "20.4", "Dynamic heap memory allocation used: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "20.4", "Dynamic heap memory allocation used: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "20.4", "Dynamic heap memory allocation used: "); + } } } /*end of 20.4*/ @@ -595,11 +638,14 @@ public: } else { - std::cout << "20.7:" << "Use of lonjmp is illegal:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "20.7:" << "Use of lonjmp is illegal:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "20.7", "Use of longjmp is illegal: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "20.7", "Use of longjmp is illegal: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "20.7", "Use of longjmp is illegal: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "20.7", "Use of longjmp is illegal: "); + } } } /*end of 20.7*/ @@ -613,11 +659,14 @@ public: } else { - std::cout << "20.10:" << "Use of atof,atoi and atol is illegal:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "20.10:" << "Use of atof,atoi and atol is illegal:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "20.10", "Use of atof,atoi and atol is illegal: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "20.10", "Use of atof,atoi and atol is illegal: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "20.10", "Use of atof,atoi and atol is illegal: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "20.10", "Use of atof,atoi and atol is illegal: "); + } } } /*end of 20.10*/ @@ -631,11 +680,14 @@ public: } else { - std::cout << "20.11:" << "Use of abort,exit,getenv and system is illegal:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "20.11:" << "Use of abort,exit,getenv and system is illegal:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "20.11", "Use of abort,exit,getenv and system is illegal : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "20.11", "Use of abort,exit,getenv and system is illegal : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "20.11", "Use of abort,exit,getenv and system is illegal : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "20.11", "Use of abort,exit,getenv and system is illegal : "); + } } } /*end of 20.11*/ @@ -648,11 +700,14 @@ public: } else { - std::cout << "16.6:" << "CallExpr number of arguments does not equal the number of parameters in the declaration:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "16.6:" << "CallExpr number of arguments does not equal the number of parameters in the declaration:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "16.6", "CallExpr number of arguments does not equal the number of parameters in the declaration: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "16.6", "CallExpr number of arguments does not equal the number of parameters in the declaration: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "16.6", "CallExpr number of arguments does not equal the number of parameters in the declaration: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "16.6", "CallExpr number of arguments does not equal the number of parameters in the declaration: "); + } } } } @@ -688,6 +743,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + SourceLocation SLE = RT->getLocEnd(); SLE = Devi::SourceLocationHasMacro(SLE, Rewrite, "end"); @@ -730,6 +790,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + CastKind CK = ICE->getCastKind(); if (CK == CK_FunctionToPointerDecay) @@ -808,11 +873,14 @@ public: } else { - std::cout << "18.4:" << "Union declared:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "18.4:" << "Union declared:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "18.4", "Union declared: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "18.4", "Union declared: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "18.4", "Union declared: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "18.4", "Union declared: "); + } } std::string MatchedName = RD->getNameAsString(); @@ -905,11 +973,14 @@ public: } else { - std::cout << "18.1:" << "Incomplete struct declared:"; - std::cout << StructInfoProto[x].StructSL << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, StructInfoProto[x].FSL.getManager().isInMainFile(StructInfoProto[x].SL), StructInfoProto[x].SL)) + { + std::cout << "18.1:" << "Incomplete struct declared:"; + std::cout << StructInfoProto[x].StructSL << ":" << std::endl; - XMLDocOut.XMLAddNode(StructInfoProto[x].FSL, StructInfoProto[x].SL, "18.1", "Incomplete struct declared: "); - JSONDocOUT.JSONAddElement(StructInfoProto[x].FSL, StructInfoProto[x].SL, "18.1", "Incomplete struct declared: "); + XMLDocOut.XMLAddNode(StructInfoProto[x].FSL, StructInfoProto[x].SL, "18.1", "Incomplete struct declared: "); + JSONDocOUT.JSONAddElement(StructInfoProto[x].FSL, StructInfoProto[x].SL, "18.1", "Incomplete struct declared: "); + } } } } @@ -924,11 +995,14 @@ public: } else { - std::cout << "18.1:" << "Incomplete union declared:"; - std::cout << UnionInfoProto[x].UnionSL << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, UnionInfoProto[x].FSL.getManager().isInMainFile(UnionInfoProto[x].SL), UnionInfoProto[x].SL)) + { + std::cout << "18.1:" << "Incomplete union declared:"; + std::cout << UnionInfoProto[x].UnionSL << ":" << std::endl; - XMLDocOut.XMLAddNode(UnionInfoProto[x].FSL, UnionInfoProto[x].SL, "18.1", "Incomplete union declared: "); - JSONDocOUT.JSONAddElement(UnionInfoProto[x].FSL, UnionInfoProto[x].SL, "18.1", "Incomplete union declared: "); + XMLDocOut.XMLAddNode(UnionInfoProto[x].FSL, UnionInfoProto[x].SL, "18.1", "Incomplete union declared: "); + JSONDocOUT.JSONAddElement(UnionInfoProto[x].FSL, UnionInfoProto[x].SL, "18.1", "Incomplete union declared: "); + } } } } @@ -992,12 +1066,15 @@ public: } else { - /*this part is ueless since the clang parser wont let such a bitfield through.*/ - std::cout << "6.4:" << "BitField has a type other than int or unsigned int:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*@DEVI-this part is ueless since the clang parser wont let such a bitfield through.*/ + std::cout << "6.4:" << "BitField has a type other than int or unsigned int:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "6.4", "BitField has a type other than int or unsigned int: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "6.4", "BitField has a type other than int or unsigned int: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "6.4", "BitField has a type other than int or unsigned int: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "6.4", "BitField has a type other than int or unsigned int: "); + } } } @@ -1014,11 +1091,14 @@ public: } else { - std::cout << "6.5:" << "BitField of type signed integer has a length of less than 2 in bits:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "6.5:" << "BitField of type signed integer has a length of less than 2 in bits:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "6.5", "BitField of type signed integer has a length of less than 2 in bits : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "6.5", "BitField of type signed integer has a length of less than 2 in bits : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "6.5", "BitField of type signed integer has a length of less than 2 in bits : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "6.5", "BitField of type signed integer has a length of less than 2 in bits : "); + } } } } @@ -1083,11 +1163,14 @@ public: } else { - std::cout << "8.5:" << "Function definition inside a header file:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "8.5:" << "Function definition inside a header file:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "8.5", "Function definition inside a header file : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "8.5", "Function definition inside a header file : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "8.5", "Function definition inside a header file : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "8.5", "Function definition inside a header file : "); + } } } /*end of 8.5*/ @@ -1109,14 +1192,17 @@ public: } else { - std::cout << "19.5:" << "Macro defined inside a block:"; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "19.5:" << "Macro defined inside a block:"; #if 0 - std::cout << MacroDefSourceLocation[x].printToString(*MR.SourceManager) << " " << MacroNameString[x] << "\n" << std::endl; + std::cout << MacroDefSourceLocation[x].printToString(*MR.SourceManager) << " " << MacroNameString[x] << "\n" << std::endl; #endif - std::cout << MacroDefSourceLocation[x].printToString(*MR.SourceManager) << ":" << std::endl; + std::cout << MacroDefSourceLocation[x].printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, MacroDefSourceLocation[x], "19.5", "Macro defined inside a block : "); - JSONDocOUT.JSONAddElement(MR.Context, MacroDefSourceLocation[x], "19.5", "Macro defined inside a block : "); + XMLDocOut.XMLAddNode(MR.Context, MacroDefSourceLocation[x], "19.5", "Macro defined inside a block : "); + JSONDocOUT.JSONAddElement(MR.Context, MacroDefSourceLocation[x], "19.5", "Macro defined inside a block : "); + } } } } @@ -1133,11 +1219,14 @@ public: } else { - std::cout << "19.5:" << "Macro undefined inside a block:"; - std::cout << MacroUndefSourceLocation[x].printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "19.5:" << "Macro undefined inside a block:"; + std::cout << MacroUndefSourceLocation[x].printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, MacroUndefSourceLocation[x], "19.5", "Macro undefined inside a block : "); - JSONDocOUT.JSONAddElement(MR.Context, MacroUndefSourceLocation[x], "19.5", "Macro undefined inside a block : "); + XMLDocOut.XMLAddNode(MR.Context, MacroUndefSourceLocation[x], "19.5", "Macro undefined inside a block : "); + JSONDocOUT.JSONAddElement(MR.Context, MacroUndefSourceLocation[x], "19.5", "Macro undefined inside a block : "); + } } } } @@ -1194,11 +1283,14 @@ public: } else { - std::cout << "8.1:" << "Function does not have a FunctionDecl that is not a definition:"; - std::cout << FuncInfoProto[x].StrcSL << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, FuncInfoProto[x].FuncFSL.getManager().isInMainFile(FuncInfoProto[x].FuncSL), FuncInfoProto[x].FuncSL)) + { + std::cout << "8.1:" << "Function does not have a FunctionDecl that is not a definition:"; + std::cout << FuncInfoProto[x].StrcSL << ":" << std::endl; - XMLDocOut.XMLAddNode(FuncInfoProto[x].FuncFSL, FuncInfoProto[x].FuncSL, "8.1", "Function does not have a FunctionDecl that is not a definition : "); - JSONDocOUT.JSONAddElement(FuncInfoProto[x].FuncFSL, FuncInfoProto[x].FuncSL, "8.1", "Function does not have a FunctionDecl that is not a definition : "); + XMLDocOut.XMLAddNode(FuncInfoProto[x].FuncFSL, FuncInfoProto[x].FuncSL, "8.1", "Function does not have a FunctionDecl that is not a definition : "); + JSONDocOUT.JSONAddElement(FuncInfoProto[x].FuncFSL, FuncInfoProto[x].FuncSL, "8.1", "Function does not have a FunctionDecl that is not a definition : "); + } } } } @@ -1301,11 +1393,14 @@ public: } else { - std::cout << "8.5:" << "Variable definition inside a header file:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "8.5:" << "Variable definition inside a header file:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "8.5", "Variable definition inside a header file : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "8.5", "Variable definition inside a header file : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "8.5", "Variable definition inside a header file : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "8.5", "Variable definition inside a header file : "); + } } } /*end of 8.5*/ @@ -1323,12 +1418,15 @@ public: } else { - /*end of 8.12*/ - std::cout << "8.12:" << "External array type is incomplete and has no initialization:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*end of 8.12*/ + std::cout << "8.12:" << "External array type is incomplete and has no initialization:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "8.12", "External array type is incomplete and has no initialization : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "8.12", "External array type is incomplete and has no initialization : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "8.12", "External array type is incomplete and has no initialization : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "8.12", "External array type is incomplete and has no initialization : "); + } } } } @@ -1356,11 +1454,14 @@ public: } else { - std::cout << "9.2:" << "Curly braces not used:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "9.2:" << "Curly braces not used:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "9.2", "Curly braces not used : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "9.2", "Curly braces not used : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "9.2", "Curly braces not used : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "9.2", "Curly braces not used : "); + } } } } @@ -1378,11 +1479,14 @@ public: } else { - std::cout << "9.1:" << "staic local variable does not have initialization:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "9.1:" << "staic local variable does not have initialization:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "9.1", "staic local variable does not have initialization : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "9.1", "staic local variable does not have initialization : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "9.1", "staic local variable does not have initialization : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "9.1", "staic local variable does not have initialization : "); + } } } } @@ -1414,6 +1518,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + unsigned int NumInits [[maybe_unused]] = ILE->getNumInits(); #if 0 @@ -1486,12 +1595,15 @@ public: } else { - /*in breach of misrac*/ - std::cout << "9.3:" << "first enumeration has integerliteral initialization but not all enumerations do:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*in breach of misrac*/ + std::cout << "9.3:" << "first enumeration has integerliteral initialization but not all enumerations do:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "9.3", "first enumeration has integerliteral initialization but not all enumerations do : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "9.3", "first enumeration has integerliteral initialization but not all enumerations do : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "9.3", "first enumeration has integerliteral initialization but not all enumerations do : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "9.3", "first enumeration has integerliteral initialization but not all enumerations do : "); + } } } else @@ -1509,12 +1621,15 @@ public: } else { - /*in breach of misrac*/ - std::cout << "9.3:" << "first enumeration does not have integerliteral initialization but at least one other enumeration does:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + /*in breach of misrac*/ + std::cout << "9.3:" << "first enumeration does not have integerliteral initialization but at least one other enumeration does:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "9.3", "first enumeration does not have integerliteral initialization but at least one other enumeration does : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "9.3", "first enumeration does not have integerliteral initialization but at least one other enumeration does : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "9.3", "first enumeration does not have integerliteral initialization but at least one other enumeration does : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "9.3", "first enumeration does not have integerliteral initialization but at least one other enumeration does : "); + } } } else @@ -1562,6 +1677,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + ASTContext *const ASTC = MR.Context; if (EXP->HasSideEffects(*ASTC, true)) @@ -1598,6 +1718,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + ASTContext *const ASTC = MR.Context; if (EXP->HasSideEffects(*ASTC, true)) @@ -1663,11 +1788,14 @@ public: } else { - std::cout << "12.5:" << "RHS and/or LHS operands are not primary expressions:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "12.5:" << "RHS and/or LHS operands are not primary expressions:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "12.5", "RHS and/or LHS operands are not primary expressions : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "12.5", "RHS and/or LHS operands are not primary expressions : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "12.5", "RHS and/or LHS operands are not primary expressions : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "12.5", "RHS and/or LHS operands are not primary expressions : "); + } } } } @@ -1698,6 +1826,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + if (!EXP->isKnownToHaveBooleanValue()) { std::cout << "12.6:" << "RHS and/or LHS operands are not effectively-boolean values:"; @@ -1732,6 +1865,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + QualType QT = EXP->getType(); const clang::Type* TP = QT.getTypePtr(); @@ -1771,6 +1909,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + QualType RQT = RHS->getType(); QualType LQT = LHS->getType(); @@ -1823,6 +1966,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + QualType QT = EXP->getType(); const clang::Type* TP = QT.getTypePtr(); @@ -1861,6 +2009,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "12.10:" << "Comma used:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -1892,6 +2045,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "12.13:" << "Unary ++ or -- have been used in an expr with other operators:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -1923,6 +2081,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + if (EXP->isKnownToHaveBooleanValue()) { std::cout << "13.1:" << "assignment operator used in an expr that is known to return boolean:"; @@ -1957,6 +2120,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + if (!EXP->isKnownToHaveBooleanValue()) { std::cout << "13.2:" << "Implicit test of an expr against zero which is not known to return a boolean result:"; @@ -2005,11 +2173,14 @@ public: } else { - std::cout << "13.3:" << "Float type expression checked for equality/inequality:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "13.3:" << "Float type expression checked for equality/inequality:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "13.3", "Float type expression checked for equality/inequality: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "13.3", "Float type expression checked for equality/inequality: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "13.3", "Float type expression checked for equality/inequality: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "13.3", "Float type expression checked for equality/inequality: "); + } } } } @@ -2058,12 +2229,15 @@ public: } else { - std::cout << "13.4:" << "Float type used in the controlling expression of a forstmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - AlreadyHaveAHit = true; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "13.4:" << "Float type used in the controlling expression of a forstmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + AlreadyHaveAHit = true; - XMLDocOut.XMLAddNode(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + } } } } @@ -2082,12 +2256,15 @@ public: } else { - std::cout << "13.4:" << "Float type used in the controlling expression of a forstmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - AlreadyHaveAHit = true; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "13.4:" << "Float type used in the controlling expression of a forstmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + AlreadyHaveAHit = true; - XMLDocOut.XMLAddNode(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "13.4", "Float type used in the controlling expression of a forstmt: "); + } } } } @@ -2169,11 +2346,14 @@ public: } else { - std::cout << "13.6:" << "ForStmt controlling variable modified in the body of the loop:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "13.6:" << "ForStmt controlling variable modified in the body of the loop:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "13.6", "ForStmt controlling variable modified in the body of the loop: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "13.6", "ForStmt controlling variable modified in the body of the loop: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "13.6", "ForStmt controlling variable modified in the body of the loop: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "13.6", "ForStmt controlling variable modified in the body of the loop: "); + } } } } @@ -2207,6 +2387,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "14.4:" << "GotoStmt used:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -2238,6 +2423,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "14.5:" << "ContinueStmt used:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -2302,12 +2492,15 @@ public: } else { - std::cout << "14.6:" << "More than one BreakStmt used in the loop counter:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - AlreadyTagged = true; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.6:" << "More than one BreakStmt used in the loop counter:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + AlreadyTagged = true; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.6", "More than one BreakStmt used in the loop counter: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.6", "More than one BreakStmt used in the loop counter: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.6", "More than one BreakStmt used in the loop counter: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.6", "More than one BreakStmt used in the loop counter: "); + } } } @@ -2359,12 +2552,15 @@ public: } else { - std::cout << "14.7:" << "More than one ReturnStmt used in the body of FunctionDecl:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - AlreadyTagged = true; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.7:" << "More than one ReturnStmt used in the body of FunctionDecl:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + AlreadyTagged = true; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.7", "More than one ReturnStmt used in the body of FunctionDecl: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.7", "More than one ReturnStmt used in the body of FunctionDecl: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.7", "More than one ReturnStmt used in the body of FunctionDecl: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.7", "More than one ReturnStmt used in the body of FunctionDecl: "); + } } } @@ -2402,11 +2598,14 @@ public: } else { - std::cout << "14.8:" << "ForStmt does not have a child CompoundStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.8:" << "ForStmt does not have a child CompoundStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "ForStmt does not have a child CompoundStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "ForStmt does not have a child CompoundStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "ForStmt does not have a child CompoundStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "ForStmt does not have a child CompoundStmt: "); + } } } @@ -2423,11 +2622,14 @@ public: } else { - std::cout << "14.8:" << "WhileStmt does not have a child CompoundStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.8:" << "WhileStmt does not have a child CompoundStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "WhileStmt does not have a child CompoundStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "WhileStmt does not have a child CompoundStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "WhileStmt does not have a child CompoundStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "WhileStmt does not have a child CompoundStmt: "); + } } } @@ -2444,11 +2646,14 @@ public: } else { - std::cout << "14.8:" << "DoStmt does not have a child CompoundStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.8:" << "DoStmt does not have a child CompoundStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "DoStmt does not have a child CompoundStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "DoStmt does not have a child CompoundStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "DoStmt does not have a child CompoundStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "DoStmt does not have a child CompoundStmt: "); + } } } @@ -2465,11 +2670,14 @@ public: } else { - std::cout << "14.8:" << "SwitchStmt does not have a child CompoundStmt:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "14.8:" << "SwitchStmt does not have a child CompoundStmt:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "SwitchStmt does not have a child CompoundStmt: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "SwitchStmt does not have a child CompoundStmt: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "14.8", "SwitchStmt does not have a child CompoundStmt: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "14.8", "SwitchStmt does not have a child CompoundStmt: "); + } } } } @@ -2497,6 +2705,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + if (EXP->isKnownToHaveBooleanValue()) { std::cout << "15.4:" << "Switch expression is effectively boolean:"; @@ -2571,11 +2784,14 @@ public: } else { - std::cout << "11.1:" << "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.1:" << "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.1", "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.1", "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.1", "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.1", "ImplicitCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + } } } } @@ -2588,11 +2804,14 @@ public: } else { - std::cout << "10.1/2:" << "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.1/2:" << "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr - Conversion of FloatingType to or from IntegralType is recommended against: "); + } } } @@ -2604,11 +2823,14 @@ public: } else { - std::cout << "11.3:" << "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.3:" << "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.3", "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.3", "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.3", "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.3", "ImplicitCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + } } } @@ -2620,11 +2842,14 @@ public: } else { - std::cout << "11.x:" << "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.x:" << "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.x", "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.x", "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.x", "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.x", "ImplicitCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + } } } } @@ -2660,11 +2885,14 @@ public: } else { - std::cout << "13.7:" << "EffectivelyBooleanExpr's result is known at compile-time:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "13.7:" << "EffectivelyBooleanExpr's result is known at compile-time:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "13.7", "EffectivelyBooleanExpr's result is known at compile-time: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "13.7", "EffectivelyBooleanExpr's result is known at compile-time: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "13.7", "EffectivelyBooleanExpr's result is known at compile-time: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "13.7", "EffectivelyBooleanExpr's result is known at compile-time: "); + } } } } @@ -2790,11 +3018,14 @@ public: } else { - std::cout << "8.11:" << "Function does not have any external calls but is not declared as static:"; - std::cout << FuncScopeProto[x].DefinitionSL << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, FuncScopeProto[x].FuncScopeFSL.getManager().isInMainFile(FuncScopeProto[x].FuncScopeSL), FuncScopeProto[x].FuncScopeSL)) + { + std::cout << "8.11:" << "Function does not have any external calls but is not declared as static:"; + std::cout << FuncScopeProto[x].DefinitionSL << ":" << std::endl; - XMLDocOut.XMLAddNode(FuncScopeProto[x].FuncScopeFSL, FuncScopeProto[x].FuncScopeSL, "8.11", "Function does not have any external calls but is not declared as static : "); - JSONDocOUT.JSONAddElement(FuncScopeProto[x].FuncScopeFSL, FuncScopeProto[x].FuncScopeSL, "8.11", "Function does not have any external calls but is not declared as static : "); + XMLDocOut.XMLAddNode(FuncScopeProto[x].FuncScopeFSL, FuncScopeProto[x].FuncScopeSL, "8.11", "Function does not have any external calls but is not declared as static : "); + JSONDocOUT.JSONAddElement(FuncScopeProto[x].FuncScopeFSL, FuncScopeProto[x].FuncScopeSL, "8.11", "Function does not have any external calls but is not declared as static : "); + } } } } @@ -2838,6 +3069,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "16.5:" << "Function does not return anything but is missing the void keyword for the return type:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -2871,6 +3107,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + SourceRange SR; SR.setBegin(SL); SR.setEnd(SLE); @@ -2920,6 +3161,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + QualType QT = DRE->getType(); const clang::Type* TP = QT.getTypePtr(); @@ -2961,6 +3207,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + QualType QTR = DRER->getType(); QualType QTL = DREL->getType(); @@ -3002,11 +3253,14 @@ public: } else { - std::cout << "17.4:" << "The only allowed form of pointer arithmetic is array indexing:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "17.4:" << "The only allowed form of pointer arithmetic is array indexing:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + } } } @@ -3023,11 +3277,14 @@ public: } else { - std::cout << "17.4:" << "The only allowed form of pointer arithmetic is array indexing:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "17.4:" << "The only allowed form of pointer arithmetic is array indexing:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "17.4", "The only allowed form of pointer arithmetic is array indexing : "); + } } } } @@ -3123,11 +3380,14 @@ public: } else { - std::cout << "17.5:" << "Pointer has more than 2 levels of indirection:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "17.5:" << "Pointer has more than 2 levels of indirection:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "17.5", "Pointer has more than 2 levels on indirection : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "17.5", "Pointer has more than 2 levels on indirection : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "17.5", "Pointer has more than 2 levels on indirection : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "17.5", "Pointer has more than 2 levels on indirection : "); + } } break; @@ -3192,7 +3452,7 @@ public: /*@DEVI-the logic here is that we know we have matched a chartype. if its not either a singedinteger or unsingedinteger, then it is a simple char. otherwise it is signed or unsigned char.*/ -#if 0 +#if 1 if (TP->isSignedIntegerType() || TP->isUnsignedIntegerType()) { //std::cout << RHSString << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << SL.printToString(*MR.SourceManager) << std::endl; @@ -3205,11 +3465,14 @@ public: } else { - std::cout << "6.2:" << "Sgined or unsigned char type holds characterLiterals:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "6.2:" << "Sgined or unsigned char type holds characterLiterals:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "6.2", "Sgined or unsigned char type holds characterLiterals : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "6.2", "Sgined or unsigned char type holds characterLiterals : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "6.2", "Sgined or unsigned char type holds characterLiterals : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "6.2", "Sgined or unsigned char type holds characterLiterals : "); + } } } } @@ -3230,11 +3493,14 @@ public: } else { - std::cout << "6.1:" << "Simple char type holds numeric values:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "6.1:" << "Simple char type holds numeric values:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "6.1", "Simple char type holds numeric values : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "6.1", "Simple char type holds numeric values : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "6.1", "Simple char type holds numeric values : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "6.1", "Simple char type holds numeric values : "); + } } } } @@ -3265,6 +3531,11 @@ public: return void(); } + if (!Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + return void(); + } + std::cout << "18.1:" << "ArrayType incomplete at the end of the translation unit:"; std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; @@ -3334,11 +3605,14 @@ public: } else { - std::cout << "11.1:" << "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.1:" << "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.1", "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.1", "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.1", "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.1", "CStyleCastExpr - FunctionPointerType converted to or from a type other than IntegralType: "); + } } } } @@ -3351,11 +3625,14 @@ public: } else { - std::cout << "11.3:" << "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.3:" << "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.3", "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.3", "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.3", "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.3", "CStyleCastExpr - Conversion of PointerType to or from IntegralType is recommended against: "); + } } } @@ -3367,11 +3644,14 @@ public: } else { - std::cout << "11.x:" << "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "11.x:" << "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "11.x", "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "11.x", "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "11.x", "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "11.x", "CStyleCastExpr - PointerType has implicit BitCast. This could be caused by a cast removing const or volatile qualifier from the type addressed by a pointer or by a cast to a different function or object type: "); + } } } } @@ -3458,11 +3738,14 @@ public: } else { - std::cout << "10.1/2:" << "ImplicitCastExpr changes the signedness of the type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.1/2:" << "ImplicitCastExpr changes the signedness of the type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr changes the signedness of the type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr changes the signedness of the type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr changes the signedness of the type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr changes the signedness of the type: "); + } } } } @@ -3475,11 +3758,14 @@ public: } else { - std::cout << "10.1/2:" << "ImplicitCastExpr is narrowing:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.1/2:" << "ImplicitCastExpr is narrowing:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr is narrowing: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr is narrowing: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.1/2", "ImplicitCastExpr is narrowing: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.1/2", "ImplicitCastExpr is narrowing: "); + } } } @@ -3493,11 +3779,14 @@ public: } else { - std::cout << "10.3:" << "ImplicitCastExpr is widening for complex integer type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.3:" << "ImplicitCastExpr is widening for complex integer type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.3", "ImplicitCastExpr is widening for complex integer type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.3", "ImplicitCastExpr is widening for complex integer type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.3", "ImplicitCastExpr is widening for complex integer type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.3", "ImplicitCastExpr is widening for complex integer type: "); + } } } @@ -3523,11 +3812,14 @@ public: } else { - std::cout << "10.3:" << "ImplicitCastExpr changes the signedness of the complex integer type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.3:" << "ImplicitCastExpr changes the signedness of the complex integer type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.3", "ImplicitCastExpr changes the signedness of the complex integer type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.3", "ImplicitCastExpr changes the signedness of the complex integer type type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.3", "ImplicitCastExpr changes the signedness of the complex integer type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.3", "ImplicitCastExpr changes the signedness of the complex integer type type: "); + } } } } @@ -3543,11 +3835,14 @@ public: } else { - std::cout << "10.4:" << "ImplicitCastExpr is widening for complex float type:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "10.4:" << "ImplicitCastExpr is widening for complex float type:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "10.4", "ImplicitCastExpr is widening for complex float type: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "10.4", "ImplicitCastExpr is widening for complex float type: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "10.4", "ImplicitCastExpr is widening for complex float type: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "10.4", "ImplicitCastExpr is widening for complex float type: "); + } } } } @@ -3627,11 +3922,14 @@ public: } else { - std::cout << "5.2:" << "Object or function has hidden visibility:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "5.2:" << "Object or function has hidden visibility:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "5.2", "Object or function has hidden visibility: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "5.2", "Object or function has hidden visibility: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "5.2", "Object or function has hidden visibility: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "5.2", "Object or function has hidden visibility: "); + } } } @@ -3656,11 +3954,14 @@ public: } else { - std::cout << "5.1:" << "Identifier relies on the signifacance of more than 31 charcaters:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "5.1:" << "Identifier relies on the signifacance of more than 31 charcaters:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "5.1", "Identifier relies on the significance of more than 31 charcaters: "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "5.1", "Identifier relies on the significance of more than 31 charcaters: "); + XMLDocOut.XMLAddNode(MR.Context, SL, "5.1", "Identifier relies on the significance of more than 31 charcaters: "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "5.1", "Identifier relies on the significance of more than 31 charcaters: "); + } } } } @@ -3703,11 +4004,14 @@ public: } else { - std::cout << "5.4:" << "tag identifier is not unique:"; - std::cout << iter.SLString << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, iter.FSL.getManager().isInMainFile(iter.SL), iter.SL)) + { + std::cout << "5.4:" << "tag identifier is not unique:"; + std::cout << iter.SLString << ":" << std::endl; - XMLDocOut.XMLAddNode(iter.FSL, iter.SL, "5.4", "tag identifier is not unique: "); - JSONDocOUT.JSONAddElement(iter.FSL, iter.SL, "5.4", "tag identifier is not unique: "); + XMLDocOut.XMLAddNode(iter.FSL, iter.SL, "5.4", "tag identifier is not unique: "); + JSONDocOUT.JSONAddElement(iter.FSL, iter.SL, "5.4", "tag identifier is not unique: "); + } } } @@ -3732,11 +4036,14 @@ public: } else { - std::cout << "5.3:" << "typedef identifier is not unique:"; - std::cout << iter.SLString << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, iter.FSL.getManager().isInMainFile(iter.SL), iter.SL)) + { + std::cout << "5.3:" << "typedef identifier is not unique:"; + std::cout << iter.SLString << ":" << std::endl; - XMLDocOut.XMLAddNode(iter.FSL, iter.SL, "5.3", "typedef identifier is not unique: "); - JSONDocOUT.JSONAddElement(iter.FSL, iter.SL, "5.3", "typedef identifier is not unique: "); + XMLDocOut.XMLAddNode(iter.FSL, iter.SL, "5.3", "typedef identifier is not unique: "); + JSONDocOUT.JSONAddElement(iter.FSL, iter.SL, "5.3", "typedef identifier is not unique: "); + } } } @@ -3834,13 +4141,16 @@ public: } else { - std::cout << "8.7:" << "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block:"; - std::cout << iter.ObjSLStr << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, iter.ObjFSL.getManager().isInMainFile(iter.ObjSL), iter.ObjSL)) + { + std::cout << "8.7:" << "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block:"; + std::cout << iter.ObjSLStr << ":" << std::endl; - XMLDocOut.XMLAddNode(iter.ObjFSL, iter.ObjSL, "8.7", \ - "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block: "); - JSONDocOUT.JSONAddElement(iter.ObjFSL, iter.ObjSL, "8.7", \ - "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block: "); + XMLDocOut.XMLAddNode(iter.ObjFSL, iter.ObjSL, "8.7", \ + "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block: "); + JSONDocOUT.JSONAddElement(iter.ObjFSL, iter.ObjSL, "8.7", \ + "Object (" + iter.ObjNameStr + ") is only being used in one block (" + iter.FirstDaddyName + ") but is not defined inside that block: "); + } } } } @@ -3933,11 +4243,14 @@ public: } else { - std::cout << "8.8:" << "External function or object (" + iter.XObjNameStr + ") is defined in more than one file:"; - std::cout << iter.XObjSLStr << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, iter.XObjFSL.getManager().isInMainFile(iter.XObjSL), iter.XObjSL)) + { + std::cout << "8.8:" << "External function or object (" + iter.XObjNameStr + ") is defined in more than one file:"; + std::cout << iter.XObjSLStr << ":" << std::endl; - XMLDocOut.XMLAddNode(iter.XObjFSL, iter.XObjSL, "8.8", "External function or object (" + iter.XObjNameStr + ") is defined in more than one file: "); - JSONDocOUT.JSONAddElement(iter.XObjFSL, iter.XObjSL, "8.8", "External function or object (" + iter.XObjNameStr + ") is defined in more than one file: "); + XMLDocOut.XMLAddNode(iter.XObjFSL, iter.XObjSL, "8.8", "External function or object (" + iter.XObjNameStr + ") is defined in more than one file: "); + JSONDocOUT.JSONAddElement(iter.XObjFSL, iter.XObjSL, "8.8", "External function or object (" + iter.XObjNameStr + ") is defined in more than one file: "); + } } #endif } @@ -4034,11 +4347,14 @@ public: } else { - std::cout << "2.3:" << "character sequence \"/*\" used inside the comment:"; - std::cout << RCSL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, RCSL)) + { + std::cout << "2.3:" << "character sequence \"/*\" used inside the comment:"; + std::cout << RCSL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, RCSL, "2.3", "character sequence \"/*\" used inside the comment : "); - JSONDocOUT.JSONAddElement(MR.Context, RCSL, "2.3", "character sequence \"/*\" used inside the comment : "); + XMLDocOut.XMLAddNode(MR.Context, RCSL, "2.3", "character sequence \"/*\" used inside the comment : "); + JSONDocOUT.JSONAddElement(MR.Context, RCSL, "2.3", "character sequence \"/*\" used inside the comment : "); + } } } } @@ -4091,11 +4407,14 @@ public: { if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) { - std::cout << "16.7:" << "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const:"; - std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, MR, SL)) + { + std::cout << "16.7:" << "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const:"; + std::cout << SL.printToString(*MR.SourceManager) << ":" << std::endl; - XMLDocOut.XMLAddNode(MR.Context, SL, "16.7", "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const : "); - JSONDocOUT.JSONAddElement(MR.Context, SL, "16.7", "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const : "); + XMLDocOut.XMLAddNode(MR.Context, SL, "16.7", "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const : "); + JSONDocOUT.JSONAddElement(MR.Context, SL, "16.7", "pointerType ParmVarDecl is not used to change the contents of the object it points to but is not declared as const : "); + } } } } @@ -4159,11 +4478,14 @@ public: } else { - std::cout << "19.2:" << "illegal characters in inclusion directive:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "19.2:" << "illegal characters in inclusion directive:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + } } } @@ -4175,11 +4497,14 @@ public: } else { - std::cout << "20.5:" << "errno shall not be used:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "20.5:" << "errno shall not be used:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "20.5", "errno shall not be used : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "20.5", "errno shall not be used : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "20.5", "errno shall not be used : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "20.5", "errno shall not be used : "); + } } } @@ -4191,11 +4516,14 @@ public: } else { - std::cout << "20.12:" << "stdlib time.h is included in the project. use is forbidden:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "20.12:" << "stdlib time.h is included in the project. use is forbidden:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "20.12", "stdlib time.h is included in the project. use is forbidden : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "20.12", "stdlib time.h is included in the project. use is forbidden : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "20.12", "stdlib time.h is included in the project. use is forbidden : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "20.12", "stdlib time.h is included in the project. use is forbidden : "); + } } } @@ -4207,11 +4535,14 @@ public: } else { - std::cout << "20.9:" << "stdlib stdio.h is included in the project. use is forbidden:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "20.9:" << "stdlib stdio.h is included in the project. use is forbidden:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "20.9", "stdlib stdio.h is included in the project. use is forbidden : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "20.9", "stdlib stdio.h is included in the project. use is forbidden : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "20.9", "stdlib stdio.h is included in the project. use is forbidden : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "20.9", "stdlib stdio.h is included in the project. use is forbidden : "); + } } } @@ -4223,11 +4554,14 @@ public: } else { - std::cout << "20.8:" << "stdlib signal.h is included in the project. use is forbidden:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "20.8:" << "stdlib signal.h is included in the project. use is forbidden:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "20.8", "stdlib signal.h is included in the project. use is forbidden : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "20.8", "stdlib signal.h is included in the project. use is forbidden : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "20.8", "stdlib signal.h is included in the project. use is forbidden : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "20.8", "stdlib signal.h is included in the project. use is forbidden : "); + } } } } @@ -4245,11 +4579,14 @@ public: } else { - std::cout << "19.2:" << "illegal characters in inclusion directive:"; - std::cout << HashLoc.printToString(SM) << "\n" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "19.2:" << "illegal characters in inclusion directive:"; + std::cout << HashLoc.printToString(SM) << "\n" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "19.2", "illegal characters in inclusion directive : "); + } } } @@ -4290,11 +4627,14 @@ public: } else { - std::cout << "19.3:" << "Include directive contains file address, not just name:"; - std::cout << HashLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, HashLoc)) + { + std::cout << "19.3:" << "Include directive contains file address, not just name:"; + std::cout << HashLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, HashLoc, "19.3", "Include directive contains file address, not just name : "); - JSONDocOUT.JSONAddElement(SM, HashLoc, "19.3", "Include directive contains file address, not just name : "); + XMLDocOut.XMLAddNode(SM, HashLoc, "19.3", "Include directive contains file address, not just name : "); + JSONDocOUT.JSONAddElement(SM, HashLoc, "19.3", "Include directive contains file address, not just name : "); + } } } } @@ -4393,11 +4733,14 @@ public: } else { - std::cout << "20.1:" << "C keyword undefined:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.1:" << "C keyword undefined:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.1", "C keyword undefined : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C keyword undefined : "); + XMLDocOut.XMLAddNode(SM, SL, "20.1", "C keyword undefined : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C keyword undefined : "); + } } } @@ -4417,11 +4760,14 @@ public: } else { - std::cout << "20.1:" << "C standard library macro undefined:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.1:" << "C standard library macro undefined:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.1", "C standard library macro undefined : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C standard library macro undefined : "); + XMLDocOut.XMLAddNode(SM, SL, "20.1", "C standard library macro undefined : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C standard library macro undefined : "); + } } } } @@ -4441,11 +4787,14 @@ public: } else { - std::cout << "19.6:" << "Use of #undef is illegal:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.6:" << "Use of #undef is illegal:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.6", "Use of #undef is illegal : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.6", "Use of #undef is illegal : "); + XMLDocOut.XMLAddNode(SM, SL, "19.6", "Use of #undef is illegal : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.6", "Use of #undef is illegal : "); + } } } #endif @@ -4487,11 +4836,14 @@ public: } else { - std::cout << "20.1:" << "C keyword defined:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.1:" << "C keyword defined:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.1", "C keyword defined : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C keyword defined : "); + XMLDocOut.XMLAddNode(SM, SL, "20.1", "C keyword defined : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C keyword defined : "); + } } } @@ -4508,11 +4860,14 @@ public: } else { - std::cout << "20.1:" << "C standard library macro redefined:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.1:" << "C standard library macro redefined:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.1", "C standard library macro redefined : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C standard library macro redefined : "); + XMLDocOut.XMLAddNode(SM, SL, "20.1", "C standard library macro redefined : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.1", "C standard library macro redefined : "); + } } } } @@ -4539,11 +4894,14 @@ public: } else { - std::cout << "19.13:" << "Macro has # token:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.13:" << "Macro has # token:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.13", "Macro has # token : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.13", "Macro has # token : "); + XMLDocOut.XMLAddNode(SM, SL, "19.13", "Macro has # token : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.13", "Macro has # token : "); + } } } @@ -4557,11 +4915,14 @@ public: } else { - std::cout << "19.13:" << "Macro has ## token:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.13:" << "Macro has ## token:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.13", "Macro has ## token : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.13", "Macro has ## token : "); + XMLDocOut.XMLAddNode(SM, SL, "19.13", "Macro has ## token : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.13", "Macro has ## token : "); + } } } #endif @@ -4575,11 +4936,14 @@ public: } else { - std::cout << "19.12:" << "Macro has # and ## tokens:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.12:" << "Macro has # and ## tokens:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.12", "Macro has # and ## tokens : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.12", "Macro has # and ## tokens : "); + XMLDocOut.XMLAddNode(SM, SL, "19.12", "Macro has # and ## tokens : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.12", "Macro has # and ## tokens : "); + } } } @@ -4657,11 +5021,14 @@ public: } else { - std::cout << "19.10:" << "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.10:" << "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.10", "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.10", "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash : "); + XMLDocOut.XMLAddNode(SM, SL, "19.10", "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.10", "Funciton-like macro's parameters are not enclosed in parantheses or dont have hash : "); + } } } @@ -4673,11 +5040,14 @@ public: { if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) { - std::cout << "19.7:" << "Function-like macro used:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.7:" << "Function-like macro used:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.7", "Function-like macro used : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.7", "Function-like macro used : "); + XMLDocOut.XMLAddNode(SM, SL, "19.7", "Function-like macro used : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.7", "Function-like macro used : "); + } } } @@ -4693,11 +5063,14 @@ public: } else { - std::cout << "19.9:" << "Function-like macro's argument contains macros:"; - std::cout << SL.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.9:" << "Function-like macro's argument contains macros:"; + std::cout << SL.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.9", "Function-like macro's argument contains macros : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.9", "Function-like macro's argument contains macros : "); + XMLDocOut.XMLAddNode(SM, SL, "19.9", "Function-like macro's argument contains macros : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.9", "Function-like macro's argument contains macros : "); + } } break; @@ -4731,11 +5104,14 @@ public: } else { - std::cout << "20.6:" << "use of offsetof is illegal:"; - std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.6:" << "use of offsetof is illegal:"; + std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.6", "use of offsetof is illegal : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.6", "use of offsetof is illegal : "); + XMLDocOut.XMLAddNode(SM, SL, "20.6", "use of offsetof is illegal : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.6", "use of offsetof is illegal : "); + } } } @@ -4747,11 +5123,14 @@ public: } else { - std::cout << "20.7:" << "use of setjmp is illegal:"; - std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "20.7:" << "use of setjmp is illegal:"; + std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "20.7", "use of setjmp is illegal : "); - JSONDocOUT.JSONAddElement(SM, SL, "20.7", "use of setjmp is illegal : "); + XMLDocOut.XMLAddNode(SM, SL, "20.7", "use of setjmp is illegal : "); + JSONDocOUT.JSONAddElement(SM, SL, "20.7", "use of setjmp is illegal : "); + } } } @@ -4763,11 +5142,14 @@ public: } else { - std::cout << "19.11:" << "Use of undefined macro:"; - std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, SL)) + { + std::cout << "19.11:" << "Use of undefined macro:"; + std::cout << Range.getBegin().printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SL, "19.11", "Use of undefined macro : "); - JSONDocOUT.JSONAddElement(SM, SL, "19.11", "Use of undefined macro : "); + XMLDocOut.XMLAddNode(SM, SL, "19.11", "Use of undefined macro : "); + JSONDocOUT.JSONAddElement(SM, SL, "19.11", "Use of undefined macro : "); + } } } #endif @@ -4787,11 +5169,14 @@ public: } else { - std::cout << "19.17:" << "elif directive is not in the same file as its if directive:"; - std::cout << SLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, Loc)) + { + std::cout << "19.17:" << "elif directive is not in the same file as its if directive:"; + std::cout << SLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "elif directive is not in the same file as its if directive : "); - JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "elif directive is not in the same file as its if directive : "); + XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "elif directive is not in the same file as its if directive : "); + JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "elif directive is not in the same file as its if directive : "); + } } } #endif @@ -4811,11 +5196,14 @@ public: } else { - std::cout << "19.17:" << "else directive is not in the same file as its if directive:"; - std::cout << SLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, Loc)) + { + std::cout << "19.17:" << "else directive is not in the same file as its if directive:"; + std::cout << SLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "else directive is not in the same file as its if directive : "); - JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "else directive is not in the same file as its if directive : "); + XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "else directive is not in the same file as its if directive : "); + JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "else directive is not in the same file as its if directive : "); + } } } #endif @@ -4835,11 +5223,14 @@ public: } else { - std::cout << "19.17:" << "endif directive is not in the same file as its if directive:"; - std::cout << SLoc.printToString(SM) << ":" << std::endl; + if (Devi::IsTheMatchInMainFile(MainFileOnly, SM, Loc)) + { + std::cout << "19.17:" << "endif directive is not in the same file as its if directive:"; + std::cout << SLoc.printToString(SM) << ":" << std::endl; - XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "endif directive is not in the same file as its if directive : "); - JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "endif directive is not in the same file as its if directive : "); + XMLDocOut.XMLAddNode(SM, SLoc, "19.17", "endif directive is not in the same file as its if directive : "); + JSONDocOUT.JSONAddElement(SM, SLoc, "19.17", "endif directive is not in the same file as its if directive : "); + } } } #endif @@ -5169,7 +5560,9 @@ int main(int argc, const char **argv) { /*@DEVI-we should parse the common options before parsing the custom options.*/ CommonOptionsParser op(argc, argv, MutatorLVL0Cat); +#if 0 cl::ParseCommandLineOptions(argc, argv); +#endif ClangTool Tool(op.getCompilations(), op.getSourcePathList()); |