The intent for an explicit module build is that the diagnostics produced within
the module are those that were configured when the module was built, not those
that are enabled within a user of the module. This includes diagnostics that
don't actually show up until the module is used (for instance, diagnostics
produced during template instantiation and weird cases like -Wpadded).
We serialized and restored the diagnostic state for individual warning groups,
but previously did not track the state for flags like -Werror and -Weverything,
which are implemented as separate bits rather than as part of the diagnostics
mapping information.
llvm-svn: 301992
This allows users to query the target triple and target pointer width, which
would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and
other related bugs in an elegant way (without having to manually parse the
target triple in the command line arguments).
Differential Revision: https://reviews.llvm.org/D32389
llvm-svn: 301648
This reverts commit r301449. It breaks the build with:
MacroPPCallbacks.h:114:50: error: non-virtual member function marked 'override' hides virtual member function
llvm-svn: 301469
Summary:
The PPCallbacks::MacroUndefined callback is currently insufficient for clients that need to track the MacroDirectives.
This patch adds an additional argument to PPCallbacks::MacroUndefined that is the undef MacroDirective.
Reviewers: bruno, manmanren
Reviewed By: bruno
Subscribers: nemanjai, cfe-commits
Differential Revision: https://reviews.llvm.org/D29923
llvm-svn: 301449
Summary: This patch replaces the boolean IncompleteFormat that is used to notify the client if an unrecoverable syntax error occurred by a struct that also contains a line number.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32298
llvm-svn: 300985
This patch fixes most of the python3 incompatabilities
within git-clang-format while keeping the script python2 compatible.
There is still one remaining incompatability that prevents using Python3
which is the `str` vs `byte` type change. I plan to put those fixes
up for review separately.
This patch contains fixes for the following incompatabilities:
1) Use the new style Python3 `print` function. This requires importing
__future__.print_function.
2) Fix incompatability between the Python3 octal prefix and the
octal prefix Git uses.
3) Replace use of dict.iteritems() with dict.viewitems() because iteritems()
has been removed in Python3. viewitems() reviews python 2.7 but that is
also what the script is documented as requiring.
llvm-svn: 300891
Summary: For some reason, the asan bot has recently started reporting this leak even though it existed for ages.
Reviewers: pcc
Reviewed By: pcc
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D32243
llvm-svn: 300755
With the new release of VS, it's required that all plugins migrate to
the new VSIX manifest format. The new format is backwards compatible
with all versions newer that Visual Studio 2012, so this migration
effectively drops support for older versions of the IDE.
It's also required that these new extensions are built with Visual
Studio 2017, so unfortunately it was necessary to migrate the project
and solution. Also removed COM references to EnvDTE and
Microsoft.VisualStudio.TextManager.Interop from the csproj, as they seem
to both be unnecessary and would trigger build warnings because of
changes to GAC.
Patch by Hugo Puhlmann!
Differential Revision: https://reviews.llvm.org/D31740
llvm-svn: 300225
One way to currently test the reproducers is to setup
"FORCE_CLANG_DIAGNOSTICS_CRASH=1" before invoking clang. This simulates
a crash and produces the same contents needed by the reproducers. The
reproducers are specially useful when triaging Modules issues, not only
on crashes, but also for reproducing misleading warnings, errors, etc.
Add a '-gen-reproducer' driver option to clang (or any similar name) and
give users a flag option.
Note that clang already has a -fno-crash-diagnostics, which disables the
crash reproducers. I've decided not to propose "-fcrash-diagnostics"
since it doesn't convey the ideia of reproduction despite a crash.
rdar://problem/24114619
Differential Revision: https://reviews.llvm.org/D27604
llvm-svn: 300109
clang-import-test has until now been only able to report top-level Decls.
This is clearly insufficient; we should be able to look inside structs
and namespaces also. This patch adds new test cases for a variety of
lookups inside existing ASTContexts, and adds the functionality necessar
to make most of these testcases work. (One testcase is known to fail
because of ASTImporter limitations when importing templates; I'll look
into that separately.)
This patch also separates the core functionality out into
ExternalASTMerger, an interface that allows clients like LLDB to make
use of it. clang-import-test now only has the machinery necessary to
set up the tests.
Differential revision: https://reviews.llvm.org/D30435
llvm-svn: 299976
This change adds a feature to the clang-format VS extension that optionally
enables the automatic formatting of documents when saving. Since developers
always need to save their files, this eases the workflow of making sure source
files are properly formatted.
Differential Revision: https://reviews.llvm.org/D29221
llvm-svn: 299543
In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.
llvm-svn: 298392
Summary:
The changes contained in this patch are:
1. Defines a new AST node `CoawaitDependentExpr` for representing co_await expressions while the promise type is still dependent.
2. Correctly detect and transform the 'co_await' operand to `p.await_transform(<expr>)` when possible.
3. Change the initial/final suspend points to build during the initial parse, so they have the correct operator co_await lookup results.
4. Fix transformation of the CoroutineBodyStmt so that it doesn't re-build the final/initial suspends.
@rsmith: This change is a little big, but it's not trivial for me to split it up. Please let me know if you would prefer this submitted as multiple patches.
Reviewers: rsmith, GorNishanov
Reviewed By: rsmith
Subscribers: ABataev, rsmith, mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D26057
llvm-svn: 297093
Second attempt after http://llvm.org/viewvc/llvm-project?rev=296166&view=rev
In the first attempt, Code (the memory buffer backing the input file) was reset
before overwriteChangedFiles() was called, but overwriteChangedFiles() still
reads from it. This time, load the whole input file into memory instead of
using mmap when formatting in-place.
(Since the test is identical to what was in the repo before chapuni's revert,
svn diff doesn't show it – see the above link for the test.)
https://reviews.llvm.org/D30385
llvm-svn: 296408
Parameters have a 'child' relation to their function/method.
Also add an option '-include-locals' to 'c-index-test core' to enable indexing of function-local symbols.
Original patch from Nathan Hawes with some changes by me.
https://reviews.llvm.org/D30304
llvm-svn: 296282
Removed ndrange_t as Clang builtin type and added
as a struct type in the OpenCL header.
Use type name to do the Sema checking in enqueue_kernel
and modify IR generation accordingly.
Review: D28058
Patch by Dmitry Borisenkov!
llvm-svn: 295311