summaryrefslogtreecommitdiffstats
path: root/clang/include
Commit message (Collapse)AuthorAgeFilesLines
* [modules] Allow the error on importing a C++ module within an extern "C"Richard Smith2015-10-131-2/+3
| | | | | | | | | context (but otherwise at the top level) to be disabled, to support use of C++ standard library implementations that (legitimately) mark their <blah.h> headers as being C++ headers from C libraries that wrap things in 'extern "C"' a bit too enthusiastically. llvm-svn: 250137
* Add decayedType and hasDecayedType AST matchersMatthias Gehre2015-10-121-0/+18
| | | | | | | | | | | | Summary: Add decayedType and hasDecayedType AST matchers Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13639 llvm-svn: 250114
* Add warning flags for #include_next and some nearby warnings.Richard Smith2015-10-122-6/+13
| | | | llvm-svn: 250105
* Parse and ignore #pragma runtime_checks in MS extensions mode (PR25138)Hans Wennborg2015-10-122-1/+2
| | | | | | We already silently ignore the /RTC, which controls the same functionality. llvm-svn: 250099
* Support Debug Info path remappingSaleem Abdulrasool2015-10-123-0/+8
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* [Sema] Make `&function_with_enable_if_attrs` an errorGeorge Burgess IV2015-10-122-8/+14
| | | | | | | | | | | | | | | | | | This fixes a bug where one can take the address of a conditionally enabled function to drop its enable_if guards. For example: int foo(int a) __attribute__((enable_if(a > 0, ""))); int (*p)(int) = &foo; int result = p(-1); // compilation succeeds; calls foo(-1) Overloading logic has been updated to reflect this change, as well. Functions with enable_if attributes that are always true are still allowed to have their address taken. Differential Revision: http://reviews.llvm.org/D13607 llvm-svn: 250090
* [VFS] Let the user decide if they want path normalization.Benjamin Kramer2015-10-121-3/+10
| | | | | | | | | | | | | | This is a more principled version of what I did earlier. Path normalization is generally a good thing, but may break users in strange environments, e. g. using lots of symlinks. Let the user choose and default it to on. This also changes adding a duplicated file into returning an error if the file contents are different instead of an assertion failure. Differential Revision: http://reviews.llvm.org/D13658 llvm-svn: 250060
* [ATTR] Automatic line feed after pragma-like attribute.Alexey Bataev2015-10-121-5/+3
| | | | | | | Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations. Differential Revision: http://reviews.llvm.org/D13546 llvm-svn: 250017
* [Sema] Allow C conversions in C overload logicGeorge Burgess IV2015-10-112-7/+14
| | | | | | | | | | C allows for some implicit conversions that C++ does not, e.g. void* -> char*. This patch teaches clang that these conversions are okay when dealing with overloads in C. Differential Revision: http://reviews.llvm.org/D13604 llvm-svn: 249995
* Add a fixme to handleTargetFeatures.Eric Christopher2015-10-091-0/+2
| | | | | | | | | The goal of wanting this to avoid munging the feature list is so that it can be used for various targets as a way of both adding and verifying the features that are going to be output into the IR. llvm-svn: 249894
* Fix whitespace, 80-column violations, embedded tabs for theEric Christopher2015-10-091-6/+8
| | | | | | TargetInfo class. llvm-svn: 249872
* constify the feature vector going into initFeatureMap as it shouldn'tEric Christopher2015-10-091-1/+1
| | | | | | change the set of features. llvm-svn: 249871
* Analysis: Make CFG::graph_iterator dereference to non-constDuncan P. N. Exon Smith2015-10-091-1/+1
| | | | | | | | | | | | | | | Since the original commit in r145858, we've had `CFG::graph_iterator` and `CFG::const_graph_iterator`, and both have derefenced to a `const`-ified `value_type`. The former has an implicit conversion to non-`const`, which is how this worked at all until r249782 started using the dereference operator (partially reverted in r249783). This fixes the non-const iterator to be non-const (sometimes const-iterators are intentional, but with a separate const-ified class (and a non-const implicit conversion leak) that's not likely to be the case here). llvm-svn: 249849
* [VFS] Just normalize away .. and . in paths for in-memory file systems.Benjamin Kramer2015-10-091-1/+1
| | | | | | This simplifies the code and gets us support for .. for free. llvm-svn: 249830
* [VFS] Port tooling to use the in-memory file system.Benjamin Kramer2015-10-091-0/+4
| | | | | | | | | | This means file remappings can now be managed by ClangTool (or a ToolInvocation user) instead of by ToolInvocation itself. The ToolInvocation remapping is still in place so users can migrate. Differential Revision: http://reviews.llvm.org/D13474 llvm-svn: 249815
* Fix a few typos in the required feature set for some of the x86Eric Christopher2015-10-091-48/+48
| | | | | | | | | | | | builtins: avx512vd -> avx512vl rdrand -> rdrnd avx512ff -> avx512f no functional change. llvm-svn: 249790
* Expose -f[no]ms-{compatibility,extensions} in clang-cl (PR25114)Hans Wennborg2015-10-081-4/+6
| | | | | | | | These are enabled by default in clang-cl, because the whole idea is that it should work like cl.exe, but I suppose it can make sense to disable them if someone wants to compile code in a more strict mode. llvm-svn: 249775
* [MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enumDavid Majnemer2015-10-081-1/+3
| | | | | | | | | | | | | | | | | | consider the following: enum E *p; enum E { e }; The above snippet is not ANSI C because 'enum E' has not bee defined when we are processing the declaration of 'p'; however, it is a popular extension to make the above work. This would fail using the Microsoft enum semantics because the definition of 'E' would implicitly have a fixed underlying type of 'int' which would trigger diagnostic messages about a mismatch between the declaration and the definition. Instead, treat fixed underlying types as not fixed for the purposes of the diagnostic. llvm-svn: 249674
* [OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.Alexey Bataev2015-10-084-4/+34
| | | | | | 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-083-7/+19
| | | | | | | | | | | | | | | | 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
* [WinEH] Remove NewMSEH and enable its behavior by defaultReid Kleckner2015-10-081-1/+0
| | | | | | | Testing has shown that it is at least as reliable as the old landingpad pattern matching code. llvm-svn: 249647
* ASTMatchers: Keep AllCallbacks in a set instead of a vectorDaniel Jasper2015-10-071-1/+2
| | | | | | | | | | | AllCallbacks is currently only used to call onStartOfTranslationUnit and onEndOfTranslationUnit on them. In this (and any other scenario I can come up with), it is important (or at least better) not to have duplicates in this container. E.g. currently onEndOfTranslationUnit is called repeatedly on the same callback for every matcher that is registered with it. llvm-svn: 249598
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-073-5/+21
| | | | | | | There are still some loose ends here but it's sufficient so we can detect GCC headers that are inside of a VFS. llvm-svn: 249556
* [Tooling] Reuse FileManager in ASTUnit.Benjamin Kramer2015-10-061-3/+3
| | | | | | | | ASTUnit was creating multiple FileManagers and throwing them away. Reuse the one from Tooling. No functionality change now but necessary for VFSifying tooling. llvm-svn: 249410
* clang-format: Make IncludeCategories configurable in .clang-format file.Daniel Jasper2015-10-061-11/+39
| | | | | | | | | This was made much easier by introducing an IncludeCategory struct to replace the previously used std::pair. Also, cleaned up documentation and added examples. llvm-svn: 249392
* Adds a way for tools to deduce the target config from a compiler name.Manuel Klimek2015-10-061-0/+23
| | | | | | | | | | | | | Adds `addTargetAndModeForProgramName`, a utility function that will add appropriate `-target foo` and `--driver-mode=g++` tokens to a command line for driver invocations of the form `a/b/foo-g++`. It is intended to support tooling: for example, should a compilation database record some invocation of `foo-g++` without these implicit flags, a Clang tool may use this function to add them back. Patch by Luke Zarko. llvm-svn: 249391
* [VFS] Transition clang-format to use an in-memory FS.Benjamin Kramer2015-10-061-0/+4
| | | | | | | | | | | 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
* Revert r107690 (for PR7417) and add a testcase that it breaks. The approach ofRichard Smith2015-10-051-6/+0
| | | | | | | | | that change turns out to not be reasonable: mutating the AST of a parsed template during instantiation is not a sound thing to do, does not work across chained PCH / modules builds, and is in any case a special-case workaround to a more general problem that should be solved centrally. llvm-svn: 249342
* Adding an AST node matcher for NonTypeTemplateParmDecl objects.Aaron Ballman2015-10-051-0/+12
| | | | llvm-svn: 249341
* Re-introduce the unique_ptr removed in r249328 and just makeAdrian Prantl2015-10-051-1/+1
| | | | | | | | ~CodeGenABITypes out-of-line, which should have the same effect. Thanks to David Blaikie for pointing this out! llvm-svn: 249336
* Undo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762.Adrian Prantl2015-10-051-1/+2
| | | | | | | | | | include/clang/CodeGenABITypes.h is in meant to be included by external users, but using a unique_ptr on the private CodeGenModule introduces a dependency on the type definition that prevents such a use. NFC llvm-svn: 249328
* Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests ↵Aaron Ballman2015-10-051-0/+14
| | | | | | and documentation. llvm-svn: 249321
* [VFS] Add working directories to every virtual file system.Benjamin Kramer2015-10-051-0/+29
| | | | | | | | | | | | For RealFileSystem this is getcwd()/chdir(), the synthetic file systems can make up one for themselves. OverlayFileSystem now synchronizes the working directories when a new FS is added to the overlay or the overlay working directory is set. This allows purely artificial file systems that have zero ties to the underlying disks. Differential Revision: http://reviews.llvm.org/D13430 llvm-svn: 249316
* [VFS] Add an in-memory file system implementation.Benjamin Kramer2015-10-051-0/+21
| | | | | | | | | | This is a simple file system tree of memory buffers that can be filled by a client. In conjunction with an OverlayFS it can be used to make virtual files accessible right next to physical files. This can be used as a replacement for the virtual file handling in FileManager and which I intend to remove eventually. llvm-svn: 249315
* [VFS] Remove setName from the file interface.Benjamin Kramer2015-10-051-4/+6
| | | | | | | This streamlines the interface a bit and makes Status more immutable. No functional change intended. llvm-svn: 249310
* Add -f[no-]declspec to control recognition of __declspec as a keywordSaleem Abdulrasool2015-10-044-3/+10
| | | | | | | | | | | | | | | In versions of clang prior to r238238, __declspec was recognized as a keyword in all modes. It was then changed to only be enabled when Microsoft or Borland extensions were enabled (and for CUDA, as a temporary measure). There is a desire to support __declspec in Playstation code, and possibly other environments. This commit adds a command-line switch to allow explicit enabling/disabling of the recognition of __declspec as a keyword. Recognition is enabled by default in Microsoft, Borland, CUDA, and PS4 environments, and disabled in all other environments. Patch by Warren Ristow! llvm-svn: 249279
* SourceRanges are small and trivially copyable, don't them by reference.Craig Topper2015-10-049-20/+20
| | | | llvm-svn: 249259
* Diagnose const atomics in __atomic builtins.Eric Fiselier2015-10-041-0/+3
| | | | | | | | | | | Diagnose when a pointer to const T is used as the first argument in at atomic builtin unless that builtin is a load operation. This is already checked for C11 atomics builtins but not for __atomic ones. This patch was given the LGTM by rsmith when it was part of a larger review. (See http://reviews.llvm.org/D10407) llvm-svn: 249252
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-0/+1
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* [Headers][X86] Fix stream_load (movntdqa) to accept const*.Ahmed Bougacha2015-10-021-2/+2
| | | | | | | | | | Per Intel intrinsics guide: - _mm256_stream_load_si256 takes `__m256i const *' - _mm_stream_load_si128 takes `__m128i *', for no good reason. Let's accept const* for both. llvm-svn: 249213
* [WebAssembly] Add a __builtin_wasm_resize_memory() intrinsic.Dan Gohman2015-10-021-0/+1
| | | | llvm-svn: 249179
* [WebAssembly] Add a __builtin_wasm_memory_size() intrinsic.Dan Gohman2015-10-021-0/+1
| | | | llvm-svn: 249176
* constify four getInstantiatedFromMemberTemplate() in DeclTemplate.h.Yaron Keren2015-10-021-4/+4
| | | | llvm-svn: 249159
* [OpenMP] Capture global variables in target regions.Samuel Antao2015-10-022-0/+11
| | | | | | | | | All global variables that are not enclosed in a declare target region must be captured in the target region as local variables do. Currently, there is no support for declare target, so this patch adds support for capturing all the global variables used in a the target region. llvm-svn: 249154
* constify ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember ↵Yaron Keren2015-10-021-4/+4
| | | | | | and VarTemplatePartialSpecializationDecl::getInstantiatedFromMember. llvm-svn: 249152
* [DarwinDriver] Reapply: Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes2015-10-022-0/+3
| | | | | | | | | | | | | | | | | | | | | | Reapply r248935. Usually, when using LTO with a clang installation newer than the system's one, there's a libLTO.dylib version mismatch and LTO fails. One solution to this is to make ld point to the right libLTO.dylib by changing DYLD_LIBRARY_PATH. However, ld64 supports specifying the complete path to the desired libLTO.dylib through the -lto_library option. This commit adds support for the clang driver to use this option whenever it's capable of finding a libLTO.dylib in clang's installed library directory. This way, we don't need to rely on DYLD_LIBRARY_PATH nor get caught by version mismatches. Differential Revision: http://reviews.llvm.org/D13117 rdar://problem/7363476 llvm-svn: 249143
* Implement ACLE 2.0 macros of chapters 6.6 and 6.7 for [ARM] and [Aarch64] ↵Alexandros Lamprineas2015-10-021-0/+1
| | | | | | | | targets. Differential Revision: http://reviews.llvm.org/D12633 llvm-svn: 249140
* Divide TraverseInitListExpr to a different function for each form.Angel Garcia Gomez2015-10-021-17/+25
| | | | | | | | | | | | Summary: create TraverseSyntacticInitListExpr and TraverseSemanticInitListExpr. Reviewers: rsmith, klimek Subscribers: klimek, cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13249 llvm-svn: 249129
* Explicitly delete a function that is supposed to never be called.Richard Smith2015-10-021-1/+1
| | | | llvm-svn: 249113
* Perform Objective-C lifetime adjustments before comparing deduced lambda ↵Douglas Gregor2015-10-011-0/+3
| | | | | | | | | | result types. Objective-C ARC lifetime qualifiers are dropped when canonicalizing function types. Perform the same adjustment before comparing the deduced result types of lambdas. Fixes rdar://problem/22344904. llvm-svn: 249065
OpenPOWER on IntegriCloud