summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [index] USR generation: use getTemplateArgs() instead of ↵Argyrios Kyrtzidis2017-02-151-2/+2
| | | | | | | | getTemplateInstantiationArgs() Otherwise we may end up creating a different USR for the definition of a function, vs its declaration. llvm-svn: 295191
* [analyzer] Proper caching in CallDescription objects.Gabor Horvath2017-02-151-2/+5
| | | | | | | | During the review of D29567 it turned out the caching in CallDescription is not implemented properly. In case an identifier does not exist in a translation unit, repeated identifier lookups will be done which might have bad impact on the performance. This patch guarantees that the lookup is only executed once. Moreover this patch fixes a corner case when the identifier of CallDescription does not exist in the translation unit and the called function does not have an identifier (e.g.: overloaded operator in C++). Differential Revision: https://reviews.llvm.org/D29884 llvm-svn: 295186
* Fix spelling mistake - paramater -> parameter. NFCI.Simon Pilgrim2017-02-153-4/+4
| | | | llvm-svn: 295183
* Use dedicated method instead of copying conditions. NFC.Serge Pavlov2017-02-151-1/+1
| | | | llvm-svn: 295172
* Removed stale comment. NFC.Serge Pavlov2017-02-151-2/+0
| | | | | | | The case of extern inline functions in GNU89 mode is now handled in `canRedefineFunction`, which has appropriate comment. llvm-svn: 295167
* [XRAY][MIPS] Add -fxray-instrument for mips/mipsel/mips64/mips64elSagar Thakur2017-02-151-0/+4
| | | | | | | | | Summary: Adds xray instrument option for mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27698 llvm-svn: 295163
* Add a definition for __STRUCT_PARM_ALIGN__ for elfv2 and 64-bit darwin ↵Eric Christopher2017-02-151-0/+5
| | | | | | platforms to match what other compilers produce. llvm-svn: 295156
* [Sema] Disallow returning a __block variable via a move.Akira Hatanaka2017-02-151-3/+5
| | | | | | | | | | | | | | | r274291 made changes to prefer calling a move constructor to calling a copy constructor when returning from a function. This caused programs to crash when a __block variable in the heap was moved out and used later. This commit fixes the bug by disallowing moving out of __block variables implicitly. rdar://problem/28181080 Differential Revision: https://reviews.llvm.org/D29908 llvm-svn: 295150
* Fix assertion failure due to implicit special member lookup lacking a source ↵Richard Smith2017-02-151-4/+7
| | | | | | location. llvm-svn: 295149
* Speculatively revert r295118 to see if it's what's causing the modules ↵Richard Smith2017-02-151-4/+2
| | | | | | selfhost buildbots to fail. llvm-svn: 295146
* Don't look for GCC versions in /usr/lib/<triple> except when <triple> is aRichard Smith2017-02-151-4/+5
| | | | | | | | | | freescale triple. On multiarch systems, this previously caused us to stat every file in /usr/lib/<triple> (typically several thousand files). This change halves the runtime of a clang invocation on an empty file on my system. llvm-svn: 295140
* Refactor GCC lib directory detection to make it easier to add lib directoriesRichard Smith2017-02-151-34/+45
| | | | | | that are only checked for some targets. llvm-svn: 295139
* Remove unused variable. No functional change.Richard Trieu2017-02-141-1/+1
| | | | llvm-svn: 295125
* [VLA] Handle VLA size expression in a full-expression context.Tim Shen2017-02-142-2/+11
| | | | | | | | | | | | | | | | Summary: Previously the cleanups (e.g. dtor calls) are inserted into the outer scope (e.g. function body scope), instead of it's own scope. After the fix, the cleanups are inserted right after getting the size value. This fixes pr30306. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24333 llvm-svn: 295123
* Stop asserting when a meaningless -std= flag is passed for a non-compilationRichard Smith2017-02-141-2/+2
| | | | | | input kind; go back to silently ignoring the flag. llvm-svn: 295122
* Do not implicitly instantiate the definition of a class template specializationRichard Smith2017-02-141-2/+4
| | | | | | | | | | | | | | | that has been explicitly specialized! We assume in various places that we can tell the template specialization kind of a class type by looking at the declaration produced by TagType::getDecl. That was previously not quite true: for an explicit specialization, we could have first seen a template-id denoting the specialization (with a use that does not trigger an implicit instantiation of the defintiion) and then seen the first explicit specialization declaration. TagType::getDecl would previously return an arbitrary declaration when called on a not-yet-defined class; it now consistently returns the most recent declaration in that case. llvm-svn: 295118
* Improve diagnostic reporting when using __declspec without enabling ↵Aaron Ballman2017-02-141-0/+25
| | | | | | | | __declspec as a keyword. Fixes PR31936. llvm-svn: 295114
* [Driver] Report available language standards on user errorRichard Smith2017-02-141-49/+83
| | | | | | | | | In case user did not provide valid standard name for -std option, available values (with short description) will be reported. Patch by Paweł Żukowski! llvm-svn: 295113
* MS inline asm: Filter MXCSR out of the inferred clobber listReid Kleckner2017-02-141-4/+5
| | | | | | | Since r295004, LLVM has started modelling this new register, but we don't have GCC constraint inline asm spellings for it yet. llvm-svn: 295107
* Remove unnecessary std::string constructionReid Kleckner2017-02-141-3/+2
| | | | llvm-svn: 295083
* Fix some warnings in intrin.hReid Kleckner2017-02-141-4/+6
| | | | llvm-svn: 295082
* [CodeGen][ObjC] Use the type of the captured field of the enclosingAkira Hatanaka2017-02-141-12/+17
| | | | | | | | | | | | | | | | block or lambda. This is a follow-up to r281682, which fixed a bug in computeBlockInfo where the captured VarDecl's type, rather than the captured field type of the enclosing lambda or block, was used to compute the layout of a block. This commit makes similar changes to enterBlockScope. This is necessary to correctly determine whether a block capture requires cleanup. rdar://problem/30388124 llvm-svn: 295034
* Delete useless / in comment. NFC.George Burgess IV2017-02-141-1/+1
| | | | llvm-svn: 295032
* Add a destruct-on-exit function to ASTContext.George Burgess IV2017-02-142-27/+5
| | | | | | | | | | | | | | It looks like the only use of AddDeallocation is to indirectly call the destructors of objects. In one case I found (TypeAliasTemplateDecl::Common), the destructor is a nop, so registering it to run later seems pointless. All of the other *::Common types have non-trivial dtors, so deleting the useless AddDeallocation felt somewhat fragile. Happy to kill it + turn the is_trivial_dtor check into a static_assert if people think that'd be better. llvm-svn: 295029
* Canonicalize implicit deduction guide parameter types when forming a deductionRichard Smith2017-02-141-9/+19
| | | | | | | | | | | | guide from a constructor. The purpose of this change is to avoid triggering instantiation of the class when substituting back into the deduction guide if it uses a typedef member. We will still instantiate the class if the constructor (explicitly or implicitly, directly or indirectly) uses the current instantiation in a way that we can't canonicalize out, but that seems unavoidable. llvm-svn: 295016
* [c++1z] Add some more tests for class template argument deduction, addRichard Smith2017-02-141-0/+2
| | | | | | feature-test macro, and mark feature as done on status page. llvm-svn: 295011
* [MS ABI] Correctly mangling vbase destructorsDavid Majnemer2017-02-141-11/+22
| | | | | | | | | | | | | They are a little bit of a special case in the mangling. They are always mangled without taking into account their virtual-ness of the destructor. They are also mangled to return void, unlike the actual destructor. This fixes PR31931. Differential Revision: https://reviews.llvm.org/D29912 llvm-svn: 295010
* [c++1z] Synthesize implicit deduction guides from constructors on demand. RankRichard Smith2017-02-147-100/+496
| | | | | | | | | | | | | | | | | | | such guides below explicit ones, and ensure that references to the class's template parameters are not treated as forwarding references. We make a few tweaks to the wording in the current standard: 1) The constructor parameter list is copied faithfully to the deduction guide, without losing default arguments or a varargs ellipsis (which the standard wording loses by omission). 2) If the class template declares no constructors, we add a T() -> T<...> guide (which will only ever work if T has default arguments for all non-pack template parameters). 3) If the class template declares nothing that looks like a copy or move constructor, we add a T(T<...>) -> T<...> guide. #2 and #3 follow from the "pretend we had a class type with these constructors" philosophy for deduction guides. llvm-svn: 295007
* When the new expr's array size is an ICE, emit it as a constant expression.Nick Lewycky2017-02-131-1/+4
| | | | | | This bypasses integer sanitization checks which are redundant on the expression since it's been checked by Sema. Fixes a clang codegen assertion on "void test() { new int[0+1]{0}; }" when building with -fsanitize=signed-integer-overflow. llvm-svn: 295006
* [CodeCompletion] Code complete the '__auto_type' keywordAlex Lorenz2017-02-131-2/+3
| | | | | | rdar://29219185 llvm-svn: 295003
* [CodeCompletion] Code complete the missing C++11 keywordsAlex Lorenz2017-02-133-17/+92
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds context sensitive code completion support for the C++11 keywords that currently don't have completion results. The following keywords are supported by this patch: alignas constexpr static_assert noexcept (as a function/method qualifier) thread_local The following special identifiers are also supported: final (as a method qualifier or class qualifier) override rdar://29219185 Differential Revision: https://reviews.llvm.org/D28286 llvm-svn: 295001
* [CodeGen] Treat auto-generated __dso_handle symbol as HiddenVisibilityReid Kleckner2017-02-131-1/+3
| | | | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=31932 Based on a patch by Roland McGrath Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D29843 llvm-svn: 294978
* [ASTUnit] Clear out diagnostic state after creating the preamble.Benjamin Kramer2017-02-131-0/+2
| | | | | | | | If the preamble had diagnostic state this would leave behind invalid state in the DiagnosticsEngine and crash later. The test case runs into an assertion in DiagnosticsEngine::setSourceManager. llvm-svn: 294963
* [PM] Add support for instrumented PGO in the new pass manager (clang-side)Davide Italiano2017-02-131-2/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D29309 llvm-svn: 294961
* [coroutines] NFC: Refactor Sema::CoroutineBodyStmt construction.Gor Nishanov2017-02-132-78/+184
| | | | | | | | | | | | | | | | | | | Summary: Sema::CheckCompletedCoroutineBody was growing unwieldy with building all of the substatements. Also, constructors for CoroutineBodyStmt had way too many parameters. Instead, CoroutineBodyStmt now defines CtorArgs structure with all of the required construction parameters. CheckCompleteCoroutineBody delegates construction of individual substatements to short functions one per each substatement. Also, added a drive-by fix of initializing CoroutinePromise to nullptr in ScopeInfo.h. And addressed the FIXME that wanted to tail allocate extra room at the end of the CoroutineBodyStmt to hold parameter move expressions. (The comment was longer that the code that implemented tail allocation). Reviewers: rsmith, EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D28835 llvm-svn: 294933
* Revert r294910 and recommit r294861 and r294862 with a target triple to ↵Aaron Ballman2017-02-121-4/+5
| | | | | | hopefully appease the bots. llvm-svn: 294911
* Revert "Attributes on K&R C functions should not cause incompatible..."Renato Golin2017-02-121-5/+4
| | | | | | | | | | | | | | | | ...function type with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype." Also Revert "Hopefully fixes a compile error introduced by r294861." This reverts commit r294862, r294861, as they bork the ARM builds and haven't fix it back. Also, please, short commit titles, long commit decsriptions... llvm-svn: 294910
* ASTReader: Refactor common code for writing function definitions, to match ↵David Blaikie2017-02-121-17/+15
| | | | | | the writing code llvm-svn: 294904
* [Driver] Use stem() and not filename().Davide Italiano2017-02-111-1/+1
| | | | | | | | | | On Windows the filename might have an extension, namely `.exe`, so the search will fail. Sorry, I don't have a good way to test this as it seems to fail only in some weird configurations. r284430 has the same modification for Fuchsia. llvm-svn: 294879
* CodeGen: use # as the comment leader for ARC markerSaleem Abdulrasool2017-02-111-1/+1
| | | | | | | | | | Use # as the comment leader for AArch64 auto-release elision marker. This is to keep it in sync with the value used in swift. When building libdispatch for Linux AArch64, the auto-release elision marker was emitted. However, ELF uses # as the comment leader while MachO accepts both ; and #. Use the common marker for it instead. llvm-svn: 294877
* CodeGen: annotate ObjC ARC functions with ABI constraintsSaleem Abdulrasool2017-02-111-0/+23
| | | | | | | | | | | | | | | | Certain ARC runtime functions have an ABI contract of being forwarding. Annotate the functions with the appropriate `returned` attribute on the arguments. This hoists some of the runtime ABI contract information into the frontend rather than the backend transformations. The test adjustments are to mark the returned function parameter as such. The minor change to the IR output is due to the fact that the returned reference of the object causes it to extend the lifetime of the object by returning an autoreleased return value. The result is that the explicit objc_autorelease call is no longer formed, as autorelease elision is now possible on the return. llvm-svn: 294872
* [AVR] Fix __AVR_xxx macro definitions; authored by Peter WuDylan McKay2017-02-111-238/+238
| | | | | | | | | | | | | | | | | | Summary: The -mmcu option for GCC sets macros like __AVR_ATmega328P__ (with the trailing underscores), be sure to include these underscores for Clangs -mcpu option. See "AVR Built-in Macros" in https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html Reviewers: jroelofs, dylanmckay Reviewed By: jroelofs, dylanmckay Subscribers: efriedma, cfe-commits Differential Revision: https://reviews.llvm.org/D29817 llvm-svn: 294869
* Attributes on K&R C functions should not cause incompatible function type ↵Aaron Ballman2017-02-111-4/+5
| | | | | | | | with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype. This patch fixes PR31020. llvm-svn: 294861
* docs: update docs for objc_storeStrong behaviourSaleem Abdulrasool2017-02-111-1/+1
| | | | | | objc_storeStrong does not return a value. llvm-svn: 294855
* CodeGen: rename variables to adhere to naming conventionSaleem Abdulrasool2017-02-111-9/+10
| | | | | | Adjust style before making more intrusive changes. NFC. llvm-svn: 294854
* Sema: simplify conditional execution (NFC)Saleem Abdulrasool2017-02-111-4/+1
| | | | | | | The conditional cast is unnecessary since we know that it will always succeed. NFC. llvm-svn: 294853
* Make helpers static. NFC.Benjamin Kramer2017-02-112-2/+4
| | | | llvm-svn: 294838
* Don't let EvaluationModes dictate whether an invalid base is OKGeorge Burgess IV2017-02-101-37/+57
| | | | | | | | | | | | What we want to actually control this behavior is something more local than an EvalutationMode. Please see the linked revision for more discussion on why/etc. This fixes PR31843. Differential Revision: https://reviews.llvm.org/D29469 llvm-svn: 294800
* [c++1z] Diagnose attempts to use variables with deduced class templateRichard Smith2017-02-104-9/+7
| | | | | | specialization types from within their own initializers. llvm-svn: 294796
* [c++1z] Require an initializer for deduced class template specialization types.Richard Smith2017-02-101-9/+9
| | | | | | | | It's actually meaningful and useful to allow such variables to have no initializer, but we are strictly following the standard here until the C++ committee reaches consensus on allowing this. llvm-svn: 294785
OpenPOWER on IntegriCloud