Lex: make `clang::Preprocessor::macros` work on MSVC
The order of argument construction is reversed on MS ABI on Windows. When `macros` was invoked, the `end` call is made prior to `begin`. In such a case, the DenseMap (`ModuleMap`) is populated after the `end` iterator is constructed. This reversal results in the invalidation of the end iterator, resulting in a failure at runtime (assertion failure in `DenseMap<T>::operator!=` that "handles are not in sync!"). Ensure that the end iterator is constructed after the begin iterator. This fixes the use of `macros(bool)`, which symptomized as an assertion failure in the swift compiler in the clang importer. llvm-svn: 329866
Loading
Please sign in to comment