diff options
Diffstat (limited to '')
-rw-r--r-- | .travis.yml | 24 | ||||
-rw-r--r-- | appveyor.yml | 2 | ||||
-rw-r--r-- | bruiser/autogen/wasm/ft/makefile | 4 | ||||
-rw-r--r-- | bruiser/autogen/wasm/ltg/makefile | 4 | ||||
-rw-r--r-- | bruiser/makefile | 8 | ||||
-rw-r--r-- | m0/makefile | 8 | ||||
-rw-r--r-- | m0/mutator-lvl0.cpp | 38 | ||||
-rw-r--r-- | m0/mutator-lvl0.h | 2 | ||||
-rw-r--r-- | makefile | 2 |
9 files changed, 54 insertions, 38 deletions
diff --git a/.travis.yml b/.travis.yml index 88aabf3..0830e72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ before_script: - sudo add-apt-repository ppa:fkrull/deadsnakes -y - sudo apt-get update -y - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add - - #- wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - # Fingerprint: 6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421 - echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" | sudo tee -a /etc/apt/sources.list - sudo apt-get update -qq - travis_retry sudo apt-get install clang-5.0 libclang-5.0-dev libclang-common-5.0-dev libllvm5.0 llvm-5.0-dev llvm-5.0 llvm-5.0-runtime libclang1-5.0-dbg libllvm5.0-dbg lldb-5.0 -y @@ -43,9 +42,6 @@ before_script: - sudo apt-get install libboost-dev - git submodule init - git submodule update - #- sudo apt-get install python3-all-dev -y - #- sudo apt-get install libpython3-all-dev -y - #- sudo apt-get source python -y - sudo apt-get install python3.5-dev -y --allow-unauthenticated - python3-config --includes - python3-config --ldflags @@ -54,9 +50,6 @@ before_script: script: - make PY_CONF=python3.5-config CXX=clang-5.0 LLVM_CONF=llvm-config-5.0 BUILD_MODE=COV_NO_CLANG CC=clang-5.0 -j2 -after_failure: - - find . -maxdepth 1 -name "core*" - after_success: - cd ./extra-tools && ./precommitTests.sh - llvm-config-4.0 --has-rtti @@ -65,24 +58,7 @@ after_success: - ./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/usr/include -I/usr/include/linux -Wall > /dev/null - make clean - make mutator-lvl0 CXX=clang-5.0 LLVM_CONF=llvm-config-5.0 BUILD_MODE=COV_GNU -j2 - #- echo "deb http://old-releases.ubuntu.com/ubuntu/ hardy universe" | sudo tee -a /etc/apt/sources.list - #- sudo apt-get update -y - #- sudo apt-get install gcc-4.2 g++-4.2 - #- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.2 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.2 - make install - ./mutator-lvl0 -SysHeader=false -MainOnly=true ./test/testFuncs1.c ./test/testFuncs2.c ./test/testFuncs3.c -- -std=c90 -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/usr/include -I/usr/include/linux -Wall > /dev/null - gcov -v - gcc -v - #- coveralls --exclude ./json --exclude ./tinyxml2 --exclude-pattern 'clang' --exclude-pattern 'llvm' - #- gcc -E - <<< '#include<stddef.h>' - #- gcc -E - <<< '#include<assert.h>' - - ls - - ulimit -a - - find . -maxdepth 1 -name "core*" - - ls -s - cd test - gcc testFuncs3.c -c - cd /usr/lib/syslinux - ls - cd /usr/include/linux - ls diff --git a/appveyor.yml b/appveyor.yml index d55012d..5de9e1f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,4 +15,4 @@ install: - 'git submodule update' build_script: - - '%CYG_ROOT%\bin\bash -lc "make -C $APPVEYOR_BUILD_FOLDER obfuscator"' + - '%CYG_ROOT%\bin\bash -lc "make -C $APPVEYOR_BUILD_FOLDER obfuscator mutator-lvl0"' diff --git a/bruiser/autogen/wasm/ft/makefile b/bruiser/autogen/wasm/ft/makefile index 08e0ffe..1ee85d2 100644 --- a/bruiser/autogen/wasm/ft/makefile +++ b/bruiser/autogen/wasm/ft/makefile @@ -3,7 +3,11 @@ SHELL=bash SHELL?=bash CC=clang CC?=clang +ifdef OS +CC_FLAGS= +else CC_FLAGS= -fPIC +endif CC_EXTRA?= CTAGS_I_PATH?=./ LD_FLAGS= diff --git a/bruiser/autogen/wasm/ltg/makefile b/bruiser/autogen/wasm/ltg/makefile index 41d6c5a..7f06195 100644 --- a/bruiser/autogen/wasm/ltg/makefile +++ b/bruiser/autogen/wasm/ltg/makefile @@ -3,7 +3,11 @@ SHELL=bash SHELL?=bash CC=clang CC?=clang +ifdef OS +CC_FLAGS= +else CC_FLAGS= -fPIC +endif CC_EXTRA?= CTAGS_I_PATH?=./ LD_FLAGS= diff --git a/bruiser/makefile b/bruiser/makefile index 2e29fd1..48f54cb 100644 --- a/bruiser/makefile +++ b/bruiser/makefile @@ -14,10 +14,18 @@ SHELL=bash SHELL?=bash CC=clang CC?=clang +ifdef OS +CC_FLAGS= $(shell $(PY_CONF) --includes) +else CC_FLAGS=-fpic $(shell $(PY_CONF) --includes) +endif CXX=clang++ CXX?=clang++ +ifdef OS +CXX_FLAGS= -I/usr/include $(shell $(PY_CONF) --includes) +else CXX_FLAGS=-fpic -I/usr/include $(shell $(PY_CONF) --includes) +endif CXX_EXTRA?= CTAGS_I_PATH?=./ LD_FLAGS=-v diff --git a/m0/makefile b/m0/makefile index a9afeaf..cd7f0be 100644 --- a/m0/makefile +++ b/m0/makefile @@ -3,10 +3,18 @@ SHELL=bash SHELL?=bash CC=clang CC?=clang +ifdef OS +CFLAGS=-std=c11 +else CFLAGS=-fpic -std=c11 +endif CXX=clang++ CXX?=clang++ +ifdef OS +CXX_FLAGS=-fpic +else CXX_FLAGS=-fpic +endif CXX_EXTRA?= CTAGS_I_PATH?=./ LD_FLAGS= diff --git a/m0/mutator-lvl0.cpp b/m0/mutator-lvl0.cpp index abbcb52..10cd06a 100644 --- a/m0/mutator-lvl0.cpp +++ b/m0/mutator-lvl0.cpp @@ -4155,7 +4155,11 @@ public: RawCommentList RCL = ASTC->Comments; - ArrayRef<RawComment*> RawCommentArrRef = RCL.getComments(); +#if __clang_major__ >= 10 + auto RawComments = RCL.getCommentsInFile(SM.getMainFileID()); +#elif __clang_major__ < 10 + ArrayRef<RawComment*> RawComments = RCL.getComments(); +#endif std::string RawText; @@ -4165,11 +4169,23 @@ public: unsigned MatchCounter = 0U; - for (auto &iter : RawCommentArrRef) +#if __clang_major__ >= 10 + for (auto &iter : *RawComments) +#elif __clang_major__ < 10 + for (auto &iter : RawComments) +#endif { +#if __clang_major__ >= 10 + RawText = iter.second->getRawText(SM); +#elif __clang_major__ < 10 RawText = iter->getRawText(SM); +#endif +#if __clang_major__ >= 10 + SourceLocation RCSL = iter.second->DEVI_GETLOCSTART(); +#elif __clang_major__ < 10 SourceLocation RCSL = iter->DEVI_GETLOCSTART(); +#endif CheckSLValidity(RCSL); RCSL = Devi::SourceLocationHasMacro(RCSL, Rewrite, "start"); @@ -4499,9 +4515,9 @@ public: const UnaryOperator* UO = MR.Nodes.getNodeAs<clang::UnaryOperator>("mcexpr1211uno"); clang::UnaryOperator::Opcode UnoOpKind = UO->getOpcode(); const Expr* UnoSubEXP = UO->getSubExpr(); -#if __clang_major__ >= 9 +#if __clang_major__ >= 8 clang::Expr::EvalResult UnoResult; -#elif __clang_major__ < 9 +#elif __clang_major__ < 8 llvm::APSInt UnoResult; UnoFinal = UnoResult.getExtValue(); #endif @@ -4528,20 +4544,20 @@ public: const Expr* DousLHS = BO->getLHS(); const Expr* DousRHS = BO->getRHS(); -#if __clang_major__ >= 9 +#if __clang_major__ >= 8 clang::Expr::EvalResult DousLHSAPS; clang::Expr::EvalResult DousRHSAPS; -#elif __clang_major__ < 9 +#elif __clang_major__ < 8 llvm::APSInt DousLHSAPS; llvm::APSInt DousRHSAPS; #endif if (DousLHS->EvaluateAsInt(DousLHSAPS, *ASTC) && DousRHS->EvaluateAsInt(DousRHSAPS, *ASTC)) { -#if __clang_major__ >= 9 +#if __clang_major__ >= 8 int64_t DousLHSInt64 = DousLHSAPS.Val.getInt().getExtValue(); int64_t DousRHSInt64 = DousRHSAPS.Val.getInt().getExtValue(); -#elif __clang_major__ < 9 +#elif __clang_major__ < 8 int64_t DousLHSInt64 = DousLHSAPS.getExtValue(); int64_t DousRHSInt64 = DousRHSAPS.getExtValue(); #endif @@ -4566,11 +4582,11 @@ public: } } -#if __clang_major__ >= 9 +#if __clang_major__ >= 8 clang::Expr::EvalResult OverflowCondidate; EXP->EvaluateAsInt(OverflowCondidate, *ASTC); int64_t IntExprValue = OverflowCondidate.Val.getInt().getExtValue(); -#elif __clang_major__ < 9 +#elif __clang_major__ < 8 llvm::APSInt OverflowCondidate; EXP->EvaluateAsInt(OverflowCondidate, *ASTC); int64_t IntExprValue = OverflowCondidate.getExtValue(); @@ -5617,7 +5633,7 @@ public: throw MutExHeaderNotFound(FileName.str()); } -#if __clang_major__ <= 6 +#if __clang_major__ <= 7 virtual void InclusionDirective (SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, \ bool IsAngled, CharSourceRange FileNameRange, const FileEntry* File, \ StringRef SearchPath, StringRef RelativePath, const clang::Module* Imported) { diff --git a/m0/mutator-lvl0.h b/m0/mutator-lvl0.h index 1891fef..982c7ac 100644 --- a/m0/mutator-lvl0.h +++ b/m0/mutator-lvl0.h @@ -38,7 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.* #include "clang/AST/ASTTypeTraits.h" /**********************************************************************************************************************/ /*macros*/ -#if __clang_major__ <= 6 +#if __clang_major__ <= 7 #define DEVI_GETLOCSTART getLocStart #define DEVI_GETLOCEND getLocEnd #elif __clang_major__ >= 8 @@ -16,7 +16,7 @@ CGREP=cgrep .PHONY:all clean install help $(BRUISER) $(OBSC) $(TARGETC) $(TARGETD) $(TARGETS) $(SFCPP01) $(CGREP) -all: $(TARGET0) $(TARGETC) $(TARGETD) $(TARGETS) $(SFCPP01) $(BRUISER) $(OBSC) $(CGREP) +all: $(TARGET0) $(TARGETC) $(TARGETD) $(TARGETS) $(BRUISER) $(OBSC) $(CGREP) $(TARGET1): $(CXX) $^ $(LD_FLAGS) -o $@ |