From 5a0b18dc3d1db4efe427968ede383f22adcbbb82 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Thu, 13 Apr 2017 13:45:01 +0430 Subject: added a newerv method for checking Macro expansions --- mutator_aux.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mutator_aux.cpp b/mutator_aux.cpp index 9153004..9eac0dd 100644 --- a/mutator_aux.cpp +++ b/mutator_aux.cpp @@ -36,7 +36,7 @@ using namespace clang; namespace Devi { /*a simple function that checks the sourcelocations for a macro expansion. returns the sourcelocation without macro expansion address.*/ -SourceLocation SourceLocationHasMacro (SourceLocation SL, Rewriter &Rewrite, std::string Kind) +SourceLocation SourceLocationHasMacro [[deprecated("doesnt work")]] (SourceLocation SL, Rewriter &Rewrite, std::string Kind) { /*does the sourcelocation include a macro expansion?*/ if ( SL.isMacroID() ) @@ -65,6 +65,18 @@ SourceLocation SourceLocationHasMacro (SourceLocation SL, Rewriter &Rewrite, std return (SL); } + +SourceLocation SourceLocationHasMacro(SourceLocation __sl, Rewriter &__rewrite) +{ + if (__sl.isMacroID()) + { + return __rewrite.getSourceMgr().getSpellingLoc(__sl); + } + else + { + return __sl; + } +} /*********************************************************************************************************************/ /*********************************************************************************************************************/ /*********************************************************************************************************************/ -- cgit v1.2.3