summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Tweak code-completion heuristics deciding between a lambdaDouglas Gregor2012-07-311-1/+3
| | | | | | | code-completion and an Objective-C message send, based on Jordan's feedback. llvm-svn: 161049
* Fixes a segfault in Tooling when using pch's:Manuel Klimek2012-07-312-0/+5
| | | | | | | | Clear the FileManager's stat cache in between running translation units, as the stat cache loaded from a pch is only valid for one compiler invocation. llvm-svn: 161047
* Remove deprecated getNameAsCString methods.Benjamin Kramer2012-07-311-1/+1
| | | | llvm-svn: 161044
* Added -ast-list option to dump filterable AST decl node names.Alexander Kornienko2012-07-314-0/+36
| | | | llvm-svn: 161040
* Support ARM hard float (arm-linux-gnueabihf).Jiangning Liu2012-07-312-13/+28
| | | | llvm-svn: 161038
* Fix some minor typosSylvestre Ledru2012-07-311-1/+1
| | | | llvm-svn: 161036
* Introduce new queries on ObjCRuntime for how to interpret subscriptsJohn McCall2012-07-313-64/+93
| | | | | | | | on object pointers and whether pointer arithmetic on object pointers is supported. Make ObjFW interpret subscripts as pseudo-objects. Based on a patch by Jonathan Schleifer. llvm-svn: 161028
* Handle functions with struct arguments or return types and the regparmRafael Espindola2012-07-313-40/+130
| | | | | | | | | | | | | | attribute. It is a variation of the x86_64 ABI: * A struct returned indirectly uses the first register argument to pass the pointer. * Floats, Doubles and structs containing only one of them are not passed in registers. * Other structs are split into registers if they fit on the remaining ones. Otherwise they are passed in memory. * When a struct doesn't fit it still consumes the registers. llvm-svn: 161022
* Attributes preceding a function declaration are first applied to the returnRafael Espindola2012-07-311-0/+2
| | | | | | | | | | type and then propagated to the function. This was failing for destructors, constructors and constructors templates since they don't have a return type. Fix that by directly calling processTypeAttrs on the dummy type we use as the return type in these cases. llvm-svn: 161020
* No longer emitting a PCH file when using -fsyntax-only on a header file. ↵Aaron Ballman2012-07-312-3/+11
| | | | | | Fixes PR13343. llvm-svn: 161019
* [analyzer] Let CallEvent decide what goes in an inital stack frame.Jordan Rose2012-07-313-67/+149
| | | | | | | | | | | | | This removes explicit checks for 'this' and 'self' from Store::enterStackFrame. It also removes getCXXThisRegion() as a virtual method on all CallEvents; it's now only implemented in the parts of the hierarchy where it is relevant. Finally, it removes the option to ask for the ParmVarDecls attached to the definition of an inlined function, saving a recomputation of the result of getRuntimeDefinition(). No visible functionality change! llvm-svn: 161017
* Explain why ACC_bottom should never occur in diagnosing ARC casts.Jordan Rose2012-07-311-3/+3
| | | | | | | This is just a clarification on Fariborz's original patch, per e-mail discussion. No functionality change. llvm-svn: 161016
* When we encounter a code-completion token while parsing an ill-formedDouglas Gregor2012-07-311-1/+5
| | | | | | | | lambda-introducer in Objective-C++11, fall back to treating the tokens as an Objective-C message send to provide those (more likely) completions. Fixes <rdar://problem/11980263>. llvm-svn: 161015
* Don't crash *or* insert a bogus autorelease when emitting aJohn McCall2012-07-312-1/+5
| | | | | | this-adjustment thunk in ARC++. llvm-svn: 161014
* [analyzer] Handle inlining of instance calls to super.Anna Zaks2012-07-301-10/+16
| | | | | | | Use self-init.m for testing. (It used to have a bunch of failing tests with dynamic inlining turned on.) llvm-svn: 161012
* PR13479: If we see the definition of an out-of-line destructor in C++11, beRichard Smith2012-07-301-8/+26
| | | | | | | | sure to update the exception specification on the declaration as well as the definition. If we're building in -fno-exceptions mode, nothing else will trigger it to be updated. llvm-svn: 161008
* [analyzer] Perform post-call checks for all inlined calls.Jordan Rose2012-07-303-27/+100
| | | | | | | | | | | | | Previously, we were only checking the origin expressions of inlined calls. Checkers using the generic postCall and older postObjCMessage callbacks were ignored. Now that we have CallEventManager, it is much easier to create a CallEvent generically when exiting an inlined function, which we can then use for post-call checks. No test case because we don't (yet) have any checkers that depend on this behavior (which is why it hadn't been fixed before now). llvm-svn: 161005
* Extend the ',' versus ';' diagnostic for -Wvexing-parse to cover the ↵Richard Smith2012-07-301-31/+32
| | | | | | with-arguments case as well as the no-arguments case. llvm-svn: 160999
* Improvements to vexing-parse warnings. Make the no-parameters case moreRichard Smith2012-07-307-85/+125
| | | | | | | | | | | | | accurate by asking the parser whether there was an ambiguity rather than trying to reverse-engineer it from the DeclSpec. Make the with-parameters case have better diagnostics by using semantic information to drive the warning, improving the diagnostics and adding a fixit. Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for declarations of the form 'T (*x)(...)', which seem to have a very high false positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'. llvm-svn: 160998
* objective-c arc: ARC IRGen correctly assumes resultFariborz Jahanian2012-07-301-1/+18
| | | | | | | | | | type of generated call to super dealloc is 'void' and asserts if user's dealloc is not of 'void type. This rule must be enforced in clang front-end (with a fixit) if this is not the case, instead of asserting in CodeGen. // rdar://11987838 llvm-svn: 160993
* [analyzer] Very simple ObjC instance method inliningAnna Zaks2012-07-303-25/+41
| | | | | | | | | - Retrieves the type of the object/receiver from the state. - Binds self during stack setup. - Only explores the path on which the method is inlined (no bifurcation to explore the path on which the method is not inlined). llvm-svn: 160991
* Mark ObjCInterfaceDecl::lookupPrivateMethod as const.Anna Zaks2012-07-301-1/+1
| | | | llvm-svn: 160989
* [analyzer] Add -analyzer-ipa=dynamic option for inlining dynamicallyAnna Zaks2012-07-301-0/+2
| | | | | | | | dispatched methods. Disabled by default for now. llvm-svn: 160988
* [analyzer] Only allow CallEvents to be created by CallEventManager.Jordan Rose2012-07-307-114/+109
| | | | | | | | | | This ensures that it is valid to reference-count any CallEvents, and we won't accidentally try to reclaim a CallEvent that lives on the stack. It also hides an ugly switch statement for handling CallExprs! There should be no functionality change here. llvm-svn: 160986
* Do not warn on correct use of the '%n' format specifier.Matt Beaumont-Gay2012-07-301-9/+0
| | | | | | | | While '%n' can be used for evil in an attacker-controlled format string, there isn't any acute danger in using it in a literal format string with an argument of the appropriate type. llvm-svn: 160984
* [analyzer] Introduce a CallEventManager to keep a pool of CallEvents.Jordan Rose2012-07-301-0/+14
| | | | | | | | | | | | | | | | | | | | This allows us to get around the C++ "virtual constructor" problem when we'd like to create a CallEvent from an ExplodedNode, an inlined StackFrameContext, or another CallEvent. The solution has three parts: - CallEventManager uses a BumpPtrAllocator to allocate CallEvent-sized memory blocks. It also keeps a cache of freed CallEvents for reuse. - CallEvents all have protected copy constructors, along with cloneTo() methods that use placement new to copy into CallEventManager-managed memory, vtables intact. - CallEvents owned by CallEventManager are now wrapped in an IntrusiveRefCntPtr. Going forwards, it's probably a good idea to create ALL CallEvents through the CallEventManager, so that we don't accidentally try to reclaim a stack-allocated CallEvent. All of this machinery is currently unused but will be put into use shortly. llvm-svn: 160983
* Comment parser: don't crash on a completely empty \param followed by a blockDmitri Gribenko2012-07-301-2/+2
| | | | | | command llvm-svn: 160975
* Lexer: remove dead stores. Found by Clang static analyzer!Dmitri Gribenko2012-07-301-5/+2
| | | | llvm-svn: 160973
* Comment dumper: silence a warning by not casting away constDmitri Gribenko2012-07-301-1/+1
| | | | llvm-svn: 160972
* Make -Wformat check the argument type for %n.Hans Wennborg2012-07-303-2/+13
| | | | | | | This makes Clang check that the corresponding argument for "%n" in a format string is a pointer to int. llvm-svn: 160966
* Use the location of the copy assignment when diagnosing classes that are ↵Benjamin Kramer2012-07-301-4/+3
| | | | | | nontrivial because of it. llvm-svn: 160962
* Fix ambiguity detection in GetBestOverloadCandidateSimple.Benjamin Kramer2012-07-301-2/+2
| | | | | | | | | | When performing the simplistic overload resolution for single-argument methods, don't check the best overload for ambiguity with itself when the best overload doesn't happen to be the first one. Fixes PR13480. llvm-svn: 160961
* Fix dynamic object linker for ARM GNUEABIHF.Jiangning Liu2012-07-301-2/+6
| | | | llvm-svn: 160958
* Fix for ASTMatchFinder to visit a functions parameter declarations.Daniel Jasper2012-07-301-1/+2
| | | | llvm-svn: 160947
* Provide correct linker command line options on FreeBSD 8 (GNU ld 2.15) and ↵David Chisnall2012-07-291-3/+17
| | | | | | | | on newer FreeBSD (GNU ld 2.17). Patch by Dimitry Andric! llvm-svn: 160931
* PR13433: In Microsoft mode, don't require function calls within decltypeRichard Smith2012-07-281-0/+5
| | | | | | | | | expressions to have complete return types (or accessible destructors). If the return type is required to be complete for some other reason (for instance, if it is needed by overload resolution), then it will still be required to be complete. This is apparently required in order to parse a MSVC11 header. llvm-svn: 160924
* assert on ACC_bottom when checking for invalidFariborz Jahanian2012-07-281-2/+4
| | | | | | CF to ARC conversions. llvm-svn: 160923
* Comment dumper: print \param parameter index if parameter name is resolved.Dmitri Gribenko2012-07-281-2/+4
| | | | llvm-svn: 160908
* more objc-arc: With ACC_bottom, we just provideFariborz Jahanian2012-07-281-2/+2
| | | | | | | __bride fixit, as it doesn't matter which cast to use. // rdar://11923822 llvm-svn: 160906
* objc-arc: change per Jordy's comments.Fariborz Jahanian2012-07-271-13/+14
| | | | | | // rdar://11923822 llvm-svn: 160902
* CommentSema.cpp: remove extra semicolonDmitri Gribenko2012-07-271-1/+1
| | | | llvm-svn: 160901
* objective-c arc: When function calls with known CFCreate naming conventionFariborz Jahanian2012-07-271-8/+18
| | | | | | | | are cast to retainable types, only suggest CFBridgingRelease/ CFBridgingRetain and not the __bridge casts. // rdar://11923822 llvm-svn: 160900
* Comment Sema: don't try to typo-correct a \param when function has zeroDmitri Gribenko2012-07-271-0/+4
| | | | | | arguments. Just an optimization, no functional change. llvm-svn: 160896
* revert r160839 for now.Fariborz Jahanian2012-07-271-12/+27
| | | | llvm-svn: 160895
* Implement resolving of HTML character references (named: &amp;, decimal: &#42;,Dmitri Gribenko2012-07-273-26/+183
| | | | | | | | | hex: &#x1a;) during comment parsing. Now internal representation of plain text in comment AST does not contain character references, but the characters themselves. llvm-svn: 160891
* Add a function to convert a single Unicode code point to a UTF8 sequence.Dmitri Gribenko2012-07-272-2/+17
| | | | llvm-svn: 160890
* Make -Wformat walk the typedef chain when looking for size_t, etc.Hans Wennborg2012-07-273-30/+38
| | | | | | | | | | | | | | Clang's -Wformat fix-its currently suggest using "%zu" for values of type size_t (in C99 or C++11 mode). However, for a type such as std::vector<T>::size_type, it does not notice that type is actually typedeffed to size_t, and instead suggests a format for the underlying type, such as "%lu" or "%u". This commit makes the format string fix mechanism walk the typedef chain so that it notices if the type is size_t, even if that isn't "at the top". llvm-svn: 160886
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-274-72/+26
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* Preprocessor: add __BYTE_ORDER__ predefined macroDylan Noblesmith2012-07-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The __BYTE_ORDER__ predefined macro was added in GCC 4.6: http://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html It's used like the following: #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ... #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ... #else #error insane architecture like the pdp-11 #endif There's a similar macro, __FLOAT_WORD_ORDER__, but it looks like it mainly exist to accommodate fairly obscure architectures and ARM's old FPA instructions, so it doesn't seem nearly as useful. The tests are updated to check for the correct(at least, based on clang's current output) value of the macro on each target. So now the suite will catch bugs like the one fixed in r157626. llvm-svn: 160879
* Fix an assertion failure when code completing an auto variable's initialiser.Peter Collingbourne2012-07-271-0/+1
| | | | llvm-svn: 160857
OpenPOWER on IntegriCloud