diff options
author | bloodstalker <thabogre@gmail.com> | 2017-04-13 09:15:01 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-04-13 09:15:01 +0000 |
commit | 5a0b18dc3d1db4efe427968ede383f22adcbbb82 (patch) | |
tree | 2b4583b13b73612de3c96c8d089bbf41558737d3 | |
parent | adding some infrastructure.wip. (diff) | |
download | mutator-5a0b18dc3d1db4efe427968ede383f22adcbbb82.tar.gz mutator-5a0b18dc3d1db4efe427968ede383f22adcbbb82.zip |
added a newerv method for checking Macro expansions
-rw-r--r-- | mutator_aux.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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; + } +} /*********************************************************************************************************************/ /*********************************************************************************************************************/ /*********************************************************************************************************************/ |