summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
authorDaniel Marjamaki <daniel.marjamaki@evidente.se>2015-05-29 09:15:24 +0000
committerDaniel Marjamaki <daniel.marjamaki@evidente.se>2015-05-29 09:15:24 +0000
commite4770da766d675917b315145e1c54165ea73f9fb (patch)
tree3abb89eccc1c28bb371fbe433b1f9ba9bcb52cec /clang/lib/Lex
parent5f75f5b31550dda7cae9ed18e23d18952622c980 (diff)
downloadbcm5719-llvm-e4770da766d675917b315145e1c54165ea73f9fb.tar.gz
bcm5719-llvm-e4770da766d675917b315145e1c54165ea73f9fb.zip
Refactor MacroInfo so macro arguments can be iterated with range-based for loops.
No functional change intended. Patch by Sebastian Edman! llvm-svn: 238547
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 9046ad51c14..03784e20450 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -362,12 +362,8 @@ static bool isTrivialSingleTokenExpansion(const MacroInfo *MI,
// If this is a function-like macro invocation, it's safe to trivially expand
// as long as the identifier is not a macro argument.
- for (MacroInfo::arg_iterator I = MI->arg_begin(), E = MI->arg_end();
- I != E; ++I)
- if (*I == II)
- return false; // Identifier is a macro argument.
+ return std::find(MI->arg_begin(), MI->arg_end(), II) == MI->arg_end();
- return true;
}
OpenPOWER on IntegriCloud