summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove few if-then-else when both branches are theFariborz Jahanian2012-03-272-16/+8
| | | | | | same. pr12357. llvm-svn: 153515
* Commit patch reverted in r153454 with the modified testFariborz Jahanian2012-03-271-6/+11
| | | | | | case that I forgot to check in. llvm-svn: 153512
* Add cross-referencing comments to ParseDirectDeclarator to note thatRichard Smith2012-03-271-2/+6
| | | | | | | isConstructorDeclaration also needs updating for any extension to the grammar of a direct-declarator. llvm-svn: 153490
* Change RetainCountChecker to eagerly "escape" retained objects when they areTed Kremenek2012-03-271-0/+6
| | | | | | | | | | | | assigned to a struct. This is fallout from inlining results, which expose far more patterns where people stuff CF objects into structs and pass them around (and we can reason about it). The problem is that we don't have a general way to detect when values have escaped, so as an intermediate step we need to eagerly prune out such tracking. Fixes <rdar://problem/11104566>. llvm-svn: 153489
* When we see 'Class(X' or 'Class::Class(X' and we suspect that it names aRichard Smith2012-03-271-1/+36
| | | | | | | | | | | | | constructor, but X is not a known typename, check whether the tokens could possibly match the syntax of a declarator before concluding that it isn't a constructor. If it's definitely ill-formed, assume it is a constructor. Empirical evidence suggests that this pattern is much more often a constructor with a typoed (or not-yet-declared) type name than any of the other possibilities, so the extra cost of the check is not expected to be problematic. llvm-svn: 153488
* [driver] Fix unused argument warnings.Chad Rosier2012-03-261-11/+19
| | | | | | | | | | | | 1. Don't short-circuit conditional statements that are checking flags. Otherwise, the driver emits warnings about unused arguments. 2. -mkernel and -fapple-kext imply no exceptions, so claim exception related arguments now to avoid warnings about unused arguments. rdar://11120518 llvm-svn: 153478
* [driver] -mkernel implies -fno-common, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | argument warning. Part of rdar://11120518 llvm-svn: 153470
* [driver] -mkernel implies -fno-builtin, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | argument warning. Part of rdar://11120518 llvm-svn: 153469
* Add a special-case diagnostic for one of the more obnoxious special cases ofRichard Smith2012-03-261-0/+14
| | | | | | | | | | | | | | | unscoped enumeration members: an enumerator name which is visible in the out-of-class definition of a member of a templated class might not actually exist in the instantiation of that class, if the enumeration is also lexically defined outside the class definition and is explicitly specialized. Depending on the result of a CWG discussion, we may have a different resolution for a class of problems in this area, but this fixes the immediate issue of a crash-on-invalid / accepts-invalid (depending on +Asserts). Thanks to Johannes Schaub for digging into the standard wording to find how this case is currently specified to behave. llvm-svn: 153461
* Revert r153443 "objective-c modern translator: extern "C" exported", it ↵Daniel Dunbar2012-03-261-11/+6
| | | | | | fails in testing. llvm-svn: 153454
* [analyzer] Malloc: Allow a pointer to escape through OSAtomicEnqueue.Anna Zaks2012-03-261-1/+2
| | | | llvm-svn: 153453
* add tbaa metadata to vtable pointer loads/storesKostya Serebryany2012-03-265-2/+20
| | | | llvm-svn: 153447
* Move CodeCompletionBuilder's chunk adding methods out of line.Benjamin Kramer2012-03-262-38/+65
| | | | | | | This makes sense because chunk's ctor is also out of line and simplifies considerably when inlined with a constant parameter. Shrinks clang on i386-linux-Release+Asserts by 65k. llvm-svn: 153446
* When diagnosing an invalid out-of-line redeclaration, don't permitDouglas Gregor2012-03-262-5/+19
| | | | | | | typo correction to introduce a nested-name-specifier; we aren't prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>. llvm-svn: 153445
* objective-c modern translator: extern "C" exportedFariborz Jahanian2012-03-261-6/+11
| | | | | | symbols. // rdar://11103982 llvm-svn: 153443
* Canonicalize the declaration we write to a PCH file for anDouglas Gregor2012-03-261-1/+1
| | | | | | | | InjectedClassNameType; otherwise, it won't be properly wired to the original (canonical) declaration when it is deserialized. Fixes <rdar://problem/11112464>. llvm-svn: 153442
* Driver: Factor string vector push_back into a helper class and optimize it.Benjamin Kramer2012-03-261-264/+174
| | | | | | | | | | Due to lack of move semantics we would create a temporary std::string from the string literal, copy it into the vector and discard the temporary. This leads to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts. While there add a two-element overload for push_back, simplifying code a bit. llvm-svn: 153441
* ThreadSafetyReporter: Manage diagnostics in a std::list.Benjamin Kramer2012-03-261-7/+5
| | | | | | | | | std::list is expensive, but so is std::sorting a SmallVector of SmallVectors of heavyweight PartialDiagnostics. Saves ~30k in a i386-linux-Release+Asserts clang build. llvm-svn: 153437
* Handle instantiations of redeclarations of forward-declared enumerations withinRichard Smith2012-03-261-3/+15
| | | | | | | templated functions. Build a redeclaration chain, and only instantiate the definition of the enum when visiting the defining declaration. llvm-svn: 153427
* Delay checking of dependent underlying types for redeclarations of memberRichard Smith2012-03-262-6/+19
| | | | | | enumerations in templates until the template is instantiated. llvm-svn: 153426
* Since this change is generating a considerable amount of discussion (and ↵Aaron Ballman2012-03-251-56/+46
| | | | | | possibly even a regression for known bad versions), I'm reverting it. llvm-svn: 153420
* No longer hard coding paths to the MinGW include directories; using a ↵Aaron Ballman2012-03-251-46/+56
| | | | | | | | regular expression instead. Patch thanks to Nikola Smiljanic llvm-svn: 153413
* clang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the ↵NAKAMURA Takumi2012-03-251-7/+4
| | | | | | map. llvm-svn: 153407
* clang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.NAKAMURA Takumi2012-03-251-2/+5
| | | | | | evaluateAsBooleanConditionNoCache(S) might update the map and invalidate the iterator. llvm-svn: 153406
* Simplify some users of DenseMap::erase.Benjamin Kramer2012-03-244-16/+4
| | | | llvm-svn: 153389
* remove declaration of _objc_empty_vtable no longerFariborz Jahanian2012-03-241-1/+0
| | | | | | used in modern objc translator. // rdar://11105680 llvm-svn: 153386
* moderin objc translator: remove 'const' from remainingFariborz Jahanian2012-03-241-7/+7
| | | | | | fields in _class_ro_t metadata. // rdar://11079898 llvm-svn: 153384
* Add back r153360 with a fix for enums that cover all the 32 bit values.Rafael Espindola2012-03-242-8/+63
| | | | | | Thanks to NAKAMURA Takumi for finding it! llvm-svn: 153383
* Revert r153360 (and r153380), "Second part of PR12251. Produce the range ↵NAKAMURA Takumi2012-03-242-62/+8
| | | | | | | | | | metadata in clang for booleans and". For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier. It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range. llvm-svn: 153382
* [analyzer] Tighten up the realloc() failure path note generation...make sure ↵Jordy Rose2012-03-241-22/+31
| | | | | | we get the right realloc()! llvm-svn: 153370
* [analyzer] Restart path diagnostic generation if any of the visitors change ↵Jordy Rose2012-03-242-34/+65
| | | | | | | | | | the report configuration while walking the path. This required adding a change count token to BugReport, but also allowed us to ditch ImmutableList as the BugReporterVisitor data type. Also, remove the hack from MallocChecker, now that visitors appear in the opposite order. This is not exactly a fix, but the common case -- custom diagnostics after generic ones -- is now the default behavior. llvm-svn: 153369
* [analyzer] Add a clone() method to BugReporterVisitor, so that we'll be able ↵Jordy Rose2012-03-243-3/+13
| | | | | | to reset diagnostic generation. llvm-svn: 153368
* [parser] If there are unmatched braces in a function definition, try toArgyrios Kyrtzidis2012-03-241-5/+8
| | | | | | | | | recover by returning the statements that we parsed so far, instead of dropping the whole function body. rdar://10967343 llvm-svn: 153367
* Second part of PR12251. Produce the range metadata in clang for booleans andRafael Espindola2012-03-242-8/+62
| | | | | | c++ enums. llvm-svn: 153360
* Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix upRichard Smith2012-03-233-8/+23
| | | | | | some calling code to actually pass in a non-null type, to avoid a crash. llvm-svn: 153358
* use EP_OptimizerLast instead of EP_ScalarOptimizerLate for ThreadSanitizerKostya Serebryany2012-03-231-1/+1
| | | | llvm-svn: 153356
* Make sure we don't accept an @interface inside another objc containerArgyrios Kyrtzidis2012-03-231-4/+6
| | | | | | just because there was an attribute in front of it. llvm-svn: 153355
* When defining a forward-declared enum, don't try to attach the definition toRichard Smith2012-03-232-3/+5
| | | | | | | a previous declaration if the redeclaration is invalid. That way lies madness. Fixes a crash-on-invalid reported by Abramo. llvm-svn: 153349
* Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.Akira Hatanaka2012-03-232-11/+91
| | | | | | Patch by Simon Atanasyan. llvm-svn: 153348
* Avoid applying retain/release effects twice in RetainCountChecker when a ↵Ted Kremenek2012-03-233-7/+13
| | | | | | function call was inlined (i.e., we do not need to apply summaries in such cases). llvm-svn: 153309
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-239-54/+136
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* corrected check::EndOfTranslationUnit checker name and added 'const' to ↵Anton Yartsev2012-03-231-3/+3
| | | | | | declaration llvm-svn: 153302
* [CFG] Cache boolean evaluations of expressions to avoid multiple re-evaluationsArgyrios Kyrtzidis2012-03-231-7/+66
| | | | | | | | | | during construction of branches for chained logical operators. This makes -fsyntax-only for test/Sema/many-logical-ops.c about 32x times faster. With measuring SemaExpr.cpp I see differences below the noise level. llvm-svn: 153297
* modern objc translation of block literal expressionsFariborz Jahanian2012-03-231-5/+47
| | | | | | | declared at file scope. // rdar://11006566 llvm-svn: 153293
* When an MMX output variable is tied to the input variable, we have to implicitlyBill Wendling2012-03-221-1/+6
| | | | | | | cast the value to x86_mmx. This gives the ASM string the correct call signature. <rdar://problem/10919182> llvm-svn: 153290
* Make sure we correctly set the alignment for vector loads and stores ↵Eli Friedman2012-03-222-19/+33
| | | | | | associated with vector element lvalues. Patch by Kevin Schoedel (with some minor modifications by me). llvm-svn: 153285
* Fix static analyzer crash on code taking the address of a field. Fixes PR ↵Ted Kremenek2012-03-221-0/+7
| | | | | | 11146. llvm-svn: 153283
* [analyzer] Add the stat for the number of successfully explored paths.Anna Zaks2012-03-221-1/+5
| | | | llvm-svn: 153281
* [analyzer] Add stats useful for coverage investigations.Anna Zaks2012-03-222-0/+24
| | | | llvm-svn: 153280
* [analyzer] Add inlining awareness to the block coverage computationAnna Zaks2012-03-221-5/+12
| | | | | | (Stats Checker). llvm-svn: 153279
OpenPOWER on IntegriCloud