Running the tests/cxx/comment_pragmas.cc test on Windows fails saying
that <some_system_header_file> is not diagnosed correctly.
Turns out to be because our custom lexer for GNU @headername comment
directives did not respect Windows line endings, and failed properly
identify the @headername.
Match on both CR and LF when attempting to find end of line.
llvm/llvm-project@777180a makes the llvm::StringRef conversion operator
to std::string explicit.
These changes add a call to the str() method to perform the conversion.
Signed-off-by: Andrea Bocci <andrea.bocci@cern.ch>
Clang r350891 changed the raw lexer so it asserts for IWYU's use
case.
Instead of re-lexing to catch symbols inside defined(), use a
PPCallbacks::Defined override to capture the tokens directly
(presumably, Defined did not exist when the open-coded parser was
added).
This removes a lot of code, including the PPCallbacks for If and Elif,
which are no longer necessary.
No functional change.
NULL/0 -> nullptr
C standard library include -> C++ counterparts
Use override keyword
Range for loops in selected places
Occasional use of auto
Remove unused usings
Remove unnecessary uses of c_str()
Closing comments for anonymous namespaces
This was motivated by an attempt to understand how iwyu_ast_util.cc
depended on iwyu_output, which turned out to be the use of VERRS.
I split the VERRS definition out into a separate iwyu_verrs module.
In the fallout from this I discovered some circular dependencies
that this CL attempts to disentangle.
R=csilvers
DELTA=603 (349 added, 222 deleted, 32 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=3892
test some main()-invariant logic while I'm at it.
DELTA=19 (16 added, 0 deleted, 3 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1409
thought I was saying the location is where the . (or ->) is,
which is what I want, but clang doesn't actually expose that.
So I have go through some hoops to try to figure it out.
We were actually seeing a problem with this when running:
blaze build --host_cpu=k8 --compile_only -k --crosstool_top=//third_party/llvm/crosstool --plugin=//devtools/maintenance/include_what_you_use:run_iwyu //gws/plugins/local/src:enhanced_listing_ad
It has 'msg_->MSG_foo' in it, where MSG_foo is a macro. We
were attributing this use to the file defining MSG_foo, rather
than to us. With this change, we properly attribute it to us.
R=dsturtevant
DELTA=150 (125 added, 6 deleted, 19 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1347
1) Removed the use of <tr1/tuple> -- it wasn't getting us that much,
and cost us in portability. Resolves
http://code.google.com/p/include-what-you-use/issues/detail?id=2
2) Removed unused 'using' statements, renamed some vars to be cleaner,
added 'const' in a few places I could, etc.
3) Refactored some logic into a new function GetCalleeFunctionType().
4) Made a few tests more robust by using better fakes (mostly in
more_tests, so not directly relevant to the opensource code).
5) Added a check to make sure we don't add any new include-mappings
after we were supposed to have finialized the mappings.
All code reviewed by wan and/or dstur...