summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Driver: extract modules flag handling (NFC)Saleem Abdulrasool2017-09-011-157/+162
| | | | | | | Extract a function to render the options related to modules. This reduces the cyclomatic complexity of the `ConstructJob` function. NFC. llvm-svn: 312330
* [refactor] Use a RefactoringResultConsumer instead of tagged refactoringAlex Lorenz2017-09-015-86/+129
| | | | | | | | | | | | | rule classes This commit changes the way that the refactoring results are produced. Instead of using different `RefactoringActionRule` subclasses for each result type, Clang now use a single `RefactoringResultConsumer`. This was suggested by Manuel in https://reviews.llvm.org/D36075. Differential Revision: https://reviews.llvm.org/D37291 llvm-svn: 312316
* Reland r312224 - [ItaniumCXXABI] Always use linkonce_odr linkage for RTTI ↵Martin Storsjo2017-09-013-10/+15
| | | | | | | | | | | | | | | | | data on MinGW This fixes cases where dynamic classes produced RTTI data with external linkage, producing linker errors about duplicate symbols. This touches code close to what was changed in SVN r244266, but this change doesn't break the tests added in that revision. The previous version had missed to update CodeGenCXX/virt-dtor-key.cpp, which had a behaviour change only when running the testsuite on windows. Differential revision: https://reviews.llvm.org/D37327 llvm-svn: 312306
* [OPENMP] Fix the test, NFC.Alexey Bataev2017-08-311-1/+1
| | | | llvm-svn: 312296
* [OPENMP] Fix for PR34398: assert with random access iterator if theAlexey Bataev2017-08-3122-22/+34
| | | | | | | | | | | | step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. llvm-svn: 312292
* Register linkageSpecDecl matcherDave Lee2017-08-311-0/+1
| | | | | | | | | | | | | | | | | Summary: This allows `linkageSpecDecl` to be used from `clang-query`. See also D31869 which similary adds `isStaticStorageClass`. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37346 llvm-svn: 312283
* Add documentation for force_align_arg_pointer function attributeErich Keane2017-08-312-2/+27
| | | | | | | | Patch By: anatol.pomozov (anatol.pomozov@gmail.com) Differential Revision: https://reviews.llvm.org/D37312 llvm-svn: 312281
* [clang-cl] Explicitly set object format to COFF in CL modeOleg Ranevskyy2017-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently object format is taken from the default target triple. For toolchains with a non-COFF default target this may result in an object format inappropriate for pc-windows and lead to compilation issues. For example, the default triple `aarch64-linux-elf` may produce something like `aarch64-pc-windows-msvc19.0.24215-elf` in CL mode. Clang creates `MicrosoftARM64TargetInfo` for such triple with data layout `e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128`. On the other hand, the AArch64 backend in `computeDataLayout` detects a non-COFF target and selects `e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128` as data layout for little endian. Different layouts used by clang and the backend cause an error: ``` error: backend data layout 'e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128' does not match expected target description 'e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128' ``` This can be observed on the clang's Driver/cl-pch.c test with AArch64 as a default target. This patch enforces COFF in CL mode. Reviewers: hans Reviewed By: hans Subscribers: cfe-commits, aemerson, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D37336 llvm-svn: 312275
* Disable clang-format's MemoizationTest as it becomes prohibitive with ↵David Blaikie2017-08-311-0/+5
| | | | | | | | | | | | | | | | EXPENSIVE_CHECKS EXPENSIVE_CHECKS enables libstdc++'s library consistency checks, which includes checking the container passed to std::priority_queue for its well-formedness. This makes the clang-format memoization too expensive, so disable it. (it's a necessary feature of libstdc++'s consistency checks that it ruins the required scalability of C++ standard library features - so these workarounds are to be expected if a test ever tries to test scalability in some way, like this test does) llvm-svn: 312268
* Driver: extract ARCMT flag construction (NFC)Saleem Abdulrasool2017-08-311-69/+73
| | | | | | | | Extract the ARC migration tool flag handling into its own function. This simplifies the flow of the clang frontend command line construction function. NFC. llvm-svn: 312244
* docs: don't say that data flow tracing interface is unstableDmitry Vyukov2017-08-311-2/+0
| | | | | | | | | We are starting to use data flow tracing in kernel. The interface is not subject to change anymore. Reviewed in https://reviews.llvm.org/D37303 llvm-svn: 312232
* Revert r312224: "[ItaniumCXXABI] Always use linkonce_odr linkage for RTTI ↵Martin Storsjo2017-08-312-12/+9
| | | | | | | | | | | | | | data on MinGW" Breaks on buildbot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4548/steps/test-check-all/logs/stdio The test in CodeGenCXX/virt-dtor-key.cpp tests using %itanium_abi_triple; on non-windows platforms, this resolves to the current platform triple (where there was no behaviour change), while on windows, it resolves to a mingw triple (where the behaviour was intentionally changed). llvm-svn: 312229
* [ItaniumCXXABI] Always use linkonce_odr linkage for RTTI data on MinGWMartin Storsjo2017-08-312-9/+12
| | | | | | | | | | | | This fixes cases where dynamic classes produced RTTI data with external linkage, producing linker errors about duplicate symbols. This touches code close to what was changed in SVN r244266, but this change doesn't break the tests added in that revision. Differential revision: https://reviews.llvm.org/D37206 llvm-svn: 312224
* [analyzer] Performance optimizations for the CloneCheckerRaphael Isemann2017-08-314-28/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch aims at optimizing the CloneChecker for larger programs. Before this patch we took around 102 seconds to analyze sqlite3 with a complexity value of 50. After this patch we now take 2.1 seconds to analyze sqlite3. The biggest performance optimization is that we now put the constraint for group size before the constraint for the complexity. The group size constraint is much faster in comparison to the complexity constraint as it only does a simple integer comparison. The complexity constraint on the other hand actually traverses each Stmt and even checks the macro stack, so it is obviously not able to handle larger amounts of incoming clones. The new order filters out all the single-clone groups that the type II constraint generates in a faster way before passing the fewer remaining clones to the complexity constraint. This reduced runtime by around 95%. The other change is that we also delay the verification part of the type II clones back in the chain of constraints. This required to split up the constraint into two parts - a verification and a hash constraint (which is also making it more similar to the original design of the clone detection algorithm). The reasoning for this is the same as before: The verification constraint has to traverse many statements and shouldn't be at the start of the constraint chain. However, as the type II hashing has to be the first step in our algorithm, we have no other choice but split this constrain into two different ones. Now our group size and complexity constrains filter out a chunk of the clones before they reach the slow verification step, which reduces the runtime by around 8%. I also kept the full type II constraint around - that now just calls it's two sub-constraints - in case someone doesn't care about the performance benefits of doing this. Reviewers: NoQ Reviewed By: NoQ Subscribers: klimek, v.g.vassilev, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D34182 llvm-svn: 312222
* [modules] Add ability to specify module name to module file mapping (reapply)Boris Kolpackov2017-08-3116-49/+208
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
* Remove accidental newline.Nico Weber2017-08-311-1/+0
| | | | llvm-svn: 312218
* Fix path regex in test to match on WindowsBoris Kolpackov2017-08-311-1/+1
| | | | llvm-svn: 312217
* Suppress -Wdelete-non-virtual-dtor warnings about classes defined in system ↵Nico Weber2017-08-312-0/+17
| | | | | | | | | | | | | | | | headers. r312167 made it so that we emit Wdelete-non-virtual-dtor from delete statements that are in system headers (e.g. std::unique_ptr). That works great on Linux and macOS, but on Windows there are non-final classes that are defined in system headers that have virtual methods but non-virtual destructors and yet get deleted through a base class pointer (e.g. ATL::CAccessToken::CRevert). So paddle back a bit and don't emit the warning if it's about a class defined in a system header. https://reviews.llvm.org/D37324 llvm-svn: 312216
* Fix the test fix from r312181Hans Wennborg2017-08-303-5/+5
| | | | llvm-svn: 312193
* [cxx_status] Update to describe current status a bit better.Richard Smith2017-08-301-4/+5
| | | | llvm-svn: 312191
* [Sema] Make SpecialMemberDecl a PointerIntPair so we can stash it in a ↵Benjamin Kramer2017-08-301-2/+3
| | | | | | | | | SmallPtrSet. We have enough spare bits in the alignment of CXXRecordDecl. No functionality change intended. llvm-svn: 312186
* [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse2017-08-301-1/+5
| | | | | | | | | | | | | | | | | | Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Only enable on Linux. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 llvm-svn: 312185
* Fix tests for ARM targetsDouglas Yung2017-08-303-3/+3
| | | | | | | | | | Tests fail on ARM targets due to ABI name between define and void. Added reg ex to skip. Patch by Glenn Howe (and expanded on by Douglas Yung)! Differential Revision: https://reviews.llvm.org/D33410 llvm-svn: 312181
* Test-case golfing.Adrian Prantl2017-08-301-33/+17
| | | | llvm-svn: 312175
* [CodeGen][x86_64] Enable 'force_align_arg_pointer' attribute at x86_64Erich Keane2017-08-303-1/+20
| | | | | | | | | | | | | This attribute is useful in OS development when we jump from 32 to 64 bit code and expect that 64bit function forces correct stack alignment. Related discussion: http://lists.llvm.org/pipermail/cfe-dev/2017-June/054358.html Patch By: anatol.pomozov (anatol.pomozov@gmail.com) Differential Revision:https://reviews.llvm.org/D36272 llvm-svn: 312173
* Let -Wdelete-non-virtual-dtor fire in system headers too.Nico Weber2017-08-304-16/+49
| | | | | | | | | | | | | Makes the warning useful again in a std::unique_ptr world, PR28460. Also make the warning not fire in unevaluated contexts, since system libraries (e.g. libc++) do do that. This would've been a good change before we started emitting this warning in system headers too, but "normal" code seems to be less template-heavy, so we didn't notice until now. https://reviews.llvm.org/D37235 llvm-svn: 312167
* docs: typo fixHans Wennborg2017-08-301-4/+3
| | | | llvm-svn: 312149
* Adapt testcases to LLVM change r312144 in DIGlobalVariableExpressionAdrian Prantl2017-08-309-33/+33
| | | | llvm-svn: 312148
* [X86] Implement broadcastf32x2 and broadcasti32x2 intrinsics using ↵Craig Topper2017-08-305-65/+72
| | | | | | | | | | __builtin_shufflevector instead builtins This patch implements the broadcastf32x2/broadcasti32x2 intrinsics using __builtin_shufflevector. Differential Revision: https://reviews.llvm.org/D37287 llvm-svn: 312135
* Avoid 'size_t' typedef in the unittest ObjC codeAlex Lorenz2017-08-301-3/+3
| | | | | | | This should fix http://bb.pgr.jp/builders/test-clang-msc-x64-on-i686-linux-RA llvm-svn: 312133
* Recommit r312127: [refactor] AST selection tree should contain syntacticAlex Lorenz2017-08-303-1/+162
| | | | | | | | | | | | | | | | form of PseudoObjectExpr The new commit adjusts unittest test code compilation options so that the Objective-C code in the unittest can be parsed on non-macOS platforms. Original message: The AST selection finder now constructs a selection tree that contains only the syntactic form of PseudoObjectExpr. This form of selection tree is more meaningful when doing downstream analysis as we're interested in the syntactic features of the AST and the correct lexical parent relation. llvm-svn: 312132
* Revert r312127 as the ObjC unittest code fails to compile on LinuxAlex Lorenz2017-08-302-158/+0
| | | | llvm-svn: 312131
* [refactor] AST selection tree should contain syntactic formAlex Lorenz2017-08-302-0/+158
| | | | | | | | | | | of PseudoObjectExpr The AST selection finder now constructs a selection tree that contains only the syntactic form of PseudoObjectExpr. This form of selection tree is more meaningful when doing downstream analysis as we're interested in the syntactic features of the AST and the correct lexical parent relation. llvm-svn: 312127
* clang-format: Add preprocessor directive indentationKrasimir Georgiev2017-08-309-7/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is an implementation for [bug 17362](https://bugs.llvm.org/attachment.cgi?bugid=17362) which adds support for indenting preprocessor statements inside if/ifdef/endif. This takes previous work from fmauch (https://github.com/fmauch/clang/tree/preprocessor_indent) and makes it into a full feature. The context of this patch is that I'm a VMware intern, and I implemented this because VMware needs the feature. As such, some decisions were made based on what VMware wants, and I would appreciate suggestions on expanding this if necessary to use-cases other people may want. This adds a new enum config option, `IndentPPDirectives`. Values are: * `PPDIS_None` (in config: `None`): ``` #if FOO #if BAR #include <foo> #endif #endif ``` * `PPDIS_AfterHash` (in config: `AfterHash`): ``` #if FOO # if BAR # include <foo> # endif #endif ``` This is meant to work whether spaces or tabs are used for indentation. Preprocessor indentation is independent of indentation for non-preprocessor lines. Preprocessor indentation also attempts to ignore include guards with the checks: 1. Include guards cover the entire file 2. Include guards don't have `#else` 3. Include guards begin with ``` #ifndef <var> #define <var> ``` This patch allows `UnwrappedLineParser::PPBranchLevel` to be decremented to -1 (the initial value is -1) so the variable can be used for indent tracking. Defects: * This patch does not handle the case where there's code between the `#ifndef` and `#define` but all other conditions hold. This is because when the #define line is parsed, `UnwrappedLineParser::Lines` doesn't hold the previous code line yet, so we can't detect it. This is out of the scope of this patch. * This patch does not handle cases where legitimate lines may be outside an include guard. Examples are `#pragma once` and `#pragma GCC diagnostic`, or anything else that does not change the meaning of the file if it's included multiple times. * This does not detect when there is a single non-preprocessor line in front of an include-guard-like structure where other conditions hold because `ScopedLineState` hides the line. * Preprocessor indentation throws off `TokenAnnotator::setCommentLineLevels` so the indentation of comments immediately before indented preprocessor lines is toggled on each run. Fixing this issue appears to be a major change and too much complexity for this patch. Contributed by @euhlmann! Reviewers: djasper, klimek, krasimir Reviewed By: djasper, krasimir Subscribers: krasimir, mzeren-vmw, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D35955 llvm-svn: 312125
* Driver: out-of-line static analyzer flag handling (NFC)Saleem Abdulrasool2017-08-301-72/+74
| | | | | | | | Extract the analyzer flag handling into its own function to reduce the overall complexity of the construction of the clang compiler arguments. NFC. llvm-svn: 312124
* [refactor] Examine the whole range for ObjC @implementation declsAlex Lorenz2017-08-302-2/+35
| | | | | | when computing the AST selection llvm-svn: 312121
* Revert r312105 [modules] Add ability to specify module name to module file ↵Victor Leschuk2017-08-3016-208/+49
| | | | | | | | mapping Looks like it breaks win10 builder. llvm-svn: 312112
* Add test case that was broken by r311970.Martin Bohme2017-08-301-0/+16
| | | | | | | | | See also discussion here: https://reviews.llvm.org/rL301963 As far as I can tell, this discussion was never resolved. llvm-svn: 312109
* Revert "Improve constant expression evaluation of arrays of unknown bound."Martin Bohme2017-08-304-97/+27
| | | | | | | | This reverts commit r311970. Breaks internal tests. llvm-svn: 312108
* [docs] Regenerate command line options referenceBoris Kolpackov2017-08-301-4/+53
| | | | llvm-svn: 312106
* [modules] Add ability to specify module name to module file mappingBoris Kolpackov2017-08-3016-49/+208
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312105
* Give a better error if auto deduction fails due to inconsistent element ↵Richard Smith2017-08-303-26/+77
| | | | | | types in a braced initializer list. llvm-svn: 312085
* Driver: refactor SSP argument handling (NFC)Saleem Abdulrasool2017-08-291-48/+59
| | | | | | | | Out-of-line the SSP argument handling for the sake of readability. Pass along some state information to avoid re-computing the command line flags. llvm-svn: 312084
* Driver: refactor OpenCL argument forwardingSaleem Abdulrasool2017-08-291-38/+26
| | | | | | | | | | | Extract the argument forwarding for OpenCL arguments. Make this more data driven as we are just repeating the argument name and spelling. This costs a slight bit more memory due to the string duplication, but makes it easier to follow. It should be possible to forward the internal string representation from the TableGen data to avoid this. But, this makes the code simpler to follow for now. llvm-svn: 312083
* Driver: reuse existing `D` variable (NFC)Saleem Abdulrasool2017-08-291-10/+9
| | | | | | | Change the rest of the function to use the `D` variable for the driver instance. NFC. llvm-svn: 312082
* Driver: hoist a local variable (NFC)Saleem Abdulrasool2017-08-291-32/+27
| | | | | | | Hoist the `getToolChain().getTriple()` to a variable rather than re-fetching it every time. NFC. llvm-svn: 312081
* PR10147: When substituting a template template argument, substitute in the mostRichard Smith2017-08-294-9/+34
| | | | | | | recent (non-friend) declaration to pick up the right set of default template arguments. llvm-svn: 312049
* Restore clang_rt library name on i686-android.Evgeniy Stepanov2017-08-292-0/+16
| | | | | | | | | | | | | | | | | Summary: Recent changes canonicalized clang_rt library names to refer to "i386" on all x86 targets. Android historically uses i686. This change adds a special case to keep i686 in all clang_rt libraries when targeting Android. Reviewers: hans, mgorny, beanz Subscribers: srhines, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D37278 llvm-svn: 312048
* Revert "[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer"Matt Morehouse2017-08-291-5/+1
| | | | | | This reverts r312026 due to bot breakage. llvm-svn: 312047
* Re-enable stack depth instrumentation on Windows.Matt Morehouse2017-08-291-2/+2
| | | | | | | Specified tls_model attribute properly. Should compile on Windows now. llvm-svn: 312037
OpenPOWER on IntegriCloud