From 82ce5f32650380329e9bc2d8ede1b3e40c7c1340 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Mon, 27 Feb 2017 19:50:29 +0330 Subject: added the missing C1 option, with one more thing i'm trying. --- mutator-lvl0.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp index 08e3ddf..10304f2 100644 --- a/mutator-lvl0.cpp +++ b/mutator-lvl0.cpp @@ -206,9 +206,9 @@ 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 CheckSystemHeader("SysHeader", cl::desc("mutator-lvl0 will run through System Headers"), cl::init(false), cl::cat(MutatorLVL0Cat), cl::ZeroOrMore); cl::opt 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 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")), cl::init(MisraC2004), cl::cat(MutatorLVL0Cat), cl::Optional); +cl::opt MisraCVersion("MCV", cl::desc("choose the MisraC version to check against"), \ + cl::values(clEnumVal(MisraC98, "Misrac-1998"), clEnumVal(MisraC2004, "Misra-C:2004"), clEnumVal(MisraC2012, "Misra-C:2012"), \ + clEnumVal(C1, "Misra-C:1998"), clEnumVal(C2, "Misra-C:2004"), clEnumVal(C3, "Misra-C:2012")), cl::init(MisraC2004), cl::cat(MutatorLVL0Cat), cl::Optional); cl::opt MCE("MCE", cl::desc("MisraC switches to enable specific rule checks"), cl::init("10.1 "), cl::cat(MutatorLVL0Cat), cl::Optional); cl::opt MCD("MCD", cl::desc("MisraC switches to disable specific rule checks"), cl::init(" 9.3"), cl::cat(MutatorLVL0Cat), cl::Optional); cl::opt MCEA("MCEA", cl::desc("MisraC switch to enable all rule checks"), cl::init(true), cl::cat(MutatorLVL0Cat), cl::Optional); @@ -7707,7 +7707,25 @@ int main(int argc, const char **argv) CommonOptionsParser op(argc, argv, MutatorLVL0Cat); CompilationDatabase &CDB [[maybe_unused]] = op.getCompilations(); - //std::vector loco = + std::vector ComCom = CDB.getAllCompileCommands(); + std::vector> ExecCL; + +#if defined(_MUT0_TEST) + for (auto &iter : ComCom) + { + ExecCL.push_back(iter.CommandLine); + } + + for (auto &iter : ExecCL) + { + for (auto &yaiter : iter) + { + std::cout << "comcom: " << yaiter << std::endl; + } + + std::cout << std::endl; + } +#endif const std::vector &SourcePathList = op.getSourcePathList(); -- cgit v1.2.3