summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Thread Safety Analysis: implement review suggestions from Aaron Ballman.DeLesley Hutchins2014-05-291-1/+1
| | | | llvm-svn: 209847
* Implement AVX1 vbroadcast intrinsics with vector initializersAdam Nemet2014-05-291-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These intrinsics are special because they directly take a memory operand (AVX2 adds the register counterparts). Typically, other non-memop intrinsics take registers and then it's left to isel to fold memory operands. In order to LICM intrinsics directly reading memory, we require that no stores are in the loop (LICM) or that the folded load accesses constant memory (MachineLICM). When neither is the case we fail to hoist a loop-invariant broadcast. We can work around this limitation if we expose the load as a regular load and then just implement the broadcast using the vector initializer syntax. This exposes the load to LICM and other optimizations. At the IR level this is translated into a series of insertelements. The sequence is already recognized as a broadcast so there is no impact on the quality of codegen. _mm256_broadcast_pd and _mm256_broadcast_ps are not updated by this patch because right now we lack the DAG-combiner smartness to recover the broadcast instructions. This will be tackled in a follow-on. There will be completing changes on the LLVM side to remove the LLVM intrinsics and to auto-upgrade bitcode files. Fixes <rdar://problem/16494520> llvm-svn: 209846
* Add flags -Rpass-missed and -Rpass-analysis.Diego Novillo2014-05-293-44/+115
| | | | | | | | | | | | | | | | | | | | | | Summary: These two flags are in the same family as -Rpass, but are used in different situations. -Rpass-missed is used by optimizers to inform the user when they tried to apply an optimization but couldn't (or wouldn't). -Rpass-analysis is used by optimizers to report analysis results back to the user (e.g., why the transformation could not be applied). Depends on D3682. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3683 llvm-svn: 209839
* Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719Bob Wilson2014-05-291-0/+8
| | | | llvm-svn: 209836
* Sema: Functions with dll attributes cannot be deletedNico Rieck2014-05-291-0/+15
| | | | llvm-svn: 209827
* MS ABI: Emit static data members with proper linkageNico Rieck2014-05-291-2/+7
| | | | llvm-svn: 209826
* Sema: Check dll attributes on static data membersNico Rieck2014-05-291-4/+20
| | | | | | | Redeclarations cannot add a dll attribute and static data members cannot be defined. llvm-svn: 209825
* No longer allow the -std options to entirely override the -x language ↵Aaron Ballman2014-05-291-11/+5
| | | | | | option. This allows -x cuda -std=c++11, for instance. llvm-svn: 209824
* Fix spurious remarks when -Weverything is used.Diego Novillo2014-05-291-0/+6
| | | | | | | | | | | With -Weverything, the backend remarks are enabled. This was causing spurious diagnostics for remarks that we don't yet handle (cf http://reviews.llvm.org/D3683). This will stop being a problem once http://reviews.llvm.org/D3683 is committed. llvm-svn: 209823
* Parsing/Sema for OMPAlignedClause.Alexander Musman2014-05-299-7/+209
| | | | llvm-svn: 209816
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-2920-718/+583
| | | | llvm-svn: 209812
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-2935-798/+798
| | | | | | takeAs to getAs. llvm-svn: 209800
* When merging functions across modules (and in particular, instantiations ofRichard Smith2014-05-292-4/+47
| | | | | | | member functions), ensure that the redecl chain never transitions from 'inline' to 'not inline', since that violates an AST invariant. llvm-svn: 209794
* [ASan] Hoist blacklisting globals from init-order checking to Clang.Alexey Samsonov2014-05-291-6/+5
| | | | | | | | | Clang knows about the sanitizer blacklist and it makes no sense to add global to the list of llvm.asan.dynamically_initialized_globals if it will be blacklisted in the instrumentation pass anyway. Instead, we should do as much blacklisting as possible (if not all) in the frontend. llvm-svn: 209789
* PR19878: If a pack expansion appears within another pack expansion, correctlyRichard Smith2014-05-291-199/+178
| | | | | | deduce any packs that are expanded by both expansions. llvm-svn: 209786
* Thread Safety Analysis: update TIL traversal mechanism to allow arbitraryDeLesley Hutchins2014-05-282-7/+50
| | | | | | local contexts. Also includes some minor refactoring. llvm-svn: 209774
* added Intel's BMI intrinsic variants Sanjay Patel2014-05-281-1/+34
| | | | | | (fixes PR19431 - http://llvm.org/bugs/show_bug.cgi?id=19431) llvm-svn: 209769
* Reverting 209503 - Breaks asan blacklistsWarren Hunt2014-05-281-4/+1
| | | | | | | | I opened a discussion on cfe-commits. Ideally we've got a few things that need to happen. CompilerRT should probably have blacklists tests. Asan should probably not depend on that specific field. llvm-svn: 209766
* Debug Info: Fix the source range for IfStmt's ConditionScope.Adrian Prantl2014-05-281-1/+1
| | | | | | | | | | Since the continuation block of the if statement is emitted within the condition scope this had the undesirable effect of creating a line table entry at the end of the then or else statement, a line that may have never been executed. PR19864 / rdar://problem/17052973 llvm-svn: 209764
* Objective-C. Diagnose use of properties in functions nested in, Fariborz Jahanian2014-05-281-0/+20
| | | | | | | now deprecated, ObjC containers instead of crashing. // rdar://16859666 llvm-svn: 209758
* Objective-C. Deprecate use of function definitionsFariborz Jahanian2014-05-281-0/+5
| | | | | | | in Objective-C container declarations (but not in their definitions. // rdar://10414277 llvm-svn: 209751
* -pthread does not translate to -lpthread on Android.Evgeniy Stepanov2014-05-281-2/+3
| | | | | | | There is no libpthread.so, and pthread interface is implemented in libc.so. This mirrors gcc behavior. llvm-svn: 209731
* Consolidate some note diagnosticsAlp Toker2014-05-286-19/+15
| | | | | | | | | These note diags have the same message and can be unified further but for now let's just bring them together. Incidental change: Display a source range in the final attr diagnostic. llvm-svn: 209728
* Fix line endings.Nikola Smiljanic2014-05-282-121/+121
| | | | llvm-svn: 209727
* clang-format: Don't break before a case's colon.Daniel Jasper2014-05-281-4/+5
| | | | | | | | | | | | | | | | | | Before (with just the right line length: switch (a) { case some_namespace::some_constant : return; } After: switch (a) { case some_namespace:: some_constant: return; } llvm-svn: 209725
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-0/+6
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* clang-format: Format array and dict literals similar to blocks.Daniel Jasper2014-05-281-45/+59
| | | | | | | | | | | | | | | | | | | | | | | Especially, reduce the amount of indentation if it doesn't increase readability. Before: NSMutableDictionary* dictionary = [NSMutableDictionary dictionaryWithDictionary:@{ aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb : bbbbb, cccccccccccccccc : ccccccccccccccc }]; After: NSMutableDictionary* dictionary = [NSMutableDictionary dictionaryWithDictionary:@{ aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb : bbbbb, cccccccccccccccc : ccccccccccccccc }]; llvm-svn: 209720
* [OPENMP] Additional checking for local vars in initial values for ↵Alexey Bataev2014-05-281-0/+36
| | | | | | threadprivate vars llvm-svn: 209716
* [OPENMP] Reformatting of parsing code for OpenMP constructs.Alexey Bataev2014-05-281-43/+38
| | | | llvm-svn: 209714
* [OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.Alexey Bataev2014-05-281-256/+249
| | | | llvm-svn: 209713
* Move the logic for testing for namespace std into one location. This check canRichard Trieu2014-05-288-39/+30
| | | | | | be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace llvm-svn: 209708
* Don't dllimport/export destructor variants implemented by thunks.Hans Wennborg2014-05-282-16/+18
| | | | | | | | | | | | MSVC doesn't export these functions, so trying to import them doesnt' work. Also, don't let any dll attributes on the CXXDestructorDecl influence the thunk's linkage -- they should always be linkonce_odr. This takes care of the FIXME's for this in Nico's tests. Differential Revision: http://reviews.llvm.org/D3930 llvm-svn: 209706
* Retain isImplicit flag for local variable declarations when instantiatingAlexander Kornienko2014-05-272-0/+4
| | | | | | | | | | | | | | templates. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3924 llvm-svn: 209686
* Add range accessors for captures of a LambdaExpr.James Dennett2014-05-271-0/+12
| | | | | | | | | | | | | Summary: This adds LambdaExpr::captures(), LambdaExpr::explicit_captures() and LambdaExpr::implicit_captures() as simple wrappers over the underlying *_begin()/*_end() functions. Reviewers: aaron.ballman Differential Revision: http://reviews.llvm.org/D3926 llvm-svn: 209679
* Objective-C. Fixes an obscuer crash caused by multiple inclusion ofFariborz Jahanian2014-05-271-0/+3
| | | | | | | same framework after complaining about duplicate class definition. // rdar://17024681 llvm-svn: 209672
OpenPOWER on IntegriCloud