summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Refactor indentation behavior for multiple nested blocks.Daniel Jasper2014-06-034-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a few oddities when formatting multiple nested JavaScript blocks, e.g.: Before: promise.then( function success() { doFoo(); doBar(); }, [], function error() { doFoo(); doBaz(); }); promise.then([], function success() { doFoo(); doBar(); }, function error() { doFoo(); doBaz(); }); After: promise.then( function success() { doFoo(); doBar(); }, [], function error() { doFoo(); doBaz(); }); promise.then([], function success() { doFoo(); doBar(); }, function error() { doFoo(); doBaz(); }); llvm-svn: 210097
* [OPENMP] Loop canonical form analysis (Sema)Alexander Musman2014-06-035-18/+515
| | | | | | | | | This patch implements semantic analysis to make sure that the loop is in OpenMP canonical form. This is the form required for 'omp simd', 'omp for' and other loop pragmas. Differential revision: http://reviews.llvm.org/D3778 llvm-svn: 210095
* Remove incorrect assertion.Richard Smith2014-06-031-4/+3
| | | | llvm-svn: 210092
* Implement DR990 and DR1070. Aggregate initialization initializes uninitializedRichard Smith2014-06-032-84/+121
| | | | | | | | | elements from {}, rather than value-initializing them. This permits calling an initializer-list constructor or constructing a std::initializer_list object. (It would also permit initializing a const reference or rvalue reference if that weren't explicitly prohibited by other rules.) llvm-svn: 210091
* Teach AST dumper to dump the array filler in an initializer list.Richard Smith2014-06-031-0/+17
| | | | llvm-svn: 210090
* PR11410: Extend diagnostic to cover all cases of aggregate initialization, notRichard Smith2014-06-031-5/+5
| | | | | | | | | | just the extremely specific case of a trailing array element that couldn't be initialized because the default constructor for the element type is deleted. Also reword the diagnostic to better match our other context diagnostics and to prepare for the implementation of core issue 1070. llvm-svn: 210083
* When emitting a multidimensional array new, emit the initializers for theRichard Smith2014-06-032-137/+173
| | | | | | | | | trailing elements as a single loop, rather than sometimes emitting a nest of several loops. This fixes a bug where CodeGen would sometimes try to emit an expression with the wrong type for the element being initialized. Plus various other minor cleanups to the IR produced for array new initialization. llvm-svn: 210079
* Don't assume an implicit IntrusiveRefCntPtr -> bool operator.Rafael Espindola2014-06-031-1/+1
| | | | llvm-svn: 210075
* Update for llvm API change.Rafael Espindola2014-06-032-40/+55
| | | | | | Aliases in llvm now hold an arbitrary expression. llvm-svn: 210063
* Fix -emit-codegen-only to not generate binariesAlp Toker2014-06-031-0/+1
| | | | llvm-svn: 210059
* Eliminate redundant MangleBuffer classAlp Toker2014-06-034-16/+13
| | | | | | | | | The only remaining user didn't actually use the non-dynamic storage facility this class provides. The std::string is transitional and likely to be StringRefized shortly. llvm-svn: 210058
* Itanium ABI: Update getAddrOfVTable to set the DLL storage class for vtablesHans Wennborg2014-06-021-0/+6
| | | | | | | | This corresponds to the same change for the MS ABI in r209908. Differential Revision: http://reviews.llvm.org/D3993 llvm-svn: 210054
* Delete apparently unused methodAlexey Samsonov2014-06-022-29/+0
| | | | llvm-svn: 210047
* [CodeGen] Don't use SizeTy for EmitNeonSplat.Michael J. Spencer2014-06-021-1/+1
| | | | llvm-svn: 210042
* Remove unused variableAlexey Samsonov2014-06-021-2/+0
| | | | llvm-svn: 210041
* Fix comment vs function name mismatchHans Wennborg2014-06-021-1/+1
| | | | llvm-svn: 210039
* Remove sanitizer blacklist from ASan/TSan/MSan function passes.Alexey Samsonov2014-06-021-9/+5
| | | | | | | | | | | | | | | | | Instrumentation passes now use attributes address_safety/thread_safety/memory_safety which are added by Clang frontend. Clang parses the blacklist file and adds the attributes accordingly. Currently blacklist is still used in ASan module pass to disable instrumentation for certain global variables. We should fix this as well by collecting the set of globals we're going to instrument in Clang and passing it to ASan in metadata (as we already do for dynamically-initialized globals and init-order checking). This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline flags in favor of -fsanitize-blacklist= Clang flag. llvm-svn: 210037
* CGDebugInfo: Simplify/invert createLexicalBlock parameter construction.David Blaikie2014-06-021-8/+5
| | | | llvm-svn: 210033
* The exception-declaration for a function-try-block cannot redeclare aAaron Ballman2014-06-021-4/+8
| | | | | | | function parameter. One of our existing test cases was XFAILed because of this. This fixes the issue and un-XFAILs the test. llvm-svn: 210026
* clang-format: Fix special case of binary operator detection.Daniel Jasper2014-06-021-0/+6
| | | | | | | | | | | | | | | | | There is a pattern where evaluation order is used as control flow. This patch special-cases a commonly occuring version of this pattern. Before: Aaaaa *aaa = nullptr; // ... aaa &&aaa->f(); After: Aaaaa *aaa = nullptr; // ... aaa && aaa->f(); llvm-svn: 210017
* clang-format: No space between ")" and braced init list.Daniel Jasper2014-06-021-1/+2
| | | | | | | | | | | | Before: auto j = decltype(i) {}; After: auto j = decltype(i){}; This fixes llvm.org/PR19892. llvm-svn: 210013
* clang-format: Fix Allman brace breaking of enums.Daniel Jasper2014-06-021-4/+9
| | | | | | | | | | | | | | | | | | Before: enum Side { LEFT, RIGHT }; After: enum Side { LEFT, RIGHT }; This fixes llvm.org/PR19911. llvm-svn: 210011
* clang-format: Fix trailing const (etc.) with Allman brace style.Daniel Jasper2014-06-021-2/+2
| | | | | | | | | | | | | | | | | | Before: void someLongFunction(int someLongParameter) const { } After: void someLongFunction( int someLongParameter) const { } This fixes llvm.org/PR19912. llvm-svn: 210010
* Don't compare an error_code with nullptr.Rafael Espindola2014-06-011-1/+1
| | | | llvm-svn: 209993
* Fix PR18498: Support explicit template arguments with variadic generic lambdasFaisal Vali2014-06-011-1/+11
| | | | | | | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=18498 This code was resulting in a crash: auto L = [](auto ... v) { }; L.operator()<int>(3); The reason is that the partially-substituted-pack is incorrectly retained within the current-instantiation-scope during template-argument-finalization, and because lambda's are local, there parent instantiation scopes are merged, which leads to the expansion-pattern being retained in the finalized specialization. This patch ensures that once we have finalized deduction of a parameter-pack, we remove the partially-substituted-pack so that it doesn't cause CheckParameterPacksForExpansion to incorrectly inform the caller that it needs to retain the expansion pattern. Thanks to Richard Smith for the review! http://reviews.llvm.org/D2135 llvm-svn: 209992
* Preprocessor: make C++ operator names as macro identifiers a compatible ↵Alp Toker2014-05-311-5/+6
| | | | | | | | | | | extension With recent changes, this is now a compatible language extension and can be safely enabled with -ms-extensions instead of requiring the full -ms-compatibility MSVC drop-in mode. As such we can now also emit an extension warning under -Wmicrosoft to help users port their code. llvm-svn: 209978
* Rename utility function templatesAlp Toker2014-05-311-6/+6
| | | | | | | isExternCTemplate() and getLanguageLinkageTemplate() have nothing to do with templates despite the dubious naming scheme. llvm-svn: 209969
* Format strings: check against an enum's underlying type.Jordan Rose2014-05-311-11/+18
| | | | | | | | | | | | | This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> llvm-svn: 209966
* AST Dump: print the Inherited flag on attributesHans Wennborg2014-05-311-1/+3
| | | | | | | | | Also move the attribute-specific dumping to after dumping this and the Implicit flag. Differential Revision: http://reviews.llvm.org/D3971 llvm-svn: 209965
* Preprocessor: recover gracefully when C++ operator names are used as macro ↵Alp Toker2014-05-311-3/+4
| | | | | | | | | | identifiers This failure mode shows up occasionally when users try to include C headers in C++ projects or when porting from Windows. We might as well recover in the way the user expected, thus avoiding confusing diagnostic messages at point of use. llvm-svn: 209963
* Preprocessor: don't exit early in CheckMacroName()Alp Toker2014-05-311-10/+7
| | | | | | | | | | The checks below can hypothetically apply to converted operator name identifiers. In practice there are no builtin macros etc. with those names so there's no behavioural change to test. llvm-svn: 209962
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-313-4/+3
| | | | llvm-svn: 209959
* Use make_error_code in preparation for making errc an enum class.Rafael Espindola2014-05-311-8/+8
| | | | llvm-svn: 209956
* PR12961 - Extend DR532 to cover C++98/03.Nikola Smiljanic2014-05-311-19/+9
| | | | llvm-svn: 209955
* Diagnose dll attribute on member of class that already has a dll attributeHans Wennborg2014-05-311-7/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D3973 llvm-svn: 209954
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-313-8/+8
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209949
* [CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing ↵Michael J. Spencer2014-05-313-23/+19
| | | | | | {extract,insert} vector element instructions. llvm-svn: 209942
* Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExprRichard Smith2014-05-312-199/+155
| | | | | | | consistently, rather than sometimes performing lookup and calling the LookupResult form. No functionality change intended. llvm-svn: 209941
* Take PrintingPolicy::SuppressUnwrittenScope into account when printing theRichard Smith2014-05-301-0/+3
| | | | | | qualified name of a NamedDecl. Patch by Volodymyr Sapsai! llvm-svn: 209924
* Invalidate the file system cache entries for files that may rebuildBen Langmuir2014-05-301-5/+21
| | | | | | | | | | | | | | | | | | | | | | This reapplies r209910 with a fix for the assertion failures hit on the buildbots. original commit message: I thought we could get away without this, but it means that the FileEntry objects actually refer to the wrong files, since pcms are not updated inplace, they are atomically renamed into place after compiling a module. So we are close to the original behaviour of invalidating the cache for all modules being removed, but now we should only invalidate the ones that depend on whichever module failed to load. Unfortunately I haven't come up with a new test that didn't require a race between parallel invocations of clang. <rdar://problem/17038180> llvm-svn: 209922
* Revert "Invalidate the file system cache entries for files that may rebuild"Ben Langmuir2014-05-301-18/+5
| | | | | | This reverts commit r209910, which is breaking some of the bots. llvm-svn: 209911
* Invalidate the file system cache entries for files that may rebuildBen Langmuir2014-05-301-5/+18
| | | | | | | | | | | | | | | | | | I thought we could get away without this, but it means that the FileEntry objects actually refer to the wrong files, since pcms are not updated inplace, they are atomically renamed into place after compiling a module. So we are close to the original behaviour of invalidating the cache for all modules being removed, but now we should only invalidate the ones that depend on whichever module failed to load. Unfortunately I haven't come up with a new test that didn't require a race between parallel invocations of clang. <rdar://problem/17038180> llvm-svn: 209910
* Start adding support for dllimport/dllexport on classes (PR11170)Hans Wennborg2014-05-306-6/+94
| | | | | | | | | | | | | | | | This implements the central part of support for dllimport/dllexport on classes: allowing the attribute on class declarations, inheriting it to class members, and forcing emission of exported members. It's based on Nico Rieck's patch from http://reviews.llvm.org/D1099. This patch doesn't propagate dllexport to bases that are template specializations, which is an interesting problem. It also doesn't look at the rules when redeclaring classes with different attributes, I'd like to do that separately. Differential Revision: http://reviews.llvm.org/D3877 llvm-svn: 209908
* Objective-C. Diagnose assigning a block pointer type toFariborz Jahanian2014-05-301-2/+2
| | | | | | | an Objective-C object type other than 'id'. // rdar://16739120 llvm-svn: 209906
* AArch64: combine arm64 & aarch64 cases in switchTim Northover2014-05-301-23/+5
| | | | | | | | There shouldn't be any difference in behaviour here, at least not in any configurations people care about and possibly not in any reachable configurations. llvm-svn: 209899
* [OPENMP] Improve debug location codegen for OpenMP runtime library.Alexey Bataev2014-05-302-14/+23
| | | | llvm-svn: 209876
* Fix 'this' capturing Generic lambdas used within default initializers (PR19876) Faisal Vali2014-05-301-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=19876 The following C++1y code results in a crash: struct X { int m = 10; int n = [this](auto) { return m; }(20); }; When implicitly instantiating the generic lambda's call operator specialization body, Sema is unable to determine the current 'this' type when transforming the MemberExpr 'm' - since it looks for the nearest enclosing FunctionDeclDC - which is obviously null. I considered two ways to fix this: 1) In InstantiateFunctionDefinition, when the context is saved after the lambda scope info is created, retain the 'this' pointer. 2) Teach getCurrentThisType() to recognize it is within a generic lambda within an NSDMI/default-initializer and return the appropriate this type. I chose to implement #2 (though I confess I do not have a compelling reason for choosing it over #1). Richard Smith accepted the patch: http://reviews.llvm.org/D3935 Thank you! llvm-svn: 209874
* PR11410 - Confusing diagnostic when trailing array element tries to call ↵Nikola Smiljanic2014-05-301-3/+8
| | | | | | deleted default constructor llvm-svn: 209869
* PR12214 - Warn on suspicious self-compound-assignments.Nikola Smiljanic2014-05-301-1/+2
| | | | llvm-svn: 209867
* Permit the "if" literal suffix with Microsoft extensions enabled.Peter Collingbourne2014-05-291-2/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D3963 llvm-svn: 209859
OpenPOWER on IntegriCloud