summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] Implement __make_integer_seqDavid Majnemer2015-11-041-0/+1
| | | | | | | | | | | | | | | | | | This new builtin template allows for incredibly fast instantiations of templates like std::integer_sequence. Performance numbers follow: My work station has 64 GB of ram + 20 Xeon Cores at 2.8 GHz. __make_integer_seq<std::integer_sequence, int, 90000> takes 0.25 seconds. std::make_integer_sequence<int, 90000> takes unbound time, it is still running. Clang is consuming gigabytes of memory. Differential Revision: http://reviews.llvm.org/D13786 llvm-svn: 252036
* [analyzer] Preserve the order checkers were enabled/disabled.Anton Yartsev2015-10-281-4/+19
| | | | | | | In addition to r251524: preserve the order the checkers were enabled/disabled to be deterministic. Additionally return the number of arguments read by 'ProcessArgs' - for debug purpose. llvm-svn: 251552
* [analyzer] Make inclusion/exclusion of checkers less ambiguous.Anton Yartsev2015-10-281-6/+10
| | | | | | | | A checker may be enabled/disabled multiple times via -enable-checker and -disable-checker scan-build arguments. Currently the conflicting and repetitive arguments are passed to the analyzer as is. With this patch only the last enable/disable of a particular checker is accepted and passed to the analyzer. This change is mostly done for the upcoming 'config for scan-build' patch when multiple inclusions/exclusions of a checker are expected to be more common. llvm-svn: 251524
* Index: expose is_mutable_fieldSaleem Abdulrasool2015-10-273-0/+13
| | | | | | | | Expose isMutable via libClang and python bindings. Patch by Jonathan B Coe! llvm-svn: 251410
* [coroutines] Creation of promise object, lookup of operator co_await, buildingRichard Smith2015-10-271-0/+4
| | | | | | of await_* calls, and AST representation for same. llvm-svn: 251387
* [analyzer] ccc-analyzer: Fix -isystem value passing.Devin Coughlin2015-10-261-1/+1
| | | | | | | | | | | | | | | The regex for -isystem matching is broken. -[D,I,Usystem] matches "-D", "-,", "-I", "-U", "-s" "-y", etc. Besides that, "-isystem /foo" gets interpreted as "-i" with a non-empty value "system" and thus the next "/foo" argument is not read. This patch corrects the regex. This fixes PR13237 <https://llvm.org/bugs/show_bug.cgi?id=13237>. A patch by Peter Wu! Differential Revision: http://reviews.llvm.org/D13800 llvm-svn: 251312
* [analyzer] scan-build: Teach ccc-analyzer about -Xclang.Devin Coughlin2015-10-251-0/+9
| | | | | | | | | Update ccc-analyzer to forward both -Xclang and its following argument to the the compiler driver. Previously we were dropping -Xclang and forwarding the argument on its own if it matched other forwarding criteria. This caused the argument to be interpreted as a driver rather than a frontend option. llvm-svn: 251218
* [CMake] Make clang/tools subdirectories controlled via optionsChris Bieneman2015-10-201-10/+12
| | | | | | Setting CLANG_TOOL_*_BUILD=Off on the CMake command line will disable inclusion of a clang/tools subdirectory. llvm-svn: 250840
* Roll-back r250822.Angel Garcia Gomez2015-10-205-9/+11
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-205-11/+9
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Added new options to ClangFormat VSIX package.Marek Kurdej2015-10-192-7/+142
| | | | | | | | | | | | | | | | | | | Summary: Added new options to ClangFormat VSIX package: * fallback-style * assume-filename * sort-includes. Changed version to 1.1 (otherwise one couldn't update). Fixed clang-format escaping of XML reserved characters. Reviewers: hans, aaron.ballman, klimek, rnk, zturner Subscribers: djasper, cfe-commits Differential Revision: http://reviews.llvm.org/D13549 llvm-svn: 250694
* Update list of languages advertised in OVERVIEW: A tool to format ↵Nico Weber2015-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C/C++/Java/JavaScript/Objective-C/Protobuf code. If no arguments are specified, it formats the code from standard input and writes the result to the standard output. If <file>s are given, it reformats the files. If -i is specified together with <file>s, the files are edited in-place. Otherwise, the result is written to the standard output. USAGE: clang-format [options] [<file> ...] OPTIONS: -assume-filename=<string> - When reading from stdin, clang-format assumes this filename to look for a style config file (with -style=file) and to determine the language. -cursor=<uint> - The position of the cursor when invoking clang-format from an editor integration -dump-config - Dump configuration options to stdout and exit. Can be used with -style option. -fallback-style=<string> - The name of the predefined style used as a fallback in case clang-format is invoked with -style=file, but can not find the .clang-format file to use. Use -fallback-style=none to skip formatting. -help - Display available options (-help-hidden for more) -i - Inplace edit <file>s, if specified. -length=<uint> - Format a range of this length (in bytes). Multiple ranges can be formatted by specifying several -offset and -length pairs. When only a single -offset is specified without -length, clang-format will format up to the end of the file. Can only be used with one input file. -lines=<string> - <start line>:<end line> - format a range of lines (both 1-based). Multiple ranges can be formatted by specifying several -lines arguments. Can't be used with -offset and -length. Can only be used with one input file. -offset=<uint> - Format a range starting at this byte offset. Multiple ranges can be formatted by specifying several -offset and -length pairs. Can only be used with one input file. -output-replacements-xml - Output replacements as XML. -sort-includes - Sort touched include lines -style=<string> - Coding style, currently supports: LLVM, Google, Chromium, Mozilla, WebKit. Use -style=file to load style configuration from .clang-format file located in one of the parent directories of the source file (or current directory for stdin). Use -style="{key: value, ...}" to set specific parameters, e.g.: -style="{BasedOnStyle: llvm, IndentWidth: 8}" -version - Display the version of this program output. llvm-svn: 250671
* clang-format: Basic escaping when outputting XML.Daniel Jasper2015-10-151-1/+9
| | | | llvm-svn: 250440
* [CMake] Add LLVM_VERSION_PATCH to the -current_version flag for libclang.Chris Bieneman2015-10-141-1/+1
| | | | | | This is to match autoconf where LLVM_SUBMIT_SUBVERSION is usually set to ${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}. llvm-svn: 250278
* [CMake]Getting rid of references to LLVM_SUBMIT_VERSION and ↵Chris Bieneman2015-10-132-9/+3
| | | | | | | | LLVM_SUBMIT_SUBVERSION in favor of LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR. LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION are commonly used variable names in the autoconf build system. They seem to have leeched into clang's CMake in a few places, and should just be replaced by the LLVM_VERSION_* variables where appropriate. llvm-svn: 250246
* Always pass a -dwarf-version argument to integrated as.Douglas Katzman2015-10-131-1/+1
| | | | | | | | This removes the default of 3 hidden in the assembler previously. Fixes breakage caused by r249655, reported by vsukharev. llvm-svn: 250173
* [OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.Alexey Bataev2015-10-081-0/+3
| | | | | | OpenMP 4.1 adds support for array sections/subscripts in 'reduction' clause. Patch adds codegen for this feature. llvm-svn: 249672
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-8/+3
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Fix a -Wdeclaration-after-statement warning.Craig Topper2015-10-081-1/+1
| | | | llvm-svn: 249652
* Make clang_Cursor_getMangling not mangle if the declaration isn't mangledEhsan Akhgari2015-10-082-1/+7
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern C). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249639
* clang-format: Add include sorting capabilities to sublime, emacs andDaniel Jasper2015-10-073-1/+6
| | | | | | clang-format-diff.py. llvm-svn: 249567
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-3/+4
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Revert r249437Ehsan Akhgari2015-10-062-7/+1
| | | | llvm-svn: 249440
* Make clang_Cursor_getMangling don't mangle if the declaration isn't mangledEhsan Akhgari2015-10-062-1/+7
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern "C"). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249437
* [VFS] Transition clang-format to use an in-memory FS.Benjamin Kramer2015-10-061-9/+15
| | | | | | | | | | | Apart from being cleaner this also means that clang-format no longer has access to the host file system. This isn't necessary because clang-format never reads includes :) Includes minor tweaks and bugfixes found in the VFS implementation while running clang-format tests. llvm-svn: 249385
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-041-1/+1
| | | | llvm-svn: 249259
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-1/+1
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* [libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return ↵Kostya Serebryany2015-10-022-2/+4
| | | | | | int instead of void. (following llvm r249214) llvm-svn: 249215
* clang-format: Add clangRewrite dependency to fix cmake build.Daniel Jasper2015-09-301-0/+1
| | | | llvm-svn: 248929
* [OpenCL 2.0] Enable program scope variables, Section 6.5.1.Anastasia Stulova2015-09-301-2/+0
| | | | | | | | | | | | | | | | | | - Remove virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static local variables now and prevents diagnosing static local address space variables correctly. - Allow static local and global variables (OpenCL2.0 s6.8 and s6.5.1). - Improve diagnostics of allowed ASes for variables in different scopes: (i) Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1); (ii) Non-kernel function variables can't be declared in local or constant ASes (OpenCL1.1 s6.5.2 and s6.5.3). http://reviews.llvm.org/D13105 llvm-svn: 248906
* clang-format: Use Rewriter again to write the output files.Daniel Jasper2015-09-301-18/+18
| | | | | | | | This has two advantages: 1. Atomic writes. 2. Proper handling of line endings (hopefully solving llvm.org/PR24999 llvm-svn: 248904
* Fix Clang-tidy modernize-use-nullptr warnings in headers and generated ↵Hans Wennborg2015-09-291-8/+2
| | | | | | | | | | files; other minor cleanups. By Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13187 llvm-svn: 248828
* clang-format: Extend #include sorting functionalityDaniel Jasper2015-09-291-5/+5
| | | | | | | | | Recognize the main module header as well as different #include categories. This should now mimic the behavior of llvm/utils/sort_includes.py as well as clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp very closely. llvm-svn: 248782
* [OPENMP 4.1] Add 'simd' clause for 'ordered' directive.Alexey Bataev2015-09-281-0/+2
| | | | | | | | | | | Parsing and sema analysis for 'simd' clause in 'ordered' directive. Description If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered regions in the order of the loop iterations. Restrictions An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region llvm-svn: 248696
* Fix bug on reporting availability of deleted methods in libclang.Manuel Klimek2015-09-251-1/+1
| | | | | | Patch by Sergey Kalinichev. llvm-svn: 248596
* The Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has someEric Christopher2015-09-251-93/+16
| | | | | | | | | | | | | | | | | | | | | | | logic to select an alternate target based on the executable it was called as. For instance, if you symlink i686-linux-android-gcc to clang and invoke it, the driver will act as though it were called with another argument ("-target i686-linux-android"). This leads to visible effects even in syntax-only compilations (like the ANDROID preprocessor symbol being defined). This behavior is not replicated for tool invocations--for instance, clang::createInvocationFromCommandLine will not choose an alternate target based on ArgList[0]. This means that configurations stored in compilation databases aren't accurately replayed. This patch separates the logic for selecting a mode flag and target from the executable name into a new member function on ToolChain. It should have no functional effects (but will allow other code to reuse the target/mode selection logic). Patch by Luke Zarko! llvm-svn: 248592
* [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.Alexey Bataev2015-09-251-0/+2
| | | | | | | | OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. llvm-svn: 248569
* clang-format: Add initial #include sorting capabilities.Daniel Jasper2015-09-233-33/+60
| | | | | | | | | To implement this nicely, add a function that merges two sets of replacements that are meant to be done in sequence. This functionality will also be useful for other applications, e.g. formatting the result of clang-tidy fixes. llvm-svn: 248367
* Add msbuild-bin/cl to CLANG_LINKS_TO_CREATEHans Wennborg2015-09-211-0/+4
| | | | | | This got lost in r248043 which refactored the symlink creation. llvm-svn: 248221
* [CMake] Refactoring and cleaning up clang symlink generation.Chris Bieneman2015-09-182-72/+7
| | | | | | | | Generation of clang symlinks now uses add_clang_symlink macro which uses add_llvm_symlink. Also the list of symlinks to generate is configurable via CLANG_LINKS_TO_CREATE. This re-lands r248015, with fixes for clang symlinks to always be generated as part of the clang and install-clang targets. llvm-svn: 248043
* Revert "[CMake] Refactoring and cleaning up clang symlink generation."Chris Bieneman2015-09-182-7/+72
| | | | | | This reverts commit r248015, because it broke bots. I'll revise and recommit. llvm-svn: 248025
* [CMake] Refactoring and cleaning up clang symlink generation.Chris Bieneman2015-09-182-72/+7
| | | | | | Generation of clang symlinks now uses add_clang_symlink macro which uses add_llvm_symlink. Also the list of symlinks to generate is configurable via CLANG_LINKS_TO_CREATE. llvm-svn: 248015
* Pass the relocation model to LLVM for assembler files.Joerg Sonnenberger2015-09-181-2/+17
| | | | llvm-svn: 247981
* [CMake] Add install-clang target to install just the clang executableChris Bieneman2015-09-171-1/+7
| | | | | | For the llvm-tools we're generating install-${tool} targets which are very useful. We should have one for clang too. llvm-svn: 247912
* [analyzer] Improved behavior if Clang was not found, part IIAnton Yartsev2015-09-161-34/+50
| | | | | | | - scan-build help: display 'Could not query Clang for the list of available checkers.' + the reason why it happened so if clang was not found. - display requested/forced help in case of --use-analyzer=Xcode. llvm-svn: 247828
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-151-6/+5
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
* Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders2015-09-151-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and related. NFC. Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Thanks go to Pavel Labath for fixing LLDB for me. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247692
* Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders2015-09-151-6/+5
| | | | | | LLDB needs to be updated in the same commit. llvm-svn: 247686
* Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders2015-09-151-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+10
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
OpenPOWER on IntegriCloud