aboutsummaryrefslogtreecommitdiffstats
path: root/m0/mutator_aux.cpp
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-09-29 11:21:57 +0000
committerbloodstalker <thabogre@gmail.com>2018-09-29 11:21:57 +0000
commitcf4e229615f84653e47ec54a3035eb2ff1f454cc (patch)
tree0d66615902490610ad9d8ebbcd4befb1f5776e3c /m0/mutator_aux.cpp
parentdid some code cleanup on m0 and bruiser, now you can specify report paths for... (diff)
downloadmutator-cf4e229615f84653e47ec54a3035eb2ff1f454cc.tar.gz
mutator-cf4e229615f84653e47ec54a3035eb2ff1f454cc.zip
with a few minor tweaks, you can build m0, obfuscator and bruiser with llvm 8.0(latest tested:trunk 340121). we are skipping llvm 7.0. Ill keep backwards compatibility with 5.0 or 6.0 for a good while.
Diffstat (limited to '')
-rw-r--r--m0/mutator_aux.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/m0/mutator_aux.cpp b/m0/mutator_aux.cpp
index f6b2675..b563bbe 100644
--- a/m0/mutator_aux.cpp
+++ b/m0/mutator_aux.cpp
@@ -43,11 +43,23 @@ SourceLocation SourceLocationHasMacro [[deprecated("doesnt work")]] (SourceLocat
/*does the sourcelocation include a macro expansion?*/
if ( SL.isMacroID()) {
/*get the expansion range which is startloc and endloc*/
+#if __clang_major__ <= 6
std::pair <SourceLocation, SourceLocation> expansionRange = Rewrite.getSourceMgr().getImmediateExpansionRange(SL);
+#elif __clang_major__ == 8
+ CharSourceRange expansionRange = Rewrite.getSourceMgr().getImmediateExpansionRange(SL);
+#endif
if (Kind == "start") {
- return (expansionRange.first);
+#if __clang_major__ <= 6
+ return expansionRange.first;
+#elif __clang_major__ >= 8
+ return expansionRange.getBegin();
+#endif
} else if (Kind == "end") {
- return (expansionRange.second);
+#if __clang_major__ <= 6
+ return expansionRange.second;
+#elif __clang_major__ >= 8
+ return expansionRange.getEnd();
+#endif
} else {
std::cout << "the third argument of Devi::SourceLocationHasMacro is invalid." << std::endl;
}