summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Minor fix to template instantiation, which properly instantiatesDeLesley Hutchins2012-02-161-1/+1
| | | | | | dependent attributes on static members of templatized classes. llvm-svn: 150704
* Thread safety analysis: Don't check for lockable on undefined types.DeLesley Hutchins2012-02-161-0/+3
| | | | llvm-svn: 150702
* Thread-safety analysis: Disable checking inside constructors, destructors, ↵DeLesley Hutchins2012-02-161-6/+24
| | | | | | lock, and unlock functions llvm-svn: 150701
* Thread-Safety: added support for 'this' as a lock expression.DeLesley Hutchins2012-02-161-3/+7
| | | | llvm-svn: 150700
* Allow thread safety attributes on function definitions.DeLesley Hutchins2012-02-163-16/+69
| | | | | | | | For compatibility with gcc, clang will now parse gcc attributes on function definitions, but issue a warning if the attribute is not a thread safety attribute. Warning controlled by -Wgcc-compat. llvm-svn: 150698
* Format string analysis: give 'q' its own enumerator.Hans Wennborg2012-02-163-6/+16
| | | | | | | | | This is in preparation for being able to warn about 'q' and other non-standard format string features. It also allows us to print its name correctly. llvm-svn: 150697
* Tweak link order on Solaris so that global ctors work.David Chisnall2012-02-161-1/+1
| | | | llvm-svn: 150696
* Proper checking of list-initializers for array new expressions.Sebastian Redl2012-02-161-9/+28
| | | | | | This finishes generalized initializer support in Sema. llvm-svn: 150688
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-1613-232/+218
| | | | | | | | hold the used constructor itself."" This reintroduces commit r150682 with a fix for the Bullet benchmark crash. llvm-svn: 150685
* Revert "Make CXXNewExpr contain only a single initialier, and not hold the ↵Sebastian Redl2012-02-1613-218/+232
| | | | | | | | | | used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. llvm-svn: 150684
* Make CXXNewExpr contain only a single initialier, and not hold the used ↵Sebastian Redl2012-02-1613-232/+218
| | | | | | | | | | constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. llvm-svn: 150682
* Shift Microsoft enum extensions from -fms-extensions to -fms-compatibility, ↵Eli Friedman2012-02-161-3/+3
| | | | | | so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>. llvm-svn: 150663
* Initial implementation of IRGen for the lambda ↵Eli Friedman2012-02-162-1/+97
| | | | | | conversion-to-function-pointer operator. llvm-svn: 150660
* [analyzer] Diagnostics: Ensure that the default end of diagnostic pathAnna Zaks2012-02-162-22/+5
| | | | | | | | | | | | | piece can always be generated. The default end of diagnostic path piece was failing to generate on a BlockEdge that was outgoing from a basic block without a terminator, resulting in a very simple diagnostic being rendered (ex: no path highlighting or custom visitors). Reuse another function, which is essentially doing the same thing and correct it not to fail when a block has no terminator. llvm-svn: 150659
* [analyzer] Malloc Checker: Give up when a pointer escapes into a struct.Anna Zaks2012-02-161-0/+6
| | | | | | | | We are not properly handling the memory regions that escape into struct fields, which led to a bunch of false positives. Be conservative here and give up when a pointer escapes into a struct. llvm-svn: 150658
* constexpr tidyups:Richard Smith2012-02-161-33/+80
| | | | | | | | * Fix bug when determining whether && / || are potential constant expressions * Try harder when determining whether ?: is a potential constant expression * Produce a diagnostic on sizeof(VLA) to provide a better source location llvm-svn: 150657
* Start of IRGen for lambda conversion operators.Eli Friedman2012-02-163-0/+20
| | | | llvm-svn: 150649
* Use the new method for specifying garbage collection metadata in the module.Bill Wendling2012-02-161-25/+40
| | | | | | | | | | The garbage collection metadata needs to be merged "intelligently", when two or more modules are linked together, and not merely appended. (Appending creates a section which is too large.) The module flags metadata method is the way to do this. <rdar://problem/8198537> llvm-svn: 150648
* Implicitly define a lambda's conversion functions (to functionDouglas Gregor2012-02-165-2/+81
| | | | | | | | | | | | | pointers and block pointers). We use dummy definitions to keep the invariant that an implicit, used definition has a body; IR generation will substitute the actual contents, since they can't be represented as C++. For the block pointer case, compute the copy-initialization needed to capture the lambda object in the block, which IR generation will need later. llvm-svn: 150645
* Teach clang to add metadata tags to calls and invokes in ObjC withDan Gohman2012-02-164-7/+42
| | | | | | | | | -fno-objc-arc-exceptions. This will allow the optimizer to perform optimizations which are only safe under that flag. This is a part of rdar://10803830. llvm-svn: 150644
* objc-arc: For arc's ivar layout, treat __unsafe_unretained ivarsFariborz Jahanian2012-02-161-0/+4
| | | | | | as unscanned. // rdar://10832643 llvm-svn: 150639
* Revert "Add a completed/incomplete type difference. This allows us to have"Eric Christopher2012-02-152-188/+66
| | | | | | This reverts commit 9a68d4584afcd0853b930bd80235b58736e785b4. llvm-svn: 150637
* Add a completed/incomplete type difference. This allows us to haveEric Christopher2012-02-152-66/+188
| | | | | | | | | | | | | | | | partial types for contexts and forward decls while allowing us to complete types later on for debug purposes. This piggy-backs on the metadata replacement and rauw changes for temporary nodes and takes advantage of the incremental support I added in earlier. This allows us to, if we decide, to limit adding methods and variables to structures in order to limit the amount of debug information output into a .o file. The caching is a bit complicated though so any thoughts on untangling that are welcome. llvm-svn: 150631
* Silence a valgrind warning, and remove an unused var.Kaelyn Uhrain2012-02-151-3/+2
| | | | llvm-svn: 150629
* Support GCC's bug^Wextension allowing class array members to be initalized by aRichard Smith2012-02-151-0/+29
| | | | | | parenthesized braced-init-list in the base/member initialization list. llvm-svn: 150625
* Improve typo correction involving nested name specifiers.Kaelyn Uhrain2012-02-151-18/+112
| | | | | | | | | | | | Snooping in other namespaces when the identifier being corrected is already qualified (i.e. a valid CXXScopeSpec is passed to CorrectTypo) and ranking synthesized namespace qualifiers relative to the existing qualifier is now performed. Support for disambiguating the string representation of synthesized namespace qualifers has also been added (the change to test/Parser/cxx-using-directive.cpp is an example of an ambiguous relative qualifier). llvm-svn: 150622
* Lambda closure types have a conversion function to a block pointerDouglas Gregor2012-02-151-0/+50
| | | | | | | | | | | with the same parameter types and return type as the function call operator. This is the real answer to http://stackoverflow.com/questions/4148242/is-it-possible-to-convert-a-c0x-lambda-to-a-clang-block :) llvm-svn: 150620
* objective-c translator: fixes an obscure rewriting bugFariborz Jahanian2012-02-151-14/+14
| | | | | | which attempted to rewrite the same meta-data twice. llvm-svn: 150618
* Factor the construction of the lambda-to-function-pointer conversion ↵Douglas Gregor2012-02-151-38/+48
| | | | | | function declaration into a separate function. No functionality change llvm-svn: 150617
* Provide common include for all diagnostic headers.David Blaikie2012-02-151-17/+1
| | | | | | Reviewed by Ted Kremenek. llvm-svn: 150616
* Store the warning option corresponding to a diagnostics as an index into the ↵Benjamin Kramer2012-02-151-21/+16
| | | | | | | | option table instead of storing the name. Another 8 bytes + relocation removed from every diagnostic on x86_64. llvm-svn: 150615
* Remove the unuseful -fdiagnostics-show-nameDavid Blaikie2012-02-154-115/+4
| | | | | | | | | | | | | | This option was added in r129614 and doesn't have any use case that I'm aware of. It's possible that external tools are using these names - and if that's the case we can certainly reassess the functionality, but for now it lets us shave out a few unneeded bits from clang. Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool. This removes the actual diagnostic name strings from clang entirely. Reviewed by Chris Lattner & Ted Kremenek. llvm-svn: 150612
* When overload resolution picks an implicitly-deleted special memberDouglas Gregor2012-02-155-14/+74
| | | | | | | | | function, provide a specialized diagnostic that indicates the kind of special member function (default constructor, copy assignment operator, etc.) and that it was implicitly deleted. Add a hook where we can provide more detailed information later. llvm-svn: 150611
* Add some Solaris include paths and fix a -lgcc_eh that apparently should be ↵David Chisnall2012-02-152-1/+10
| | | | | | -lgcc_s. llvm-svn: 150602
* Introduce a new initialization entity for lambda captures, andDouglas Gregor2012-02-153-3/+20
| | | | | | specialize location information and diagnostics for this entity. llvm-svn: 150588
* Fix copy-and-paste error in commentDavid Chisnall2012-02-151-1/+1
| | | | llvm-svn: 150587
* Specialize noreturn diagnostics for lambda expressions.Douglas Gregor2012-02-152-10/+36
| | | | llvm-svn: 150586
* Fix silly precedence error.Douglas Gregor2012-02-151-1/+1
| | | | llvm-svn: 150585
* Specialize the diagnostic complaining about conflicting types ofDouglas Gregor2012-02-151-2/+2
| | | | | | | return statements within a lambda; this diagnostic previously referred to blocks. llvm-svn: 150584
* Implement code completion support for lambda capture lists.Douglas Gregor2012-02-152-17/+123
| | | | llvm-svn: 150583
* First pass at Solaris toolchain support. This version compiles and links helloDavid Chisnall2012-02-155-0/+198
| | | | | | | | world on Solaris 11 for both x86 and x86-64 using the built-in assembler and Solaris (not GNU) ld, however it currently relies on a hard-coded GCC location to find crtbegin.o and crtend.o, as well as libgcc and libgcc_eh. llvm-svn: 150580
* Make -Wformat fix-its preserve original conversion specifiers.Hans Wennborg2012-02-153-14/+22
| | | | | | | | | | | | | | | | | This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType() only fix a conversion specification enough that Clang wouldn't warn about it, as opposed to always changing it to use the "canonical" conversion specifier. (PR11975) This preserves the user's choice of conversion specifier in cases like: printf("%a", (long double)1); where we previously suggested "%Lf", we now suggest "%La" printf("%x", (long)1); where we previously suggested "%ld", we now suggest "%lx". llvm-svn: 150578
* If a static data member of a class template which could be used in a constantRichard Smith2012-02-151-10/+14
| | | | | | | | expression is referenced, defined, then referenced again, make sure we instantiate it the second time it's referenced. This is the static data member analogue of r150518. llvm-svn: 150560
* Implement DR1454. This allows all intermediate results in constant expressionsRichard Smith2012-02-152-166/+267
| | | | | | | | | | | | to be core constant expressions (including pointers and references to temporaries), and makes constexpr calculations Turing-complete. A Turing machine simulator is included as a testcase. This opens up the possibilty of removing CCValue entirely, and removing some copies from the constant evaluator in the process, but that cleanup is not part of this change. llvm-svn: 150557
* [analyzer] Malloc checker: make a bit safer.Anna Zaks2012-02-151-2/+6
| | | | llvm-svn: 150556
* Split reinterpret_casts of member pointers out from CK_BitCast; thisJohn McCall2012-02-1512-44/+148
| | | | | | | | | | | | | | | | | | | | | is general goodness because representations of member pointers are not always equivalent across member pointer types on all ABIs (even though this isn't really standard-endorsed). Take advantage of the new information to teach IR-generation how to do these reinterprets in constant initializers. Make sure this works when intermingled with hierarchy conversions (although this is not part of our motivating use case). Doing this in the constant-evaluator would probably have been better, but that would require a *lot* of extra structure in the representation of constant member pointers: you'd really have to track an arbitrary chain of hierarchy conversions and reinterpretations in order to get this right. Ultimately, this seems less complex. I also wasn't quite sure how to extend the constant evaluator to handle foldings that we don't actually want to treat as extended constant expressions. llvm-svn: 150551
* modern objective-c translator: start writing the main classFariborz Jahanian2012-02-151-7/+133
| | | | | | meta-data. llvm-svn: 150548
* [analyzer] Malloc Checker: add support for reallocf, which always freesAnna Zaks2012-02-151-22/+44
| | | | | | the passed in pointer on failure. llvm-svn: 150533
* [analyzer] Malloc Checker: add support for valloc + minor codeAnna Zaks2012-02-151-12/+19
| | | | | | hardening. llvm-svn: 150532
* Advertize support for constexpr.Richard Smith2012-02-141-1/+1
| | | | llvm-svn: 150524
OpenPOWER on IntegriCloud