aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-04-13 09:15:01 +0000
committerbloodstalker <thabogre@gmail.com>2017-04-13 09:15:01 +0000
commit5a0b18dc3d1db4efe427968ede383f22adcbbb82 (patch)
tree2b4583b13b73612de3c96c8d089bbf41558737d3
parentadding some infrastructure.wip. (diff)
downloadmutator-5a0b18dc3d1db4efe427968ede383f22adcbbb82.tar.gz
mutator-5a0b18dc3d1db4efe427968ede383f22adcbbb82.zip
added a newerv method for checking Macro expansions
-rw-r--r--mutator_aux.cpp14
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;
+ }
+}
/*********************************************************************************************************************/
/*********************************************************************************************************************/
/*********************************************************************************************************************/