summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* DR259: Demote the pedantic error for an explicit instantiation after anRichard Smith2016-08-311-7/+1
| | | | | | | | | explicit specialization to a warning for C++98 mode (this is a defect report resolution, so per our informal policy it should apply in C++98), and turn the warning on by default for C++11 and later. In all cases where it fires, the right thing to do is to remove the pointless explicit instantiation. llvm-svn: 280308
* Add -fprofile-dir= to clang.Nick Lewycky2016-08-313-20/+43
| | | | | | | | | | | | | | | | | | | | | -fprofile-dir=path allows the user to specify where .gcda files should be emitted when the program is run. In particular, this is the first flag that causes the .gcno and .o files to have different paths, LLVM is extended to support this. -fprofile-dir= does not change the file name in the .gcno (and thus where lcov looks for the source) but it does change the name in the .gcda (and thus where the runtime library writes the .gcda file). It's different from a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX. To implement this we split -coverage-file into -coverage-data-file and -coverage-notes-file to specify the two different names. The !llvm.gcov metadata node grows from a 2-element form {string coverage-file, node dbg.cu} to 3-elements, {string coverage-notes-file, string coverage-data-file, node dbg.cu}. In the 3-element form, the file name is already "mangled" with .gcno/.gcda suffixes, while the 2-element form left that to the middle end pass. llvm-svn: 280306
* DebugInfo: Fix -gsplit-dwarf + -fno-split-dwarf-inliningDavid Blaikie2016-08-311-8/+12
| | | | | | | | | | | I tested the cases involving split-dwarf + gmlt + no-split-dwarf-inlining, but didn't verify the simpler case without gmlt. The logic is, admittedly, a little hairy, but seems about as simple as I could wrangle it. llvm-svn: 280290
* Don't diagnoes a mismatch between implicit and explicit exceptionRichard Smith2016-08-311-1/+1
| | | | | | | specifications under -fno-exceptions, just as we don't diagnose other exception specification mismatch errors. llvm-svn: 280289
* Fix mishandling of deletedness for assignment operators of classes withRichard Smith2016-08-311-3/+4
| | | | | | | | indirect virtual bases. We don't need to be able to invoke such an assignment operator from the derived class, and we shouldn't delete the derived assignment op if we can't do so. llvm-svn: 280288
* [codeview] Don't emit vshape info for classes without vfptrsReid Kleckner2016-08-311-1/+8
| | | | | | | | | | | | Classes with no virtual methods or whose virtual methods were all inherited from virtual bases don't have a vfptr at offset zero. We were crashing attempting to get the layout of that non-existent vftable. We don't need any vshape info in this case because the debugger can infer it from the base class information. The current class may not introduce any virtual methods if we are in this situation. llvm-svn: 280287
* Revert "Driver: use the canonical static library naming"Saleem Abdulrasool2016-08-311-3/+3
| | | | | | | | This breaks chromium and its unclear if this is actually a modern convention. This reverts SVN r280169. llvm-svn: 280281
* [codeview] Pass through vftable shape informationReid Kleckner2016-08-312-11/+39
| | | | | | | | | | | | | | | The shape is really just the number of methods in the vftable, since we don't support 16 bit far calls. All calls are near. Encode this number in the size of the artificial __vtbl_ptr_type DIDerivedType that we generate. For DWARF, this will be a normal pointer, but for codeview this will be a wide pointer that gets pattern matched into a VFTableShape record. Insert this type into the element list of all dynamic classes when emitting CodeView, so that the backend can emit the shape even if the vptr lives in a primary base class. Fixes PR28150 llvm-svn: 280255
* clang-format: Set default WebKit style to use C++11.Daniel Jasper2016-08-311-1/+0
| | | | | | | | | The WebKit style page says to use nullptr, so this should be fine: https://webkit.org/code-style-guidelines/ This fixes: llvm.org/PR30220 llvm-svn: 280245
* [Coverage] Suppress creating a code region if the same area is covered by an ↵Igor Kudrin2016-08-311-5/+23
| | | | | | | | | | | | expansion region. In most cases these code regions are just redundant, but sometimes they could be assigned to the counter of the parent code region instead of the counter of the nested block. Differential Revision: https://reviews.llvm.org/D23987 llvm-svn: 280199
* [AVX-512] Implement masked floating point logical operations with native IR ↵Craig Topper2016-08-312-277/+204
| | | | | | and remove the builtins. llvm-svn: 280197
* [X86] Use v2i64 vectors to implement _mm_and/andn/or/xor_pd.Craig Topper2016-08-311-4/+4
| | | | | | These will be reused when removing some builtins from avx512vldqintrin.h and this will make the tests for that change show a better number of vector elements. llvm-svn: 280196
* PR12298 et al: don't recursively instantiate a template specialization fromRichard Smith2016-08-315-22/+71
| | | | | | | | | | | | | | | within the instantiation of that same specialization. This could previously happen for eagerly-instantiated function templates, variable templates, exception specifications, default arguments, and a handful of other cases. We still have an issue here for default template arguments that recursively make use of themselves and likewise for substitution into the type of a non-type template parameter, but in those cases we're producing a different entity each time, so they should instead be caught by the instantiation depth limit. However, currently we will typically run out of stack before we reach it. :( llvm-svn: 280190
* clangTooling: Update libdeps: LLVMOptions, since r280118.NAKAMURA Takumi2016-08-311-1/+4
| | | | llvm-svn: 280187
* clangTooling depends on ClangDriverOptions since r280118.NAKAMURA Takumi2016-08-311-0/+3
| | | | llvm-svn: 280186
* [analyzer] Use lazily created buffer in EmptyLocalizationContextCheckerDevin Coughlin2016-08-301-1/+8
| | | | | | | | | | | Fix a crash when relexing the underlying memory buffer to find incorrect arguments to NSLocalizedString(). With precompiled headers, the raw buffer may be NULL. Instead, use the source manager to get the buffer, which will lazily create the buffer for precompiled headers. rdar://problem/27429091 llvm-svn: 280174
* Driver: use the canonical static library namingSaleem Abdulrasool2016-08-301-3/+3
| | | | | | | | | | On Windows, static libraries are named lib<name>.lib while import libraries are named <name>.lib. Use the appropriate naming on itanium and msvc environments. This is setup properly so that if a dynamic builtins is used on Windows, it would do the right thing, although this is not currently wired through the driver (i.e. there is no equivalent to -{shared,static}-gcc). llvm-svn: 280169
* clang-format: Correctly calculate affected ranges when sorting #includes.Daniel Jasper2016-08-301-4/+4
| | | | | | affectedRanges takes a start and an end offset, not offset and length. llvm-svn: 280165
* [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.Bruno Cardoso Lopes2016-08-302-0/+2
| | | | | | | | | | | | | This adds support for modules that require (no-)gnu-inline-asm environment, such as the compiler builtin cpuid submodule. This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871 Differential Revision: https://reviews.llvm.org/D23905 rdar://problem/26931199 llvm-svn: 280159
* Fix memory leak by storing returned pointer in std::unique_ptrRichard Trieu2016-08-301-4/+3
| | | | llvm-svn: 280157
* PR29166: when merging declarations with typedef names for linkage purposes,Richard Smith2016-08-301-1/+1
| | | | | | | don't assume that the anonymous struct will be part of the most recent declaration of the typedef. llvm-svn: 280136
* Unrevert r280035 now that the clang-cl bug it exposed has been fixed byRichard Smith2016-08-305-18/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r280133. Original commit message: C++ Modules TS: driver support for building modules. This works as follows: we add --precompile to the existing gamut of options for specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag specifies that an input is taken to the precompilation step and no further, and this can be specified when building a .pcm from a module interface or when building a .pch from a header file. The .cppm extension (and some related extensions) are implicitly recognized as C++ module interface files. If --precompile is /not/ specified, the file is compiled (via a .pcm) to a .o file containing the code for the module (and then potentially also assembled and linked, if -S, -c, etc. are not specified). We do not yet suppress the emission of object code for other users of the module interface, so for now this will only work if everything in the .cppm file has vague linkage. As with the existing support for module-map modules, prebuilt modules can be provided as compiler inputs either via the -fmodule-file= command-line argument or via files named ModuleName.pcm in one of the directories specified via -fprebuilt-module-path=. This also exposes the -fmodules-ts cc1 flag in the driver. This is still experimental, and in particular, the concrete syntax is subject to change as the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does not enable support for implicitly loading module maps nor building modules via the module cache, but those features can be turned on separately and used in conjunction with the Modules TS support. llvm-svn: 280134
* PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) ↵Richard Smith2016-08-302-2/+24
| | | | | | input types. llvm-svn: 280133
* typo + indentation [NFC]Etienne Bergeron2016-08-302-2/+2
| | | | llvm-svn: 280127
* Basic/Targets.cpp: Add polaris10 and polaris11 gpusNiels Ole Salscheider2016-08-301-15/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D23746 llvm-svn: 280120
* Fix colored diagnostics from toolsOlivier Goffart2016-08-301-0/+8
| | | | | | | | | | r271042 changed the way the diagnostic arguments are parsed. It assumes that the diagnostics options were already parsed by the "Driver". For tools using clang::Tooling, the diagnostics argument were not parsed. Differential Revision: https://reviews.llvm.org/D23837 llvm-svn: 280118
* [OpenCL] Make is_valid_event, create_user_event overloadable.Alexey Bader2016-08-301-2/+2
| | | | | | | | | | | | | | Summary: Make is_valid_event and create_user_event overloadable like other built-ins. Patch by Evgeniy Tyurin. Reviewers: bader, yaxunl Subscribers: Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D23914 llvm-svn: 280097
* [Hexagon] Use handleTargetFeaturesGroup to process target-specific featuresKrzysztof Parzyszek2016-08-302-32/+33
| | | | llvm-svn: 280093
* Revert r280035 (and followups r280057, r280085), it caused PR30195Nico Weber2016-08-305-60/+18
| | | | llvm-svn: 280091
* Handle -mlong-calls on HexagonKrzysztof Parzyszek2016-08-302-2/+13
| | | | | | Differential Revision:://reviews.llvm.org/D22766 llvm-svn: 280089
* This adds new options -fdenormal-fp-math and passes through option -ffast-mathSjoerd Meijer2016-08-303-0/+26
| | | | | | | | | | to CC1, which are translated to function attributes and can e.g. be mapped on build attributes FP_exceptions and FP_denormal. Setting these build attributes allows better selection of floating point libraries. Differential Revision: https://reviews.llvm.org/D23840 llvm-svn: 280064
* [PowerPC] Update the DWARF register-size tableHal Finkel2016-08-301-3/+9
| | | | | | | | | The PPC64 DWARF register-size table did not match the ABI specification (or GCC, for that matter). Fix that, and add a regression test. Fixes PR27931. llvm-svn: 280053
* [sanitizer-coverage] add two more modes of instrumentation: trace-div and ↵Kostya Serebryany2016-08-303-2/+12
| | | | | | trace-gep, mostly usaful for value-profile-based fuzzing; clang part llvm-svn: 280044
* C++ Modules TS: driver support for building modules.Richard Smith2016-08-305-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works as follows: we add --precompile to the existing gamut of options for specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag specifies that an input is taken to the precompilation step and no further, and this can be specified when building a .pcm from a module interface or when building a .pch from a header file. The .cppm extension (and some related extensions) are implicitly recognized as C++ module interface files. If --precompile is /not/ specified, the file is compiled (via a .pcm) to a .o file containing the code for the module (and then potentially also assembled and linked, if -S, -c, etc. are not specified). We do not yet suppress the emission of object code for other users of the module interface, so for now this will only work if everything in the .cppm file has vague linkage. As with the existing support for module-map modules, prebuilt modules can be provided as compiler inputs either via the -fmodule-file= command-line argument or via files named ModuleName.pcm in one of the directories specified via -fprebuilt-module-path=. This also exposes the -fmodules-ts cc1 flag in the driver. This is still experimental, and in particular, the concrete syntax is subject to change as the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does not enable support for implicitly loading module maps nor building modules via the module cache, but those features can be turned on separately and used in conjunction with the Modules TS support. llvm-svn: 280035
* [cfi] Export __cfi_check when linking with -fsanitize-cfi-cross-dso.Evgeniy Stepanov2016-08-291-0/+5
| | | | | | Multi-DSO CFI model requires every DSO to export a __cfi_check function. llvm-svn: 280031
* Fix a bug preventing the cause for a module file-not-found from being displayedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280010
* Fix a bug preventing the cause of a module-out-of-date error from being printedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280009
* [Coverage] Prevent creating a redundant counter if a nested body ends with a ↵Igor Kudrin2016-08-291-1/+2
| | | | | | | | | | | | | | | | | macro. If there were several nested statements arranged in a way that all of them end up with the same macro, then the expansion of this macro was assigned with all the corresponding counters of these statements. As a result, the wrong counter value was shown for the macro in llvm-cov. This patch fixes the issue by preventing adding a counter for an expanded source range if it already has an assigned counter, which is expected to come from the most specific statement. Differential Revision: https://reviews.llvm.org/D23160 llvm-svn: 279962
* AST: improve layout of SimpleTypoCorrectorSaleem Abdulrasool2016-08-281-6/+5
| | | | | | | | | Add the "explicit" specifier to the single-argument constructor of SimpleTypoCorrector. Reorder the fields to remove excessive padding (8 bytes). Patch by Alexander Shaposhnikov! llvm-svn: 279946
* clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.Nico Weber2016-08-261-3/+3
| | | | | | | | | | Also makes -fexec-charset accept utf-8 case-insensitively. Like https://reviews.llvm.org/D23807, but for execution-charset. Also replace a few .lower() comparisons with equals_lower(). https://reviews.llvm.org/D23938 llvm-svn: 279866
* Don't diagnose non-modular includes when we are not compiling a module.Manman Ren2016-08-261-1/+3
| | | | | | | | | | | | | | This is triggered when we are compiling an implementation of a module, it has relative includes to a VFS-mapped module with umbrella headers. Currently we will find the real path to headers under the umbrella directory, but the umbrella directories are using virtual path. rdar://27951255 Thanks Ben and Richard for reviewing the patch! Differential Revision: http://reviews.llvm.org/D23858 llvm-svn: 279838
* Add support for -fdiagnostics-absolute-paths: printing absolute paths in ↵Hans Wennborg2016-08-263-2/+23
| | | | | | | | diagnostics Differential Revision: https://reviews.llvm.org/D23816 llvm-svn: 279827
* Sort list of driver-known file extensions. It was previously approximatelyRichard Smith2016-08-261-25/+25
| | | | | | ordered by length then alphabetically; apply that order consistently. llvm-svn: 279799
* C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith2016-08-2615-85/+194
| | | | | | | interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. llvm-svn: 279794
* Widen type of __offset_flags in RTTI on Mingw64Reid Kleckner2016-08-251-4/+14
| | | | | | | | | | | | Otherwise we can't handle secondary base classes at offsets greater than 2**24. This agrees with libstdc++abi. We could extend this change to other LLP64 platforms, but then we would want to update libc++abi and it would require additional review. Fixes PR29116 llvm-svn: 279786
* [MS] Win64 va_arg should expect large arguments to be passed indirectlyReid Kleckner2016-08-251-1/+11
| | | | | | Fixes PR20569 llvm-svn: 279774
* Refactor to remove the assumption that we know the name of the module we're ↵Richard Smith2016-08-254-10/+17
| | | | | | emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input). llvm-svn: 279766
* Omit column info for CodeView by defaultAdrian McCarthy2016-08-251-4/+8
| | | | | | | | | | | | Clang tracks only start columns, not start-end ranges. CodeView allows for that, but the VS debugger doesn't handle anything less than a complete range well--it either highlights the wrong part of a statement or truncates source lines in the assembly view. It's better to have no column information at all. So by default, we'll omit the column information for CodeView targeting Windows. Since the column info is still useful for sanitizers, I've promoted -gcolumn-info (and -gno-column-info) to a CoreOption and added a couple tests to make sure that works for clang-cl. Differential Revision: https://reviews.llvm.org/D23720 llvm-svn: 279765
* [MS] Pass non-trivially-copyable objects indirectly on Windows ARMReid Kleckner2016-08-251-0/+6
| | | | | | | | | | This isn't exactly what MSVC does, unfortunately. MSVC does not pass objects with destructors but no copy constructors by address. More ARM expertise is required to really understand what should be done here. Fixes PR29136. llvm-svn: 279764
* [Sema][Comments] Add support for TypeAliasTemplateBruno Cardoso Lopes2016-08-251-0/+14
| | | | | | | | | | | | | | | | Emit proper diagnostics when -Wdocumentation is used with constructs such as: template<typename T> using fn = int(T aaa, int ccc); Previously clang wouldn't recognize the function and complain with 'comment that is not attached to a function declaration'. Differential Revision: https://reviews.llvm.org/D23860 rdar://problem/27300695 llvm-svn: 279754
OpenPOWER on IntegriCloud