summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Push "references are non-null" knowledge up to the common parent.Jordan Rose2012-08-214-35/+33
| | | | | | | | | | This reduces duplication across the Basic and Range constraint managers, and keeps their internals free of dealing with the semantics of C++. It's still a little unfortunate that the constraint manager is dealing with this at all, but this is pretty much the only place to put it so that it will apply to all symbolic values, even when embedded in larger expressions. llvm-svn: 162313
* [ms-inline asm] Do not report a Parser error when matching inline assembly.Chad Rosier2012-08-211-1/+2
| | | | llvm-svn: 162307
* Modern objc translator: Fixes a crash in rewriter when rewriting the APIFariborz Jahanian2012-08-212-1/+38
| | | | | | for structure valued method messaging. // rdar://12142241 llvm-svn: 162303
* Use LLVM_BUILTIN_TRAP instead of lame volatile int traps.David Blaikie2012-08-212-2/+2
| | | | | | (from a todo mentioned in r159469 & originally suggested by Chandler Carruth) llvm-svn: 162302
* Reduce the amount of state in the Option class by relying on the data from ↵Michael J. Spencer2012-08-214-139/+74
| | | | | | OptTable::Info. llvm-svn: 162299
* Switch some realignment calculations over to llvm::RoundUpToAlignment.Richard Smith2012-08-213-7/+5
| | | | llvm-svn: 162297
* [ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,Chad Rosier2012-08-211-1/+3
| | | | | | this is the index of the operand that failed to match. llvm-svn: 162296
* DeclPrinter, terse mode: don't print function bodiesDmitri Gribenko2012-08-212-18/+35
| | | | llvm-svn: 162294
* Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutputDmitri Gribenko2012-08-213-6/+5
| | | | | | to reflect the intention, not the implementation. llvm-svn: 162293
* [ms-inline asm] Append identifier for better debugging.Chad Rosier2012-08-211-0/+1
| | | | llvm-svn: 162289
* [ms-inline asm] Remove this test case and the associated special case code.Chad Rosier2012-08-212-23/+11
| | | | llvm-svn: 162288
* [driver] Add support for the --param ssp-buffer-size= driver option.Chad Rosier2012-08-216-0/+32
| | | | | | PR9673 llvm-svn: 162285
* [asan] If we are compiling with ASan, add metadata indicating dynamically ↵Kostya Serebryany2012-08-211-0/+12
| | | | | | initialized globals. Patch by Reid Watson, reviewed by Richard Smith llvm-svn: 162259
* Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.Richard Smith2012-08-212-4/+11
| | | | llvm-svn: 162255
* When performing a trivial copy of a C++ type, we must be careful notJohn McCall2012-08-214-16/+108
| | | | | | | | | | | to overwrite objects that might have been allocated into the type's tail padding. This patch is missing some potential optimizations where the destination is provably a complete object, but it's necessary for correctness. Patch by Jonathan Sauer. llvm-svn: 162254
* Avoid binding a reference to a dereferenced pointer in diagnostic serializationRichard Smith2012-08-211-92/+133
| | | | | | | | | | | if a diagnostic is emitted outside of any source file. The fix mirrors the corresponding code in TextDiagnosticPrinter. This required moving the functional parts of SDiagRenderer into SDiagWriter so they can be reused in the non-rendering codepath. No functionality change. llvm-svn: 162253
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-2118-45/+102
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* DeclPrinter: describe what 'terse' output is.Dmitri Gribenko2012-08-211-1/+6
| | | | llvm-svn: 162251
* When this test case was first created it wasJack Carter2012-08-211-1/+6
| | | | | | | | | just trying to show it did not crash and burn. This patch checks that the resultant .ll contents are correct. llvm-svn: 162249
* Better diagnostics for range-based for loops with bad range types.Sam Panzer2012-08-2110-186/+477
| | | | | | | | | | | | | The old error message stating that 'begin' was an undeclared identifier is replaced with a new message explaining that the error is in the range expression, along with which of the begin() and end() functions was problematic if relevant. Additionally, if the range was a pointer type or defines operator*, attempt to dereference the range, and offer a FixIt if the modified range works. llvm-svn: 162248
* [analyzer] Assume that reference symbols are non-null.Jordan Rose2012-08-213-1/+32
| | | | | | | | By doing this in the constraint managers, we can ensure that ANY reference whose value we don't know gets the effect, even if it's not a top-level parameter. llvm-svn: 162246
* DeclPrinter: add terse output mode and lots of testsDmitri Gribenko2012-08-205-4/+1214
| | | | | | | | | | | | | | Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output from DeclPrinter. The motivation is to use DeclPrinter to print declarations in user-friendly format, without overwhelming user with inner detail of the declaration being printed. Also add many tests for DeclPrinter. There are quite a few things that we print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests check our output against incorrect output, so that we can fix/refactor/rewrite the DeclPrinter later. llvm-svn: 162245
* Fix a pair of bugs relating to properties in ARC.John McCall2012-08-204-2/+109
| | | | | | | | | | | | | | | | | | | | First, when synthesizing an explicitly strong/retain/copy property of Class type, don't pretend during compatibility checking that the property is actually assign. Instead, resolve incompatibilities by secretly changing the type of *implicitly* __unsafe_unretained Class ivars to be strong. This is moderately evil but better than what we were doing. Second, when synthesizing the setter for a strong property of non-retainable type, be sure to use objc_setProperty. This is possible when the property is decorated with the NSObject attribute. This is an ugly, ugly corner of the language, and we probably ought to deprecate it. The first is rdar://problem/12039404; the second was noticed by inspection while fixing the first. llvm-svn: 162244
* Reapply:Eric Christopher2012-08-202-14/+31
| | | | | | | | | | | | | | | Author: Eric Christopher <echristo@apple.com> Date: Thu Aug 16 23:50:46 2012 +0000 Add some caching here for the builtin types. rdar://12117935 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162066 91177308-0d34-0410-b5e6-96231b3b80d8 after fixing a thinko. llvm-svn: 162243
* Attaching comments to declarations: ignore implicit decls. Decl::isImplicit()Dmitri Gribenko2012-08-201-0/+18
| | | | | | | | does not return true for all implicit decls currently. This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too. llvm-svn: 162238
* Fix -Wswitch warning introduced by r162231David Blaikie2012-08-201-1/+2
| | | | llvm-svn: 162236
* Remove unused variable.David Blaikie2012-08-201-1/+0
| | | | llvm-svn: 162235
* [analyzer] More tests for "release and stop tracking".Jordan Rose2012-08-202-4/+67
| | | | | | | | Under GC, a release message is ignored, so "release and stop tracking" just becomes "stop tracking". But CFRelease is still honored. This is the main difference between ns_consumed and cf_consumed. llvm-svn: 162234
* Use -fobjc-runtime=macosx10.7 instead of obsolete -fobjc-runtime-has-weak.Jordan Rose2012-08-201-1/+1
| | | | | | This should unbreak the buildbots (r162220). llvm-svn: 162232
* Make Option non virtual.Michael J. Spencer2012-08-204-351/+104
| | | | llvm-svn: 162231
* Thread-safety analysis: fix scoping issues related to 'this', including anDeLesley Hutchins2012-08-202-30/+60
| | | | | | ICE in friend functions. llvm-svn: 162229
* Fix InitListExpr::isStringLiteralInit so it handles various edge cases ↵Eli Friedman2012-08-202-3/+18
| | | | | | correctly. PR13643. llvm-svn: 162226
* Adds the most requested doc for the AST matchers: a referenceManuel Klimek2012-08-201-0/+1899
| | | | | | | | | | of matchers, categorized by type and fully expanded for the context in which they can be used. I used a script to generate this documentation which I'll want to be scrunitized by a code review before checking it in. llvm-svn: 162225
* [analyzer] Add a test for "release and stop tracking" behavior.Jordan Rose2012-08-201-0/+14
| | | | | | | | | This is used to handle functions and methods that consume an argument (annotated with the ns_consumed or cf_consumed attribute), but then the argument's retain count may be further modified in a callback. We want to warn about over-releasing, but we can't really track the object afterwards. llvm-svn: 162221
* Code-complete 'weak' for properties under ARC-with-weak-references (or GC)Jordan Rose2012-08-202-11/+33
| | | | | | | | | | Also, suggest 'readonly' even if the property has been given an ownership attribute ('strong', 'weak', etc). This is used when properties are declared readonly in the public interface but readwrite in a class extension. <rdar://problem/11500004&11932285> llvm-svn: 162220
* [analyzer] Add comments to ExplodedNode::NodeGroup.Jordan Rose2012-08-202-0/+31
| | | | | | No functionality change. llvm-svn: 162216
* [analyzer] Replace boolean IsSink parameters with 'generateSink' methods.Jordan Rose2012-08-207-71/+82
| | | | | | | | | | | Generating a sink is significantly different behavior from generating a normal node, and a simple boolean parameter can be rather opaque. Per offline discussion with Anna, adding new generation methods is the clearest way to communicate intent. No functionality change. llvm-svn: 162215
* PR13619: Make sure we're not at EOF before looking at NextToken().Richard Smith2012-08-202-4/+8
| | | | llvm-svn: 162212
* [ms-inline asm] Remove old cruft now that MS-style asms their own code path.Chad Rosier2012-08-208-30/+15
| | | | llvm-svn: 162210
* [analyzer] The result of && or || is always a 1 or 0.Jordan Rose2012-08-202-2/+47
| | | | | | | | | | | Forgetting to at least cast the result was giving us Loc/NonLoc problems in SValBuilder (hitting an assertion). But the standard (both C and C++) does actually guarantee that && and || will result in the actual values 1 and 0, typed as 'int' in C and 'bool' in C++, and we can easily model that. PR13461 llvm-svn: 162209
* Use correct matcher name in the comment.Dmitri Gribenko2012-08-201-1/+1
| | | | llvm-svn: 162206
* Fix comments and variable naming:Manuel Klimek2012-08-201-76/+364
| | | | | | | | | - use InnerMatcher consistently, fix style violations on the way - doxygenify code snippets across all comments - start doxygenifying code references in text - addeed missing Usable as: sections llvm-svn: 162205
* [cindex.py] Cache the number of chunks in CompletionStringTobias Grosser2012-08-201-1/+5
| | | | | | | | Without this patch, lib.clang_getNumCompletionChunks is called at each _iteration_ of a 'for chunk in CompletionString' loop. Now we call it just once. llvm-svn: 162200
* Better wording for reference self-initialization warning.Hans Wennborg2012-08-206-7/+20
| | | | llvm-svn: 162198
* [cindex.py] Add CachedProperty to CompletionChunkTobias Grosser2012-08-191-3/+3
| | | | | | Suggested by: Francisco Lopes <oblita@gmail.com> llvm-svn: 162191
* [clang.py] Add CachedProperty decoratorGregory Szorc2012-08-191-0/+25
| | | | | | It isn't used anywhere yet. llvm-svn: 162190
* [cindex.py] Use spaces, not tabs for indentationTobias Grosser2012-08-181-1/+1
| | | | | | Reported by: Francisco Lopes <oblita@gmail.com> llvm-svn: 162182
* [cindex.py] Dispose code completion results properlyTobias Grosser2012-08-181-1/+1
| | | | llvm-svn: 162181
* Allow -verify to be used with files that don't have an associated FileEntry.Jordan Rose2012-08-182-60/+156
| | | | | | | | | | | | | | | | | | In Debug builds, VerifyDiagnosticConsumer checks any files with diagnostics to make sure we got the chance to parse them for directives (expected-warning and friends). This check previously relied on every parsed file having a FileEntry, which broke the cling interpreter's test suite. This commit changes the extra debug checking to mark a file as unparsed as soon as we see a diagnostic from that file. At the very end, any files that are still marked as unparsed are checked for directives, and a fatal error is emitted (as before) if we find out that there were directives we missed. -verify directives should always live in actual parsed files, not in PCH or AST files. Patch by Andy Gibbs, with slight modifications by me. llvm-svn: 162171
* Silence a sign compare warning that only occurs on 32 bit platforms.Benjamin Kramer2012-08-181-1/+1
| | | | llvm-svn: 162168
OpenPOWER on IntegriCloud