aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-01-03 01:57:43 +0000
committerbloodstalker <thabogre@gmail.com>2017-01-03 01:57:43 +0000
commite52d3ff52ff224468e21353cfda6d5628734b10f (patch)
treea57e083de56194e9aec3f1bd72dc463849784302
parentfinally fixed the MainOnly option (diff)
downloadmutator-e52d3ff52ff224468e21353cfda6d5628734b10f.tar.gz
mutator-e52d3ff52ff224468e21353cfda6d5628734b10f.zip
added some more sugar to the custom options, only implemented for 19.7
-rw-r--r--mutator-lvl0.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp
index 3772791..b7e4974 100644
--- a/mutator-lvl0.cpp
+++ b/mutator-lvl0.cpp
@@ -57,8 +57,8 @@ enum MisraC
static llvm::cl::OptionCategory MutatorLVL0Cat("mutator-lvl0 options category");
/*@DEVI-the option has been added since gcc does it.its as simple as that.*/
-cl::opt<bool> CheckSystemHeader("SysHeader", cl::desc("mutator-lvl0 will run through System Headers"));
-cl::opt<bool> MainFileOnly("MainOnly", cl::desc("mutator-lvl0 will only report the results that reside in the main file"));
+cl::opt<bool> CheckSystemHeader("SysHeader", cl::desc("mutator-lvl0 will run through System Headers"), cl::init(false), cl::cat(MutatorLVL0Cat), cl::ZeroOrMore);
+cl::opt<bool> MainFileOnly("MainOnly", cl::desc("mutator-lvl0 will only report the results that reside in the main file"), cl::init(false), cl::cat(MutatorLVL0Cat), cl::ZeroOrMore);
cl::opt<MisraC> MisraCVersion(cl::desc("choose the MisraC version to check against"), \
cl::values(clEnumVal(MisraC2004, "Misra-C:2004"), clEnumVal(MisraC2012, "Misra-C:2012"), \
clEnumVal(C2, "Misra-C:2004"), clEnumVal(C3, "Misra-C:2012")));
@@ -4671,11 +4671,14 @@ public:
}
else
{
- 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 : ");
+ }
}
if (MacroNumArgs != 0)