summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r292508 given that we intend to remove driver options for cxx modules.Manman Ren2017-01-201-4/+1
| | | | llvm-svn: 292639
* Fix actually-reachable llvm_unreachable.Richard Smith2017-01-201-2/+1
| | | | llvm-svn: 292632
* [Frontend] The macro that describes the Objective-C bool type shouldAlex Lorenz2017-01-201-3/+5
| | | | | | | | | | be defined for non Objective-C code as well rdar://29794915 Differential Revision: https://reviews.llvm.org/D28349 llvm-svn: 292617
* [Sema] Improve the error diagnostic for dot destructor calls on pointer objectsAlex Lorenz2017-01-201-9/+47
| | | | | | | | | | | | | This commit improves the mismatched destructor type error by detecting when the destructor call has used a '.' instead of a '->' on a pointer to the destructed type. The diagnostic now suggests to use '->' instead of '.', and adds a fixit where appropriate. rdar://28766702 Differential Revision: https://reviews.llvm.org/D25817 llvm-svn: 292615
* [OPENMP] Fix for PR31643: Clang crashes when compiling code on WindowsAlexey Bataev2017-01-201-2/+1
| | | | | | | | | | with SEH and openmp In some cituations (during codegen for Windows SEH constructs) CodeGenFunction instance may have CurFn equal to nullptr. OpenMP related code does not expect such situation during cleanup. llvm-svn: 292590
* [AST Printer] Print attributes on enum constantsJordan Rose2017-01-201-0/+1
| | | | | | | The AST printer was dropping attributes on enumerators (enum constants). Now it's not. llvm-svn: 292571
* clang-format: fix fallback style set to "none" not always formattingAntonio Maiorano2017-01-201-6/+6
| | | | | | | | | | | This fixes clang-format not formatting if fallback-style is explicitly set to "none", and either a config file is found or YAML is passed in without a "BasedOnStyle". With this change, passing "none" in these cases will have no affect, and LLVM style will be used as the base style. Differential Revision: https://reviews.llvm.org/D28844 llvm-svn: 292562
* PR31701: Fix crash on invalid caused by parsing a dependent initializer when weRichard Smith2017-01-201-1/+2
| | | | | | don't know we're in a dependent context. llvm-svn: 292561
* P0426: Make the library implementation of constexpr char_traits a little easierRichard Smith2017-01-203-0/+7
| | | | | | | | | by providing a memchr builtin that returns char* instead of void*. Also add a __has_feature flag to indicate the presence of constexpr forms of the relevant <string> functions. llvm-svn: 292555
* Finish implementation of C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-204-56/+77
| | | | | | | Diagnose the case when a dependent template name instantiates to an injected-class-name outside a nested-name-specifier. llvm-svn: 292545
* Don't inline dllimport functions referencing non-imported methodsHans Wennborg2017-01-191-0/+5
| | | | | | | This is another follow-up to r246338. I had assumed methods were already handled by the AST visitor, but turns out they weren't. llvm-svn: 292522
* PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-199-79/+121
| | | | | | | | | | | | | | | | | | | | | | Under this defect resolution, the injected-class-name of a class or class template cannot be used except in very limited circumstances (when declaring a constructor, in a nested-name-specifier, in a base-specifier, or in an elaborated-type-specifier). This is apparently done to make parsing easier, but it's a pain for us since we don't know whether a template-id using the injected-class-name is valid at the point when we annotate it (we don't yet know whether the template-id will become part of an elaborated-type-specifier). As a tentative resolution to a perceived language defect, mem-initializer-ids are added to the list of exceptions here (they generally follow the same rules as base-specifiers). When the reference to the injected-class-name uses the 'typename' or 'template' keywords, we permit it to be used to name a type or template as an extension; other compilers also accept some cases in this area. There are also a couple of corner cases with dependent template names that we do not yet diagnose, but which will also get this treatment. llvm-svn: 292518
* Module: Improve diagnostic message when cxx modules are disabled and @import ↵Manman Ren2017-01-191-1/+4
| | | | | | | | is used in Objective CXX. rdar://problem/19399671 llvm-svn: 292508
* [Sema] Fix PR28181 by avoiding calling BuildOverloadedBinOp in C modeAlex Lorenz2017-01-191-6/+5
| | | | | | | | rdar://28532840 Differential Revision: https://reviews.llvm.org/D25213 llvm-svn: 292497
* [Hexagon] Linux linker does not support .gnu-hashSumanth Gundapaneni2017-01-191-1/+3
| | | | | | | | | Hexagon Linux dynamic loader does not use (in fact does not support) .gnu-hash Differential Revision: https://reviews.llvm.org/D28865 llvm-svn: 292496
* Add -fdebug-info-for-profiling to emit more debug info for sample pgo ↵Dehao Chen2017-01-194-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | profile collection Summary: SamplePGO uses profile with debug info to collect profile. Unlike the traditional debugging purpose, sample pgo needs more accurate debug info to represent the profile. We add -femit-accurate-debug-info for this purpose. It can be combined with all debugging modes (-g, -gmlt, etc). It makes sure that the following pieces of info is always emitted: * start line of all subprograms * linkage name of all subprograms * standalone subprograms (functions that has neither inlined nor been inlined) The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch): -gmlt(orig) -gmlt(patched) -g 433.milc 4.68% 5.40% 19.73% 444.namd 8.45% 8.93% 45.99% 447.dealII 97.43% 115.21% 374.89% 450.soplex 27.75% 31.88% 126.04% 453.povray 21.81% 26.16% 92.03% 470.lbm 0.60% 0.67% 1.96% 482.sphinx3 5.77% 6.47% 26.17% 400.perlbench 17.81% 19.43% 73.08% 401.bzip2 3.73% 3.92% 12.18% 403.gcc 31.75% 34.48% 122.75% 429.mcf 0.78% 0.88% 3.89% 445.gobmk 6.08% 7.92% 42.27% 456.hmmer 10.36% 11.25% 35.23% 458.sjeng 5.08% 5.42% 14.36% 462.libquantum 1.71% 1.96% 6.36% 464.h264ref 15.61% 16.56% 43.92% 471.omnetpp 11.93% 15.84% 60.09% 473.astar 3.11% 3.69% 14.18% 483.xalancbmk 56.29% 81.63% 353.22% geomean 15.60% 18.30% 57.81% Debug info size change for -gmlt binary with this patch: 433.milc 13.46% 444.namd 5.35% 447.dealII 18.21% 450.soplex 14.68% 453.povray 19.65% 470.lbm 6.03% 482.sphinx3 11.21% 400.perlbench 8.91% 401.bzip2 4.41% 403.gcc 8.56% 429.mcf 8.24% 445.gobmk 29.47% 456.hmmer 8.19% 458.sjeng 6.05% 462.libquantum 11.23% 464.h264ref 5.93% 471.omnetpp 31.89% 473.astar 16.20% 483.xalancbmk 44.62% geomean 16.83% Reviewers: davidxl, andreadb, rob.lougher, dblaikie, echristo Reviewed By: dblaikie, echristo Subscribers: hfinkel, rob.lougher, andreadb, gbedwell, cfe-commits, probinson, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25435 llvm-svn: 292458
* Move vtable type metadata emission behind a cc1-level flag.Peter Collingbourne2017-01-184-3/+12
| | | | | | | | | | | | | In ThinLTO mode, type metadata will require the module to be written as a multi-module bitcode file, which is currently incompatible with the Darwin linker. It is also useful to be able to enable or disable multi-module bitcode for testing purposes. This introduces a cc1-level flag, -f{,no-}lto-unit, which is used by the driver to enable multi-module bitcode on all but Darwin+ThinLTO, and can also be used to enable/disable the feature manually. Differential Revision: https://reviews.llvm.org/D28877 llvm-svn: 292448
* Remove now redundant code that ensured debug info for class definitions was ↵David Blaikie2017-01-182-18/+0
| | | | | | | | | | | emitted under certain circumstances Introduced in r181561 - it may've been subsumed by work done to allow emission of declarations for vtable types while still emitting some of their member functions correctly for those declarations. Whatever the reason, the tests pass without this code now. llvm-svn: 292439
* [OpenMP] Support for the if-clause on the combined directive 'target parallel'.Arpith Chacko Jacob2017-01-186-27/+210
| | | | | | | | | | | | | | | | | | | | | | | The if-clause on the combined directive potentially applies to both the 'target' and the 'parallel' regions. Codegen'ing the if-clause on the combined directive requires additional support because the expression in the clause must be captured by the 'target' capture statement but not the 'parallel' capture statement. Note that this situation arises for other clauses such as num_threads. The OMPIfClause class inherits OMPClauseWithPreInit to support capturing of expressions in the clause. A member CaptureRegion is added to OMPClauseWithPreInit to indicate which captured statement (in this case 'target' but not 'parallel') captures these expressions. To ensure correct codegen of captured expressions in the presence of combined 'target' directives, OMPParallelScope was added to 'parallel' codegen. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28781 llvm-svn: 292437
* [ASTReader] Add a DeserializationListener callback for IMPORTED_MODULESGraydon Hoare2017-01-181-1/+4
| | | | | | | | | | | | | | | | | Summary: Add a callback from ASTReader to DeserializationListener when the former reads an IMPORTED_MODULES block. This supports Swift in using PCH for bridging headers. Reviewers: doug.gregor, manmanren, bruno Reviewed By: manmanren Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28779 llvm-svn: 292436
* [OpenMP] Codegen for the 'target parallel' directive on the NVPTX device.Arpith Chacko Jacob2017-01-182-9/+258
| | | | | | | | | | | | | | | | | | This patch adds codegen for the 'target parallel' directive on the NVPTX device. We term offload OpenMP directives such as 'target parallel' and 'target teams distribute parallel for' as SPMD constructs. SPMD constructs, in contrast to Generic ones like the plain 'target', can never contain a serial region. SPMD constructs can be handled more efficiently on the GPU and do not require the Warp Loop of the Generic codegen scheme. This patch adds SPMD codegen support for 'target parallel' on the NVPTX device and can be reused for other SPMD constructs. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28755 llvm-svn: 292428
* PR9551: Implement DR1004 (http://wg21.link/cwg1004).Richard Smith2017-01-182-11/+54
| | | | | | | | This rule permits the injected-class-name of a class template to be used as both a template type argument and a template template argument, with no extra syntax required to disambiguate. llvm-svn: 292426
* [OpenMP] Codegen support for 'target parallel' on the host.Arpith Chacko Jacob2017-01-189-42/+253
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for codegen of 'target parallel' on the host. It is also the first combined directive that requires two or more captured statements. Support for this functionality is included in the patch. A combined directive such as 'target parallel' has two captured statements, one for the 'target' and the other for the 'parallel' region. Two captured statements are required because each has different implicit parameters (see SemaOpenMP.cpp). For example, the 'parallel' has 'global_tid' and 'bound_tid' while the 'target' does not. The patch adds support for handling multiple captured statements based on the combined directive. When codegen'ing the 'target parallel' directive, the 'target' outlined function is created using the outer captured statement and the 'parallel' outlined function is created using the inner captured statement. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28753 llvm-svn: 292419
* [ASTUnit] Reset diag state when creating the ASTUnit.Benjamin Kramer2017-01-181-0/+1
| | | | | | A client could call this with a dirty diagnostic engine, don't crash. llvm-svn: 292406
* [Basic] Remove source manager references from diag state points.Benjamin Kramer2017-01-181-10/+32
| | | | | | | | | This is just wasted space, we don't support state points from multiple source managers. Validate that there's no state when resetting the source manager and use the 'global' reference to the sourcemanager instead of the ones in the diag state. llvm-svn: 292402
* Revert r292374 to debug Windows buildbot failure.Arpith Chacko Jacob2017-01-189-279/+42
| | | | llvm-svn: 292400
* Warn when calling a non interrupt function from an interrupt on ARMJonathan Roelofs2017-01-181-0/+9
| | | | | | | | | | The idea for this originated from a really tricky bug: ISRs on ARM don't automatically save off the VFP regs, so if say, memcpy gets interrupted and the ISR itself calls memcpy, the regs are left clobbered when the ISR is done. https://reviews.llvm.org/D28820 llvm-svn: 292375
* [OpenMP] Codegen support for 'target parallel' on the host.Arpith Chacko Jacob2017-01-189-42/+279
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for codegen of 'target parallel' on the host. It is also the first combined directive that requires two or more captured statements. Support for this functionality is included in the patch. A combined directive such as 'target parallel' has two captured statements, one for the 'target' and the other for the 'parallel' region. Two captured statements are required because each has different implicit parameters (see SemaOpenMP.cpp). For example, the 'parallel' has 'global_tid' and 'bound_tid' while the 'target' does not. The patch adds support for handling multiple captured statements based on the combined directive. When codegen'ing the 'target parallel' directive, the 'target' outlined function is created using the outer captured statement and the 'parallel' outlined function is created using the inner captured statement. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28753 llvm-svn: 292374
* Revert "[xray] try to fix thumb buildbot"Renato Golin2017-01-181-1/+0
| | | | | | This reverts commit r292268, as it didn't fix the buildbots. llvm-svn: 292355
* [AVX-512] Replace subvector broadcast builtins with shufflevectors and selects.Craig Topper2017-01-184-151/+133
| | | | | | Verified that the backend codegens this equally well. llvm-svn: 292329
* [WebAssembly] Add minimal support for the new wasm object format triple.Dan Gohman2017-01-174-6/+19
| | | | llvm-svn: 292269
* [xray] try to fix thumb buildbotRenato Golin2017-01-171-0/+1
| | | | llvm-svn: 292268
* [Sema] Fix bug in handling of designated initializer.Akira Hatanaka2017-01-171-0/+4
| | | | | | | | | | | | CheckDesignatedInitializer wasn't taking into account the base classes when computing the index for the field in the derived class, which caused the test case to crash during IRGen because of a malformed AST. rdar://problem/26795040 Differential Revision: https://reviews.llvm.org/D28705 llvm-svn: 292245
* [Clang] - Update code to match upcoming llvm::zlib API.George Rimar2017-01-172-17/+36
| | | | | | | | | | | | | | D28684 changed llvm::zlib to return Error instead of Status. It was accepted and committed in r292214, but then reverted in r292217 because I missed that clang code also needs to be updated. Patch do that. D28684 recommitted again as r292226 Differential revision: https://reviews.llvm.org/D28807 llvm-svn: 292227
* Fix AArch64 global-merge backend option name.Frederic Riss2017-01-171-2/+2
| | | | | | | | -mglobal-merge is translated to the appropriate backend option in the driver. r277322 changed the AArch64 option name in the backend, but the driver was never updated. llvm-svn: 292192
* Partial revert of r290511.Richard Smith2017-01-171-12/+16
| | | | | | | | | | | | | | | | The rules around typechecking deduced template arguments during partial ordering are not clear, and while the prior behavior does not seem to be correct (it doesn't follow the general model of partial ordering where each template parameter is replaced by a non-dependent but unique value), the new behavior is also not clearly right and breaks some existing idioms. The new behavior is retained for dealing with non-type template parameters with 'auto' types, as without it even the most basic uses of that feature don't work. We can revisit this once CWG has come to an agreement on how partial ordering with 'auto' non-type template parameters is supposed to work. llvm-svn: 292183
* clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyleAntonio Maiorano2017-01-172-39/+38
| | | | | | | | | | Change the contract of GetStyle so that it returns an error when an error occurs (i.e. when it writes to stderr), and only returns the fallback style when it can't find a configuration file. Differential Revision: https://reviews.llvm.org/D28081 llvm-svn: 292174
* [StaticAnalyzer] Fix android buildPavel Labath2017-01-161-1/+2
| | | | | | | | std::to_string is not available in the android NDK. Use llvm::to_string instead. Committing as obvious. llvm-svn: 292141
* [OpenMP] Refactor code that calls codegen for target regions on the device.Arpith Chacko Jacob2017-01-163-54/+69
| | | | | | | | | | | | This patch refactors code that calls codegen for target regions. Currently the codebase only supports the 'target' directive. The patch pulls out common target processing code into a static function that can be called by codegen for any target directive. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28752 llvm-svn: 292134
* Ensure that clang -pthread creates the right macro. -D_POSIX_THREADSJoerg Sonnenberger2017-01-161-1/+1
| | | | | | seems to have been a C&P error from old GCC specs for OpenBSD. llvm-svn: 292119
* clang-format: Always wrap before multi-line parameters/operands.Daniel Jasper2017-01-162-28/+46
| | | | | | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaa(aaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaa(aaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaa); No new test cases, as the existing ones cover this fairly well. llvm-svn: 292110
* clang-format: [JS] revert over-eager ASI check.Martin Probst2017-01-161-2/+1
| | | | | | | | | | | | Summary: Change r291428 introduced ASI detection after closing curly braces. That would generally be correct, however this breaks indentation for structural statements. What happens is that CompoundStatementIndenter increases indentation for the current line, then after reading ASI creates a new line (with the increased line level), and only after the structural parser sees e.g. the if/then/else branch closed, line level is reduced. That leads to the new line started by ASI having a level too high. Reviewers: djasper Subscribers: sammccall, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D28763 llvm-svn: 292099
* [code-completion] Fix crash when trying to do postfix completion of instance ↵Argyrios Kyrtzidis2017-01-151-3/+4
| | | | | | member inside a static function. llvm-svn: 292052
* Fix PR31644 introduced by r287138 and add a regression test.Yaron Keren2017-01-141-2/+2
| | | | | | Thanks Dimitry Andric for the report and fix! llvm-svn: 292032
* Fix a typo. NFC.George Burgess IV2017-01-141-1/+1
| | | | llvm-svn: 291997
* Give more accurate descriptions of what kind of template we found in ↵Richard Smith2017-01-142-8/+23
| | | | | | | | | diagnostics. We were previouly assuming that every type template was a class template, which is not true any more. llvm-svn: 291988
* clang-format: Fix bug in making line break decisions.Daniel Jasper2017-01-131-5/+5
| | | | | | | | | | | | | | | | | | | | | Here, the optimization to not line wrap when it would not lead to a reduction in columns was overwriting and enforced break that we want to do no matter what. Before: int i = someFunction( aaaaaaa, 0).aaa(aaaaaaaaaaaaa) * aaaaaaa + aaaaaaa; After: int i = someFunction(aaaaaaa, 0) .aaa(aaaaaaaaaaaaa) * aaaaaaa + aaaaaaa; llvm-svn: 291974
* PR31631: fix bad CFG (and bogus warnings) when an if-statement has an ↵Richard Smith2017-01-131-41/+36
| | | | | | init-statement and has binary operator as its condition. llvm-svn: 291964
* PR31606: Generalize our tentative DR resolution for inheriting copy/moveRichard Smith2017-01-131-26/+28
| | | | | | constructors to better match the pre-P0136R1 behavior. llvm-svn: 291955
* Remove unused lambda captures. NFCMalcolm Parsons2017-01-135-26/+23
| | | | llvm-svn: 291939
OpenPOWER on IntegriCloud