summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix warnings introduced by r307434.Richard Smith2017-07-082-1/+5
| | | | llvm-svn: 307455
* [clang-rename] Just return instead of calling exit(3) from main.Benjamin Kramer2017-06-301-10/+9
| | | | llvm-svn: 306873
* Attempt to fix the linkage error caused by r306840 on the mingw-RA-on-linux botAlex Lorenz2017-06-301-0/+5
| | | | llvm-svn: 306844
* [refactor] Move clang-rename into the clang repositoryAlex Lorenz2017-06-305-0/+401
| | | | | | | | | | | | The core engine of clang-rename will be used for local and global renames in the new refactoring engine, as mentioned in http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html. The clang-rename tool is still supported but might get deprecated in the future. Differential Revision: https://reviews.llvm.org/D34696 llvm-svn: 306840
* [Driver] Actually report errors during parsing instead of stopping when ↵Benjamin Kramer2017-06-301-1/+1
| | | | | | | | | | | | | | there's an error somewhere. This is a more principled version of r303756. That change was both very brittle about the state of the Diags object going into the driver and also broke tooling in funny ways. In particular it prevented tools from capturing diagnostics properly and made the compilation database logic fail to provide arguments to the tool, falling back to scanning directories for JSON files. llvm-svn: 306822
* Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith2017-06-292-2/+3
| | | | | | | | | not the ASTContext state. We use this when running a preprocessor-only action on an AST file in order to avoid paying the runtime cost of loading the extra information. llvm-svn: 306760
* [libclang] Support for querying the exception specification type through ↵Jonathan Coe2017-06-273-0/+51
| | | | | | | | | | | | | | | | | | | libclang Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston llvm-svn: 306483
* Revert "Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc""Christof Douma2017-06-271-18/+12
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r305688 meaning it reintroduces r305684. To repeat: [NFC] Refactor DiagnosticRenderer to use FullSourceLoc Move the DiagnosticRenderer and its dependents to using FullSourceLocs instead of a SourceLocation and SourceManager pointer. The changeset is rather large but entirely mechanical. This is step one to allow DiagnosticRenderer to take either llvm::SMLocs or clang::SourceLocations. This breaks clang-tidy and clng-query which will be fixed in a commit soon after. Patch by Sanne Wouda Differential Revision: https://reviews.llvm.org/D31709 llvm-svn: 306384
* Revert "Revert r305164/5/7."Saleem Abdulrasool2017-06-231-3/+16
| | | | | | | | | | | | | | | | | | | | | | | Restore the `-gz` option to the driver with some minor tweaks to handle the additional case for `-Wa,--compress-debug-sections`. This intends to make the compression of the debug information controllable from the driver. The following is the behaviour: -gz enable compression (ambiguous for format, will default to zlib-gnu) -gz=none disable compression -gz=zlib-gnu enable compression (deprecated GNU style zlib compression) -gz=zlib enable compression (zlib based compression) Although -Wa,-compress-debug-sections works, it should be discouraged when using the driver to invoke the assembler. However, we permit the assembler to accept the GNU as style argument --compress-debug-sections to maintain compatibility. Note, -gz/-gz= does *NOT* imply -g. That is, you need to additionally specific -g for debug information to be generated. llvm-svn: 306115
* Preserve CXX method overrides in ASTImporterLang Hames2017-06-201-9/+23
| | | | | | | | | | | | | | Summary: The ASTImporter should import CXX method overrides from the source context when it imports a method decl. Reviewers: spyffe, rsmith, doug.gregor Reviewed By: spyffe Differential Revision: https://reviews.llvm.org/D34371 llvm-svn: 305850
* Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc"Christof Douma2017-06-191-12/+18
| | | | | | | This reverts commit 305684. This patch breaks extra/tools/clang-tidy llvm-svn: 305688
* [NFC] Refactor DiagnosticRenderer to use FullSourceLocChristof Douma2017-06-191-18/+12
| | | | | | | | | | | | | | | | Move the DiagnosticRenderer and its dependents to using FullSourceLocs instead of a SourceLocation and SourceManager pointer. The changeset is rather large but entirely mechanical. This is step one to allow DiagnosticRenderer to take either llvm::SMLocs or clang::SourceLocations. Patch by Sanne Wouda Review: https://reviews.llvm.org/D31709 Change-Id: If351a112cdf6718e2d3ef6721b8da9c6376b32dd llvm-svn: 305684
* clang-format: Add capability to format the diff on save in vim.Daniel Jasper2017-06-191-2/+13
| | | | | | | | | | | With this patch, one can configure a BufWrite hook that will make the clang-format integration compute a diff of the current buffer with the file that's on disk and format all changed lines. This should create a zero-overhead auto-format solution that doesn't require the file to already be clang-format clean to avoid spurious diffs. Review: https://reviews.llvm.org/D32429 llvm-svn: 305665
* [Driver] Do a PATH lookup if needed when using -no-canonical-prefixesPetr Hosek2017-06-161-2/+9
| | | | | | | | | | | | | When -no-canonical-prefixes option is used and argv0 contains only a program name, we need to do a PATH lookup to get an executable path, otherwise the return value won't be a valid path and any subsequent uses of it (e.g. when invoking -cc1) will fail with an error. This patch fixes PR9576. Differential Revision: https://reviews.llvm.org/D34290 llvm-svn: 305600
* [clang-format] Allow git-clang-format to handle empty extensions.Eric Fiselier2017-06-151-0/+2
| | | | | | | | | | | Most of libc++'s header files don't use extension. This prevents using git-clang-format on them, which is frustrating. This patch allows empty extensions to be passed using either the --extensions option, or the clangformat.extensions git-config value. llvm-svn: 305437
* Recommit r305117: [libclang] Merge multiple availability clauses whenAlex Lorenz2017-06-121-38/+82
| | | | | | | | | | getting the platform's availability Patch by Ronald Wampler! Differential Revision: https://reviews.llvm.org/D33478 llvm-svn: 305221
* Revert r305164/5/7.Daniel Jasper2017-06-121-16/+3
| | | | | | | | | | | | | | cc1as does not currently access the "--" version of this flag. At the very least this needs to be fixed and proper test cases need to be added. Simple reproducer: clang -Wa,--compress-debug-sections /tmp/test.cc Result: error: unknown argument: '--compress-debug-sections' llvm-svn: 305182
* Driver: add support for `-gz` and `-gz=`Saleem Abdulrasool2017-06-111-3/+16
| | | | | | | | | | | | | | | | | These options control the behaviour of the compression of debug info sections on ELF targets. Our behaviour slightly diverges from the behaviour of GCC. `-gz` maps to the `-compress-debug-sections` rather than `-compress-debug-sections=zlib` or `-compress-debug-sections=zlib-gnu`. This small divergence allows us to be compatible across versions of binutils (=zlib support was introduced in 2.26, while earlier versions only support =zlib-gnu). This also allows users to not have to worry about the version of the assembler they may be using if they are not using the IAS. Previously, users would have had to go through the internal option `-compress-debug-sectionss` and pass that through to the assembler, which is no longer needed. llvm-svn: 305165
* Revert r305117Alex Lorenz2017-06-091-82/+38
| | | | | | It caused `Index/availability.c` test failure on Linux llvm-svn: 305122
* [libclang] Merge multiple availability clauses when getting the platform'sAlex Lorenz2017-06-091-38/+82
| | | | | | | | | | availability Patch by Ronald Wampler! Differential Revision: https://reviews.llvm.org/D33478 llvm-svn: 305117
* Remove 'Filename' parameter from BeginSourceFileAction.Richard Smith2017-06-091-2/+1
| | | | | | | | | No-one was using this, and it's not meaningful in general -- FrontendActions can be run on inputs that don't have a corresponding source file. The current frontend input can be obtained by asking the FrontendAction if any future action actually needs it. llvm-svn: 305045
* [libclang] Introduce a new parsing option ↵Argyrios Kyrtzidis2017-06-092-2/+34
| | | | | | | | 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only. This is useful for parsing a single file, as a fast/inaccurate 'mode' that can still provide declarations from the file, like the classes and their methods. llvm-svn: 305044
* Represent debug information compression type fullySaleem Abdulrasool2017-06-091-4/+6
| | | | | | | | | | | This is tied with the LLVM side of the change to expose the debug information compression types to clang. We now track the compression type as an enumeration rather than a boolean. We still use the same value (GNU) that we did previously. This is in preparation to support passing down the compression type and switch it based on the command line. llvm-svn: 305039
* [libclang] Expose typedef and address space functionsSven van Haastregt2017-06-082-0/+24
| | | | | | | | | | | | Expose the following functions: - clang_getTypedefName - clang_getAddressSpace Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33598 llvm-svn: 304978
* Print registered targets in clang's version informationDimitry Andric2017-06-062-4/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Other llvm tools display their registered targets when showing version information, but for some reason clang has never done this. To support this, D33899 adds the llvm parts, which make it possible to print version information to arbitrary raw_ostreams. This change adds a call to printRegisteredTargetsForVersion in clang's PrintVersion, and adds a raw_ostream parameter to two other PrintVersion functions. Reviewers: beanz, chandlerc, dberris, mehdi_amini, zturner Reviewed By: mehdi_amini Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33900 llvm-svn: 304836
* [libclang] Allow to suspend a translation unit.Erik Verbruggen2017-05-303-0/+17
| | | | | | | | | | | | | | | | | A suspended translation unit uses significantly less memory but on the other side does not support any other calls than clang_reparseTranslationUnit to resume it or clang_disposeTranslationUnit to dispose it completely. This helps IDEs to reduce the memory footprint. The data that is freed by a call to clang_suspendTranslationUnit will be re-generated on the next (re)parse anyway. Used with a preamble, this allows pretty fast resumption of the translation unit for further use (compared to disposal of the translation unit and a parse from scratch). Patch by Nikolai Kosjar! llvm-svn: 304212
* [scan-build] Patch to scan-build tool to support "--target=<value>" flagPetr Hosek2017-05-261-1/+2
| | | | | | | | | | | | | | | | | The scan-build script provided by clang can be used to detect defects in code in the compile time. However, we discovered that the "--target=<value>" flag in clang is not properly handled by this script, which results in failures when analyzing projects that have used this flag in their makefile. This single line of change allows scan-build script to properly handle the "--target=<value>" flag. Patch by Haowei Wu Differential Revision: https://reviews.llvm.org/D33263 llvm-svn: 304025
* Make git-clang-format python 3 compatibleEric Fiselier2017-05-251-4/+30
| | | | | | | | | | | | | | Summary: This patch attempts to make `git-clang-format` both python2 and python3 compatible. Currently it only works in python2. Reviewers: modocache, compnerd, djasper, jbcoe, srhines, ddunbar Reviewed By: jbcoe Subscribers: kimgr, mgorny, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D30773 llvm-svn: 303871
* Driver must return non-zero code on errors in command lineSerge Pavlov2017-05-241-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is recommit of r302775, reverted in r302777 due to a fail in clang-tidy. Original mesage is below. Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang test set. File test/Driver/gfortran.f90 added in r118203 checks forwarding gfortran flags to GCC. Now driver reports error on this file, because the option -working-directory implemented in clang differs from the option with the same name implemented in gfortran, in clang the option requires argument, in gfortran does not. In the file test/Driver/arm-darwin-builtin.c clang is called with options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed in r191435 and now clang reports error on this test. File arm-default-build-attributes.s uses option -verify, which is not supported by driver, it is cc1 option. Similarly, the file split-debug.h uses options -fmodules-embed-all-files and -fmodule-format=obj, which are not supported by driver. Other revealed errors are mainly mistypes. Differential Revision: https://reviews.llvm.org/D33013 llvm-svn: 303756
* [Tooling][libclang] Remove unused CompilationDatabase::MappedSourcesKrasimir Georgiev2017-05-231-22/+9
| | | | | | | | | | | | | | | | Summary: This field is never assigned to and it's only ever read from libclang. This patch removes it and adapts libclang to return constants. Reviewers: klimek, bkramer Reviewed By: klimek Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32351 llvm-svn: 303635
* [libclang] [OpenCL] Expose more OpenCL CIndex typesSven van Haastregt2017-05-231-0/+16
| | | | | | | | | | | | | | Expose pipe, sampler_t, clk_event_t, queue_t, reserve_id_t, and all image types. Update the opencl-types.cl test RUN line such that we can test the OpenCL 2.0 types. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33197 llvm-svn: 303626
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-201-10/+1
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
* [ASTImporter] Improve handling of incomplete typesSean Callanan2017-05-131-2/+44
| | | | | | | | | | | | | | | | | | | | | ASTImporter has some bugs when it's importing types that themselves come from an ExternalASTSource. This is exposed particularly in the behavior when comparing complete TagDecls with forward declarations. This patch does several things: - Adds a test case making sure that conflicting forward-declarations are resolved correctly; - Extends the clang-import-test harness to test two-level importing, so that we make sure we complete types when necessary; and - Fixes a few bugs I found this way. Failure to complete types was one; however, I also discovered that complete RecordDecls aren't properly added to the redecls chain for existing forward declarations. llvm-svn: 302975
* Reverted r302775Serge Pavlov2017-05-111-28/+27
| | | | llvm-svn: 302777
* Driver must return non-zero code on errors in command lineSerge Pavlov2017-05-111-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang test set. File test/Driver/gfortran.f90 added in r118203 checks forwarding gfortran flags to GCC. Now driver reports error on this file, because the option -working-directory implemented in clang differs from the option with the same name implemented in gfortran, in clang the option requires argument, in gfortran does not. In the file test/Driver/arm-darwin-builtin.c clang is called with options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed in r191435 and now clang reports error on this test. File arm-default-build-attributes.s uses option -verify, which is not supported by driver, it is cc1 option. Similarly, the file split-debug.h uses options -fmodules-embed-all-files and -fmodule-format=obj, which are not supported by driver. Other revealed errors are mainly mistypes. Differential Revision: https://reviews.llvm.org/D33013 llvm-svn: 302775
* [libclang] Introduce clang_Cursor_isExternalSymbol that provides info about ↵Argyrios Kyrtzidis2017-05-103-0/+43
| | | | | | decls marked with external_source_symbol attribute llvm-svn: 302677
* [modules] Round-trip -Werror flag through explicit module build.Richard Smith2017-05-031-1/+1
| | | | | | | | | | | | | | | 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
* [libclang] Revert rL301328 and add tests for the regressions introduced.Emilio Cobos Alvarez2017-05-021-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D32566 llvm-svn: 301902
* [libclang] Expose some target information via the C API.Emilio Cobos Alvarez2017-04-284-2/+103
| | | | | | | | | | | 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
* libclang: remove unused variable.Tim Northover2017-04-271-2/+1
| | | | llvm-svn: 301585
* [libclang] Enhance clang_Cursor_isDynamicCall and ↵Argyrios Kyrtzidis2017-04-272-5/+33
| | | | | | | | clang_Cursor_getReceiverType to handle ObjC property references Also enhance clang_Cursor_getReceiverType to handle C++ method calls. llvm-svn: 301568
* [libclang] Pass in the -fallow-editor-placeholders optionAlex Lorenz2017-04-271-1/+4
| | | | | | | | This will suppress any live diagnostics caused by editor placeholders in Xcode. rdar://31833579 llvm-svn: 301542
* Revert "Revert "PPCallbacks::MacroUndefined, change signature and add test.""Vedant Kumar2017-04-261-1/+2
| | | | | | | This reverts commit r301469. It isn't needed with r301470, which fixes the API break introduced in the original commit. llvm-svn: 301472
* Revert "PPCallbacks::MacroUndefined, change signature and add test."Vedant Kumar2017-04-261-2/+1
| | | | | | | | 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
* PPCallbacks::MacroUndefined, change signature and add test.Frederich Munch2017-04-261-1/+2
| | | | | | | | | | | | | | | | 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
* [libclang] Check for a record declaration before a template specializationAlex Lorenz2017-04-251-3/+3
| | | | | | | | | | Fixes PR32539. Patch by Emilio Cobos Álvarez! Differential Revision: https://reviews.llvm.org/D32348 llvm-svn: 301328
* [index] If the 'external_source_symbol' attribute indicates 'Swift' as the ↵Argyrios Kyrtzidis2017-04-242-0/+2
| | | | | | language then report it accordingly llvm-svn: 301183
* [clang-format] Replace IncompleteFormat by a struct with LineKrasimir Georgiev2017-04-211-5/+12
| | | | | | | | | | | | | | 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
* Fix Python 2 vs 3 incompatability with dict.items() vs iteritems()Eric Fiselier2017-04-201-1/+6
| | | | llvm-svn: 300895
* Begin making git-clang-format python3 compatible.Eric Fiselier2017-04-201-21/+25
| | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud