From cf4e229615f84653e47ec54a3035eb2ff1f454cc Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sat, 29 Sep 2018 14:51:57 +0330 Subject: 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. --- bruiser/bruiser.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'bruiser/bruiser.cpp') diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index ae6db23..726f963 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -661,10 +661,10 @@ public: if (MR.Nodes.getNodeAs("mainwrapper") != nullptr) { const FunctionDecl* FD = MR.Nodes.getNodeAs("mainwrapper"); - SourceLocation SL = FD->getLocStart(); + SourceLocation SL = FD->DEVI_GETLOCSTART(); CheckSLValidity(SL); SL = Devi::SourceLocationHasMacro(SL, Rewrite); - SourceLocation SLE = FD->getLocEnd(); + SourceLocation SLE = FD->DEVI_GETLOCEND(); CheckSLValidity(SLE); SLE = Devi::SourceLocationHasMacro(SLE, Rewrite); @@ -695,7 +695,7 @@ class LiveListFuncs : public MatchFinder::MatchCallback { if (MR.Nodes.getNodeAs("livelistfuncs") != nullptr) { const clang::FunctionDecl* FD = MR.Nodes.getNodeAs("livelistfuncs"); - SourceLocation SL = FD->getLocStart(); + SourceLocation SL = FD->DEVI_GETLOCSTART(); CheckSLValidity(SL); SL = Devi::SourceLocationHasMacro(SL, R); @@ -705,13 +705,13 @@ class LiveListFuncs : public MatchFinder::MatchCallback { if (FD->hasBody()) { Stmt* Body = FD->getBody(); - SourceLocation SLBody = Body->getLocStart(); - SourceLocation SLShebang = FD->getLocStart(); + SourceLocation SLBody = Body->DEVI_GETLOCSTART(); + SourceLocation SLShebang = FD->DEVI_GETLOCSTART(); PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(clang::SourceRange(SLShebang, SLBody.getLocWithOffset(-1))).c_str()); PushToLua.push_back(R.getRewrittenText(clang::SourceRange(SLShebang, SLBody.getLocWithOffset(-1)))); } else { - SourceLocation SL = FD->getLocStart(); - SourceLocation SLE = FD->getLocEnd(); + SourceLocation SL = FD->DEVI_GETLOCSTART(); + SourceLocation SLE = FD->DEVI_GETLOCEND(); PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(clang::SourceRange(SL, SLE)).c_str()); PushToLua.push_back(R.getRewrittenText(clang::SourceRange(SL, SLE))); } @@ -730,7 +730,7 @@ class LiveListVars : public MatchFinder::MatchCallback { if (MR.Nodes.getNodeAs("livelistvars") != nullptr) { const clang::VarDecl* VD = MR.Nodes.getNodeAs("livelistvars"); - SourceLocation SL = VD->getLocStart(); + SourceLocation SL = VD->DEVI_GETLOCSTART(); CheckSLValidity(SL); SL = Devi::SourceLocationHasMacro(SL, R); @@ -738,8 +738,8 @@ class LiveListVars : public MatchFinder::MatchCallback { return void(); } - PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(SourceRange(VD->getLocStart(), VD->getLocEnd())).c_str()); - PushToLua.push_back(R.getRewrittenText(SourceRange(VD->getLocStart(), VD->getLocEnd()))); + PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(SourceRange(VD->DEVI_GETLOCSTART(), VD->DEVI_GETLOCEND())).c_str()); + PushToLua.push_back(R.getRewrittenText(SourceRange(VD->DEVI_GETLOCSTART(), VD->DEVI_GETLOCEND()))); } } @@ -755,8 +755,8 @@ class LiveListRecords : public MatchFinder::MatchCallback { if (MR.Nodes.getNodeAs("livelistvars") != nullptr) { const clang::RecordDecl* RD = MR.Nodes.getNodeAs("livelistvars"); - PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(SourceRange(RD->getLocStart(), RD->getLocEnd())).c_str()); - PushToLua.push_back(R.getRewrittenText(SourceRange(RD->getLocStart(), RD->getLocEnd()))); + PRINT_WITH_COLOR_LB(CYAN, R.getRewrittenText(SourceRange(RD->DEVI_GETLOCSTART(), RD->DEVI_GETLOCEND())).c_str()); + PushToLua.push_back(R.getRewrittenText(SourceRange(RD->DEVI_GETLOCSTART(), RD->DEVI_GETLOCEND()))); } } -- cgit v1.2.3