summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup linkage computation for static locals.Rafael Espindola2013-06-172-6/+8
| | | | | | | With this patch we assign VisibleNoLinkage to static locals in inline functions. This lets us simplify CodeGen a bit. llvm-svn: 184114
* Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.Rafael Espindola2013-06-171-1/+3
| | | | llvm-svn: 184113
* X86 intrinsics: cmpge|gt|nge|ngt_ss|_sdManman Ren2013-06-172-8/+20
| | | | | | | | | | | | | These intrinsics should return the comparision result in the low bits and keep the high bits of the first source operand. When calling to builtin functions, the source operands are swapped and the high bits of the second source operand are kept. To fix the issue, an extra shufflevector is used. rdar://14153896 llvm-svn: 184110
* Revert "Updated test cases for contextual conversion"Rafael Espindola2013-06-171-3/+3
| | | | | | | | | This reverts commit r184100. It was faling on some bots: http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/1973/steps/test_clang/logs/Clang%20%3A%3A%20SemaCXX__cxx1y-contextual-conversion-tweaks.cpp llvm-svn: 184108
* Updated test cases for contextual conversionLarisse Voufo2013-06-171-3/+3
| | | | llvm-svn: 184100
* Include PathV1.h only where it is used.Rafael Espindola2013-06-176-0/+6
| | | | llvm-svn: 184090
* Clean up empty struct/union recognition.Serge Pavlov2013-06-171-13/+15
| | | | | | | | | Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows more accurate detection of types of zero size. It however has a side effect - sequence of used types may change, that is why the test 'override-layout' was modified. llvm-svn: 184088
* Objective-C [qoi]: Provide fixit hint when message with typoFariborz Jahanian2013-06-172-5/+31
| | | | | | is sent to a receiver object. This is wip. // rdar://7853549 llvm-svn: 184086
* [Driver] Remove the using namespace directives from headersReid Kleckner2013-06-174-142/+188
| | | | | | | | | | | This adds a bunch of llvm::opt name specifiers to all the uses of types from that namespace. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D983 llvm-svn: 184079
* Fix a problem in ExpressionParser leading to trailing comments affecting ↵Alexander Kornienko2013-06-171-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | indentation of an expression after a line break. Summary: E.g. the second line in return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + b; // is indented 4 characters more than in return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + b; Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D984 llvm-svn: 184078
* Fixes incorrect indentation of line comments after break and re-alignment.Alexander Kornienko2013-06-172-6/+15
| | | | | | | | | | | | | | | | | | | Summary: Selectively propagate the information about token kind in WhitespaceManager::replaceWhitespaceInToken.For correct alignment of new segments of line comments in order to align them correctly. Don't set BreakBeforeParameter in breakProtrudingToken for line comments, as it introduces a break after the _next_ parameter. Added tests for related functions. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D980 llvm-svn: 184076
* [AST] Don't include RecursiveASTVisitor.h in ASTContext.hReid Kleckner2013-06-173-0/+98
| | | | | | | | | | | | | | | | | | | | The untemplated implementation of getParents() doesn't need to be in a header file. RecursiveASTVisitor.h is full of repeated macro expansion. Moving this include to ASTContext.cpp speeds up compilation of LambdaMangleContext.cpp, a small C++ file with few includes, from 3.7s to 2.8s for me locally. I haven't measured a full build, but it can't hurt. I had to fix a few static analyzer files that were depending on transitive includes of C++ AST headers. Reviewers: rsmith, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D982 llvm-svn: 184075
* C++11: don't warn about the deprecated 'register' keyword if it's combined withRichard Smith2013-06-172-9/+12
| | | | | | an asm label. llvm-svn: 184069
* PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'Richard Smith2013-06-161-1/+2
| | | | | | | | and a '!defined(X)' if we find a broken header guard. This is suboptimal; we should point the diagnostic at the 'X' token not the 'if' token, but it fixes the crash. llvm-svn: 184054
* ArrayRef'ize Sema::CodeComplete*Dmitri Gribenko2013-06-162-101/+72
| | | | | | Patch by Robert Wilhelm. llvm-svn: 184052
* Updated the support for contextual conversion tweaks (n3323) with a ↵Larisse Voufo2013-06-151-56/+85
| | | | | | previously overlooked part: implicitly converting array sizes to size_t, rather than contextually converting them to some unique type. llvm-svn: 184048
* A quick fix to allow return type deduction on member templatesFaisal Vali2013-06-151-2/+19
| | | | | | | | | | by ensuring DiagnoseUseOfDecl is called both on the found decl and the decl being used (i.e the specialization in the case of member templates) whenever they are different. Per the exchange captured in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130610/081636.html a more comprehensive fix that allows both decls to be passed into DiagnoseUseOfDecl is (or should be) forthcoming relatively soon. llvm-svn: 184043
* Emit native implementations of atomic operations on FreeBSD/armv6.Ed Schouten2013-06-151-2/+2
| | | | | | | | | | | | Just like on Linux, FreeBSD/armv6 assumes the system supports ldrex/strex unconditionally. It is also used by the kernel. We can therefore enable support for it, like we do on Linux. While there, change one of the unit tests to explicitly test against armv5 instead of armv7, as it actually tests whether libcalls are emitted. llvm-svn: 184040
* PR16263: Implement current direction of core issue 1376. Binding a reference toRichard Smith2013-06-152-6/+45
| | | | | | | | | | | the result of a cast-to-reference-type lifetime-extends the object to which the reference inside the cast binds. This requires us to look for subobject adjustments on both the inside and the outside of the MaterializeTemporaryExpr when looking for a temporary to lifetime-extend (which we also need for core issue 616, and possibly 1213). llvm-svn: 184024
* Fix handling of const_cast from prvalue to rvalue reference: such a cast isRichard Smith2013-06-141-11/+46
| | | | | | | only permitted if the source object is of class type, and should materialize a temporary for the reference to bind to. llvm-svn: 184017
* Unify return type checking for functions and ObjC methods. Move all theEli Friedman2013-06-146-56/+52
| | | | | | | | random checks for ObjC object return types to SemaType.cpp. Fixes issue with ObjC method type checking reported on cfe-dev. llvm-svn: 184006
* Suppress the c++11 -Wdeprecated warning for 'register' if it is expanded from aRichard Smith2013-06-141-1/+5
| | | | | | macro defined in a system header. glibc uses it in macros, apparently. llvm-svn: 184005
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-1422-1225/+122
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Don't remove backslashes from block comments.Alexander Kornienko2013-06-143-50/+51
| | | | | | | | | | | | | | | | | | | | | | | Summary: Don't remove backslashes from block comments. Previously this /* \ \ \ \ \ \ */ would be turned to this: /* */ which spoils some kinds of ASCII-art, people use in their comments. The behavior was related to handling escaped newlines in block comments inside preprocessor directives. This patch makes handling it in a more civilized way. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D979 llvm-svn: 183978
* Fix the warning for divide by zero to be a bit more robust. ;]Chandler Carruth2013-06-141-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, it only ever fired for zeros which formed null pointers. Now, hilariously, in C++98 this was almost anything. Including tricks like warning on the divisor in this code: typedef char c3[3]; size_t f(c3* ptr) { return (sizeof(ptr) / sizeof(*ptr)) / (size_t)(!(sizeof(ptr) % sizeof(*ptr))); } Why the RHS of the outer divide is a null pointer constant is a sordid tale of sorrow. Anyways, the committee fixed this for C++11 and onward as part of core isssue 903, and Richard recently implemented this fix causing the warning to go away here (and elsewhere). This patch restores the warning here and adds it for numerous other somewhat obvious gaffes: int g(int x) { return x / (int)(0.0); } The patch is essentially just using the full power of our constant folding in Clang to produce the warning, but insisting that it must fold to an *integer* which is zero so that we don't get false positives anywhere. llvm-svn: 183970
* Emit initializers for static-storage-duration temporaries as constants whereRichard Smith2013-06-143-16/+44
| | | | | | possible. llvm-svn: 183967
* Remove implicit fallthrough from AArch64 to Mips in lib selectionTim Northover2013-06-131-0/+1
| | | | | | | | | Nothing useful to AArch64 will (should!) be found in any Mips-specific directories. Patch by Luke Zarko. llvm-svn: 183956
* Fix the linkage of static locals inside a CapturedStmt. (Found in theEli Friedman2013-06-133-4/+27
| | | | | | process of trying to fix the related issue for block literals.) llvm-svn: 183951
* Don't depend on the transitive inclusion of PathV1.h.Rafael Espindola2013-06-131-0/+1
| | | | llvm-svn: 183945
* Use the sys::RemoveFileOnSignal that takes a StringRef.Rafael Espindola2013-06-131-1/+1
| | | | llvm-svn: 183944
* Followup to r183931 to fix the lambda conversion-to-block-pointer member.Eli Friedman2013-06-131-1/+1
| | | | llvm-svn: 183942
* Use the sys::ExecuteAndWait that takes StringRefs.Rafael Espindola2013-06-132-6/+7
| | | | | | Also don't depend on Program.h including PathV1.h. llvm-svn: 183935
* Fix a small bug in the linkage computation for the lambda ↵Eli Friedman2013-06-131-1/+1
| | | | | | conversion-to-function-pointer member. llvm-svn: 183931
* Update for llvm change.Rafael Espindola2013-06-131-2/+3
| | | | llvm-svn: 183930
* Allow clang to build __clear_cache on ARM.Rafael Espindola2013-06-131-1/+2
| | | | | | | | | __clear_cache is special. It needs no signature, but is a real function in compiler_rt or libgcc. Patch by Andrew Turner. llvm-svn: 183926
* InheritViz.cpp uses sys::Path, include PathV1.hRafael Espindola2013-06-131-0/+1
| | | | llvm-svn: 183922
* Use version of DisplayGraph that takes a StringRef.Rafael Espindola2013-06-131-1/+1
| | | | llvm-svn: 183916
* Teach clang about the armv4/armv4t distinctionTim Northover2013-06-132-4/+10
| | | | | | | | | When choosing a default CPU, clang used to pick ARM7TDMI (which has Thumb) even when the more restrictive armv4 triple was specified. This should fix that. Patch by Jeroen Hofstee. llvm-svn: 183905
* Modernize some low-hanging PathV1 uses.Benjamin Kramer2013-06-133-24/+27
| | | | llvm-svn: 183903
* Add Ubuntu Saucy to the list of known Ubuntu releasesSylvestre Ledru2013-06-131-1/+3
| | | | | | | Thanks to Dmitry Shachnev for the patch See bug #16317 llvm-svn: 183899
* More for PR12457: fix handling of __builtin_isinf_sign and test.Richard Smith2013-06-131-1/+1
| | | | llvm-svn: 183890
* Towards PR12457: constant expression evaluation support for ↵Richard Smith2013-06-131-14/+63
| | | | | | __builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify. llvm-svn: 183889
* Fix part of PR12457. Patch by Justin Bogner!Richard Smith2013-06-131-0/+34
| | | | llvm-svn: 183886
* C++11: If a class has a user-declared copy operation or destructor, theRichard Smith2013-06-131-1/+67
| | | | | | | | implicit definition of a copy operation is deprecated. Add a warning for this to -Wdeprecated. This warning is disabled by default for now, pending investigation into how common this situation is. llvm-svn: 183884
* Implement core issue 903: only integer literals with value 0 and prvalues ofRichard Smith2013-06-131-8/+9
| | | | | | type std::nullptr_t are null pointer constants from C++11 onwards. llvm-svn: 183883
* In C++11, promote access declaration diagnostic from warning to error. ThereRichard Smith2013-06-131-2/+4
| | | | | | doesn't seem to be any value in even adding a -W flag for this. llvm-svn: 183882
* Add -Wdeprecated warnings and fixits for things deprecated in C++11:Richard Smith2013-06-132-0/+16
| | | | | | | | | - 'register' storage class - dynamic exception specifications Only the former check is enabled by default for now (the latter might be quite noisy). llvm-svn: 183881
* When copy-initializing a temporary for a reference binding, don't allow use ofRichard Smith2013-06-131-7/+5
| | | | | | explicit constructors. llvm-svn: 183879
* Include the unexpanded packs in the initializer expression when checking aNick Lewycky2013-06-131-1/+2
| | | | | | pack expanded constructor initializer list. Fixes PR16303! llvm-svn: 183878
* Simplify: we don't need any special-case lifetime extension when initializingRichard Smith2013-06-127-62/+36
| | | | | | | declarations of reference type; they're handled by the general case handling of MaterializeTemporaryExpr. llvm-svn: 183875
OpenPOWER on IntegriCloud