summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the correct alignment for uuid descriptorsDavid Majnemer2016-03-271-2/+2
| | | | | | | The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit builds: we should do the same if the linker picks the "wrong" COMDAT. llvm-svn: 264530
* Improve the representation of CXXUuidofExprDavid Majnemer2016-03-274-89/+59
| | | | | | | | Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to. This makes translating from __uuidof to the underlying constant a lot more straightforward. llvm-svn: 264529
* [NFC] Tweak diagnostic for template template arguments, to include template ↵Faisal Vali2016-03-261-2/+2
| | | | | | | | aliases. The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias. The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases. llvm-svn: 264522
* Check if a path is already absolute before trying to make it so.Bob Wilson2016-03-261-0/+3
| | | | | | | | | | | | The FileSystem::makeAbsolute function has been calculating the current working directory unconditionally, even when it is not needed. This calls down to llvm::sys::fs::current_path, which is relatively expensive because it stats two directories, regardless of whether those paths are already in the stat cache. The net effect is that when using the VFS, every stat during header search turns into three stats. With this change, we get back to a single stat for absolute directory paths. llvm-svn: 264519
* [Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier ↵Faisal Vali2016-03-264-10/+98
| | | | | | | | | | | | | | | | | | | | | | (and its inference) on lambda expressions Support the constexpr specifier on lambda expressions - and support its inference from the lambda call operator's body. i.e. auto L = [] () constexpr { return 5; }; static_assert(L() == 5); // OK auto Implicit = [] (auto a) { return a; }; static_assert(Implicit(5) == 5); We do not support evaluation of lambda's within constant expressions just yet. Implementation Strategy: - teach ParseLambdaExpressionAfterIntroducer to expect a constexpr specifier and mark the invented function call operator's declarator's decl-specifier with it; Have it emit fixits for multiple decl-specifiers (mutable or constexpr) in this location. - for cases where constexpr is not explicitly specified, have buildLambdaExpr check whether the invented function call operator satisfies the requirements of a constexpr function, by calling CheckConstexprFunctionDecl/Body. Much obliged to Richard Smith for his patience and his care, in ensuring the code is clang-worthy. llvm-svn: 264513
* Don't warn on "use" of undefined inline function that isn't actually an ODRRichard Smith2016-03-251-15/+16
| | | | | | | | use. In order for this to fire, the function needed to be a templated function marked 'constexpr' and declared but not defined. This weird pattern appears in libstdc++'s alloc_traits.h. llvm-svn: 264471
* Store list of undefined-but-used objects in a deterministic order to fixRichard Smith2016-03-253-29/+14
| | | | | | | | non-deterministic diagnostics (and non-deterministic PCH files). Check these when building a module rather than serializing it; it's not reasonable for a module's use to be satisfied by a definition in the user of the module. llvm-svn: 264466
* Delete dead variable.Richard Smith2016-03-251-3/+1
| | | | llvm-svn: 264464
* [analyzer] Add CIFIlter modeling to DeallocChecker.Devin Coughlin2016-03-251-10/+56
| | | | | | | | | | | | | | | | | | | | The -dealloc method in CIFilter is highly unusual in that it will release instance variables belonging to its *subclasses* if the variable name starts with "input" or backs a property whose name starts with "input". Subclasses should not release these ivars in their own -dealloc method -- doing so could result in an over release. Before this commit, the DeallocChecker would warn about missing releases for such "input" properties -- which could cause users of the analyzer to add over releases to silence the warning. To avoid this, DeallocChecker now treats CIFilter "input-prefixed" ivars as MustNotReleaseDirectly and so will not require a release. Further, it will now warn when such an ivar is directly released in -dealloc. rdar://problem/25364901 llvm-svn: 264463
* [index] Remove redundancy between symbol kind and languageBen Langmuir2016-03-251-45/+44
| | | | | | | | | Condense the ObjCKIND and CXXKIND options into just KIND, since the language was already specified on a per-symbol basis and this information was redundant. This only changes the internal representation; naturally the libclang interface remains the same. llvm-svn: 264423
* [ASTMatchers] Add own version of VariadicFunction.Samuel Benzaquen2016-03-251-5/+6
| | | | | | | | | | | | | | | | Summary: llvm::VariadicFunction is only being used by ASTMatchers. Having our own copy here allows us to remove the other one from llvm/ADT. Also, we can extend the API to meet our needs without modifying the common implementation. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D18275 llvm-svn: 264417
* [modules] Store a local offset to DeclContext lexical and visible contents. ↵Richard Smith2016-03-252-9/+18
| | | | | | Saves a few bytes for each primary DeclContext. llvm-svn: 264377
* CGLoopInfo: Use the MD_loop metadata kind from r264371, NFCDuncan P. N. Exon Smith2016-03-251-1/+1
| | | | | | | Besides a small compile-time speedup, there should be no real functionality change here. llvm-svn: 264372
* Fix nondeterminism in computation of builtin operator overload sets.Richard Smith2016-03-251-3/+4
| | | | llvm-svn: 264363
* [modules] Store offset to LOCAL_REDECLARATIONS record relative to the currentRichard Smith2016-03-242-6/+13
| | | | | | | | record rather than relative to the start of the bitcode file. Saves a couple of bytes per LOCAL_REDECLARATIONS record (also makes diffs of llvm-bcanalyzer output more useful when tracking down nondeterminism...). llvm-svn: 264359
* Attach profile summary information to Module.Easwaran Raman2016-03-241-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18289 llvm-svn: 264342
* Revert "Recommitted r263425 "Supporting all entities declared in lexical ↵Reid Kleckner2016-03-243-59/+14
| | | | | | | | | | | scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)." This reverts commit r264281. This change breaks building Chromium for iOS. We'll upload a reproducer to the PR soon. llvm-svn: 264333
* Change ADL to produce lookup results in a deterministic order. This fixes someRichard Smith2016-03-241-2/+2
| | | | | | | rare issues with nondeterministic diagnostic order, and some very common issues with nondeterministic module builds. llvm-svn: 264323
* Fix a missing comma between two string literals.Etienne Bergeron2016-03-241-1/+1
| | | | | | | | | | | | | | | | | Summary: The two literals are currently appended. I'm not sure what was broken by this. Please double check carefully. Silly bug found by an on-going checker for clang-tidy. Reviewers: alexfh, arsenm, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18454 llvm-svn: 264315
* Recommitted r263425 "Supporting all entities declared in lexical scope in ↵Amjad Aboud2016-03-243-14/+59
| | | | | | | | | | LLVM debug info." After fixing PR26942 (the fix is included in this commit). Differential Revision: http://reviews.llvm.org/D18350 llvm-svn: 264281
* Added support for different VFSs in format::getStyle. Disable ↵Eric Liu2016-03-241-8/+17
| | | | | | platform-related test case for MS compilers to avoid breaking buildbot. llvm-svn: 264277
* Revert "Added support for different VFSs in format::getStyle."Eric Liu2016-03-241-17/+7
| | | | | | This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203 llvm-svn: 264276
* Revert "removed redundant comment in format::getStyle."Eric Liu2016-03-241-7/+17
| | | | | | This reverts commit r264254. llvm-svn: 264275
* Revert "Added support for different VFSs in format::getStyle."Eric Liu2016-03-241-17/+7
| | | | | | This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203 llvm-svn: 264257
* Revert "removed redundant comment in format::getStyle."Eric Liu2016-03-241-1/+2
| | | | | | This reverts commit r264254. llvm-svn: 264256
* removed redundant comment in format::getStyle.Eric Liu2016-03-241-2/+1
| | | | llvm-svn: 264254
* Added support for different VFSs in format::getStyle.Eric Liu2016-03-241-7/+17
| | | | | | | | | | | | | | | | Summary: Previously, format::getStyle assumes that the given file resides in the real file system, which prevents the use of virtual file system in testing etc. This patch adds a parameter in format::getStyle interface so that users can specify the right file system. By default, the file system is the real file system. Reviewers: djasper, klimek Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D18399 llvm-svn: 264253
* Test commit access to clang repo.Eric Liu2016-03-241-0/+1
| | | | | | | | | | | | Summary: Test commit access to clang repo. Reviewers: cfe-commits Subscribers: klimek Differential Revision: http://reviews.llvm.org/D18432 llvm-svn: 264252
* [OpenCL] Add ocl and spir version for spir targetXiuli Pan2016-03-241-0/+44
| | | | | | | | | | | | Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits, pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D17596 llvm-svn: 264241
* The time when -faltivec (or, on clang only, -maltivec) will magicallyEric Christopher2016-03-241-4/+0
| | | | | | | | | include altivec.h has come and gone. Rationale: This causes modules, rewrite-includes, etc to be sad and people should just include altivec.h in their source. llvm-svn: 264235
* Modules builds are necessarily compile actions, but they don'tEric Christopher2016-03-241-1/+1
| | | | | | | necessarily produce object files. Turn off split dwarf if we're not producing a file that the driver believes is an object file. llvm-svn: 264227
* NFC: clarify comment on lock-free macrosJF Bastien2016-03-241-1/+1
| | | | | | Used by both libstdc++ and libc++. llvm-svn: 264226
* clang-cl: Add a FIXME for bumping the default msc version.Nico Weber2016-03-231-0/+1
| | | | llvm-svn: 264216
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-231-1/+9
| | | | | | | | | | | Remove tests that have neither a triple nor an explicit -fmsc-version flag, since in the absence of an -fmsc-version flag, the implicit value of the flag is 17 (MSVC2013) with MSVC triples but 0 (not set) for other triples, and the default triple is platform dependent. This relands r263974 with a test fix. llvm-svn: 264210
* [CUDA] Don't define __NVCC__.Justin Lebar2016-03-231-1/+0
| | | | | | | | | | | | | | | | | | | | | Summary: We decided this makes life too difficult for code authors. For example, people may want to detect NVCC and disable variadic templates, which NVCC does not support, but which we do. Since people are going to have to change compiler flags *anyway* in order to compile with clang, if they really want the old behavior, they can pass -D__NVCC__. Tested with tensorflow and thrust, no apparent problems. Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18417 llvm-svn: 264205
* Add missing __builtin_bitreverse8Matt Arsenault2016-03-231-0/+1
| | | | | | Also add documentation for bitreverse builtins llvm-svn: 264203
* ObjC: add getter/setter for class properties to global pool.Manman Ren2016-03-231-0/+5
| | | | | | rdar://problem/25323072 llvm-svn: 264196
* Make SemaAccess smarter about determining when a dependent class mightRichard Smith2016-03-231-10/+5
| | | | | | | instantiate to match a friend class declaration. It's still pretty dumb, though. llvm-svn: 264189
* Make sure to perform dependent access checks when instantiating aRichard Smith2016-03-232-12/+12
| | | | | | | | lambda-expression. We don't actually instantiate the closure type / operator() in the template in order to produce the closure type / operator() in the instantiation, so this isn't caught by the normal path. llvm-svn: 264184
* clang-cl: Fix remaining bugs in interaction of /Yc and /FI /showIncludes.Nico Weber2016-03-232-30/+31
| | | | | | | | | | Instead of putting the /Yc header into ExtraDeps, give DependencyOutputOptions a dedicated field for /Yc mode, and let HeaderIncludesCallback hang on to the full DependencyOutputOptions object, not just ExtraDeps. Reverts parts of r263352 that are now no longer needed. llvm-svn: 264182
* clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.Nico Weber2016-03-231-2/+4
| | | | | | | | | | | | Most things even work; see the included FIXMEs for things that need polishing. Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`. The common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h is in the PCH, and we shouldn't warn about /FIh1.h not having an effect. (If we wanted to get fancy, we could store the list of -include flags in the pch and then check that it matches later on.) llvm-svn: 264178
* clang-cl: Include /FI headers in /showIncludes output.Nico Weber2016-03-233-9/+16
| | | | | | | | | | | | | | | | | -H in gcc mode doesn't print -include headers, but they are included in depfiles written by MMD and friends. Since /showIncludes is what's used instead of depfiles, printing /FI there seems important (and matches cl.exe). Instead of giving HeaderIncludeGen more options, just switch on ShowAllHeaders in clang-cl mode and let clang::InitializePreprocessor() not put -include flags in the <command line> block. This changes the behavior of -E slightly, and it removes the <command line> flag from the output triggered by setting the obscure CC_PRINT_HEADERS=1 env var to true while running clang. Both of these seem ok to change. http://reviews.llvm.org/D18401 llvm-svn: 264174
* [NFC] Delete an unused function parameter from a static function Faisal Vali2016-03-231-3/+2
| | | | llvm-svn: 264170
* ObjC: Handle boolean fixed type for enum.Manman Ren2016-03-231-1/+4
| | | | | | | | | | | | | Before this commit, we assert failure in ImplicitCastExpr "unheralded conversion to bool". This commit fixes the assertion by using the correct cast type when the fixed type is boolean. This commit also fixes the behavior for Microsoft mode as well, since Obj-C and Microsoft mode share the same code path. rdar://24999533 llvm-svn: 264167
* [analyzer] Fix typo s/initalize/initialize/Chih-Hung Hsieh2016-03-231-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18363 llvm-svn: 264164
* clang-cl: Don't warn about /Oy- being unused in 64-bit builds.Nico Weber2016-03-231-0/+6
| | | | | | http://reviews.llvm.org/D18392 llvm-svn: 264163
* Use an enum instead of hardcoded indices. NFC.Alexander Kornienko2016-03-231-7/+11
| | | | llvm-svn: 264158
* [X86] Add "x87" in x86 target feature map.Andrey Turetskiy2016-03-231-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D13980 llvm-svn: 264149
* [Sema] Allow implicit conversions of &overloaded_fn in C.George Burgess IV2016-03-231-11/+20
| | | | | | | | | | | | | | | | | | | | | | | Also includes a minor ``enable_if`` docs update. Currently, our address-of overload machinery will only allow implicit conversions of overloaded functions to void* in C. For example: ``` void f(int) __attribute__((overloadable)); void f(double) __attribute__((overloadable, enable_if(0, ""))); void *fp = f; // OK. This is C and the target is void*. void (*fp2)(void) = f; // Error. This is C, but the target isn't void*. ``` This patch makes the assignment of `fp2` select the `f(int)` overload, rather than emitting an error (N.B. you'll still get a warning about the `fp2` assignment if you use -Wincompatible-pointer-types). Differential Revision: http://reviews.llvm.org/D13704 llvm-svn: 264132
* [CUDA] Don't allow templated variadic functions.Justin Lebar2016-03-221-22/+22
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18373 llvm-svn: 264106
OpenPOWER on IntegriCloud