summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* When block-capturing a variable with a non-trivial destructor,John McCall2011-04-282-2/+13
| | | | | | | | | | make sure to mark the destructor. This normally isn't required, because the destructor should have been marked as part of the declaration of the local, but it's necessary when the variable is a parameter because it's the call sites that are responsible for those destructors. llvm-svn: 130372
* A few corrections to type traits that missed the last checkinJohn Wiegley2011-04-281-19/+46
| | | | llvm-svn: 130371
* Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin ↵Francois Pichet2011-04-285-6/+19
| | | | | | | | | | | | | | defines to real types. Otherwise statements like: __int64 var = __int64(0); would be expanded to: long long var = long long(0); and fail to compile. llvm-svn: 130369
* Convert assertion in memset checking to a runtime check (because real code ↵Ted Kremenek2011-04-281-1/+6
| | | | | | may provide a deviant definition of memset). llvm-svn: 130368
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-2813-25/+471
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* More cleanup of template argument deduction and its handling ofDouglas Gregor2011-04-282-6/+43
| | | | | | | non-CVR qualifiers. We can now properly match address-space--qualified references during template argument deduction. llvm-svn: 130365
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-2813-0/+246
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* Clean up the handling of non-CVR qualifiers in template argumentDouglas Gregor2011-04-271-5/+3
| | | | | | | deduction. The good news is that address spaces are a lot less broken in this regard than I'd expected. llvm-svn: 130346
* t/clang/type-traitsJohn Wiegley2011-04-277-28/+314
| | | | | | | | | | Patch authored by John Wiegley. These type traits are used for parsing code that employs certain features of the Embarcadero C++ compiler. Several of these constructs are also desired by libc++, according to its project pages (such as __is_standard_layout). llvm-svn: 130342
* Remove unused method CFGBlock::hasBinaryBranchTerminator().Ted Kremenek2011-04-271-26/+0
| | | | llvm-svn: 130336
* Don't print fixits for format specifiers in cases where the fixit does not ↵Eli Friedman2011-04-271-12/+27
| | | | | | | | actually fix the warning. PR8781. I'm not sure what the preferred way to write a test for whether a fixit is emitted. llvm-svn: 130335
* Heh, funny thing, 'void' isn't a POD type. Nice of us to suggest it toChandler Carruth2011-04-271-1/+1
| | | | | | | | silence this warning. ;] Fixed that obvious bug and added a bit more testing as well. llvm-svn: 130318
* Re-enable byval for ARM in clang. rdar://problem/7662569Stuart Hastings2011-04-271-11/+22
| | | | llvm-svn: 130312
* Some refactoring of my ms_struct patch.Fariborz Jahanian2011-04-273-10/+10
| | | | | | // rdar://8823265 related. llvm-svn: 130311
* When printing a base-specifier, print the ellipsis ("...") if it is aDouglas Gregor2011-04-271-0/+3
| | | | | | pack expansion. Fixes PR9452. llvm-svn: 130310
* ASTImporter support for NestedNameSpecifier, from Olaf KrzikallaDouglas Gregor2011-04-271-1/+40
| | | | llvm-svn: 130307
* This is the next step in building the standalone tools infrastructure:Manuel Klimek2011-04-274-3/+429
| | | | | | | | | | | | | | | This patch simplifies writing of standalone Clang tools. As an example, we add clang-check, a tool that runs a syntax only frontend action over a .cc file. When you integrate this into your favorite editor, you get much faster feedback on your compilation errors, thus reducing your feedback cycle especially when writing new code. The tool depends on integration of an outstanding patch to CMake to work which allows you to always have a current compile command database in your cmake output directory when you set CMAKE_EXPORT_COMPILE_COMMANDS. llvm-svn: 130306
* More accurately model realloc() when the size argument is 0. realloc() with ↵Lenny Maiorani2011-04-271-11/+27
| | | | | | | | a size of 0 is equivalent to free(). The memory region should be marked as free and not used again. Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks! llvm-svn: 130303
* Add a warning (-Wnon-pod-memset) for calls to memset() withChandler Carruth2011-04-271-0/+34
| | | | | | | | | | a destination pointer that points to a non-POD type. This can flag such horrible bugs as overwriting vptrs when a previously POD structure is suddenly given a virtual method, or creating objects that crash on practically any use by zero-ing out a member when its changed from a const char* to a std::string, etc. llvm-svn: 130299
* Diagnose attempts to implicitly instantiate a template before it isJohn McCall2011-04-271-2/+11
| | | | | | fully defined. Somehow this escaped notice for a very long time. llvm-svn: 130298
* Introduce a new parser annotation token for primary expressions. WhenDouglas Gregor2011-04-272-27/+20
| | | | | | | ClassifyName() builds a primary expression, generate one of these annotation tokens rather than jumping into the parser. llvm-svn: 130297
* Remove this assert, I don't think it's being helpful and people haveEric Christopher2011-04-271-1/+0
| | | | | | been running into it. llvm-svn: 130296
* Clean out some cruft I introduced when adding Sema::ClassifyName()Douglas Gregor2011-04-272-26/+0
| | | | llvm-svn: 130295
* Simplify the parser's handling of Sema::ClassifyName() for types, byDouglas Gregor2011-04-273-57/+7
| | | | | | | creating a type-annotation token rather than jumping into the declaration parsing. llvm-svn: 130293
* Allow 'Environment::getSVal()' to allow an optional way for checkers to do a ↵Ted Kremenek2011-04-272-2/+17
| | | | | | | | direct lookup to values bound to expressions, without resulting to lazy logic. This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression. llvm-svn: 130292
* If a null statement was preceded by an empty macro keep its instantiation ↵Argyrios Kyrtzidis2011-04-275-9/+13
| | | | | | | | source location in NullStmt. llvm-svn: 130289
* Extend Sema::ClassifyName() to support C++, ironing out a few issuesDouglas Gregor2011-04-274-40/+68
| | | | | | | | | in the classification of template names and using declarations. We now properly typo-correct the leading identifiers in statements to types, templates, values, etc. As an added bonus, this reduces the number of lookups required for disambiguation. llvm-svn: 130288
* When compiling with -fno-threadsafe-statics, guard variables for globals ↵Anders Carlsson2011-04-271-5/+13
| | | | | | with internal linkage don't have to be i64, i8 works just fine! llvm-svn: 130286
* Improve diagnostics for typo correction via Sema::ClassifyName(), byDouglas Gregor2011-04-271-3/+19
| | | | | | | | looking at the context and the correction and using a custom diagnostic. Also, enable some Fix-It tests that were somewhat lamely disabled. llvm-svn: 130283
* FixOverloadedFunctionReference needs to rebuild member accesses of John McCall2011-04-272-12/+23
| | | | | | | | instance methods to have bound-member type. Fixing that broke __unknown_anytype, which I've in turn fixed. llvm-svn: 130266
* When comparing Objective-C pointers during overload resolution toDouglas Gregor2011-04-271-12/+17
| | | | | | | | | | | determine which is a better conversion to "void*", be sure to perform the comparison using the safe-for-id ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id ASTContext::canAssignObjCInterfaces(). Fixes <rdar://problem/9327203>. llvm-svn: 130259
* With ms_struct attribut, Zero-length bitfields following Fariborz Jahanian2011-04-262-6/+61
| | | | | | non-bitfield members are ignore. // rdar://8823265 wip llvm-svn: 130257
* When computing Objective-C pointer conversions in C++, retainDouglas Gregor2011-04-261-5/+39
| | | | | | | | | | | the qualifiers (e.g., GC qualifiers) on the type we're converting from, rather than just blindly adopting the qualifiers of the type we're converting to or dropping qualifiers altogether. As an added bonus, properly diagnose GC qualifier mismatches to eliminate a crash in the overload resolution failure diagnostics. llvm-svn: 130255
* To be able to replay compilations we need to accurately remodel howManuel Klimek2011-04-266-34/+100
| | | | | | | | | includes get resolved, especially when they are found relatively to another include file. We also try to get it working for framework includes, but that part of the code is untested, as I don't have a code base that uses it. llvm-svn: 130246
* We need pointer size in bits here.Devang Patel2011-04-261-1/+1
| | | | llvm-svn: 130244
* Gcc pads the size of an array using the alignment of its elements.Argyrios Kyrtzidis2011-04-261-0/+1
| | | | | | | The size of the array may not be aligned according to alignment of its elements if an alignment attribute is specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637. llvm-svn: 130242
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-2618-170/+265
| | | | | | | | | | | bound member function, i.e. something of the form 'x.f' where 'f' is a non-static member function. Diagnose this in the general case. Some of the new diagnostics are probably worse than the old ones, but we now get this right much more universally, and there's certainly room for improvement in the diagnostics. llvm-svn: 130239
* IRgen/Darwin: Fix refacto introduced in Triple changes.Daniel Dunbar2011-04-261-1/+1
| | | | llvm-svn: 130233
* Add ms_struct attribute on record typeeFariborz Jahanian2011-04-264-0/+17
| | | | | | (and ignore it for now) - wip. llvm-svn: 130224
* Emit a -Wnull-dereference warning for "*null" not just "*null = something". ↵Argyrios Kyrtzidis2011-04-261-19/+22
| | | | | | Addresses rdar://9269271. llvm-svn: 130207
* Temporarily revert r130176, it appears to have broken a few tests.Eric Christopher2011-04-261-22/+11
| | | | llvm-svn: 130179
* Emit intrinsic at current insert point, not at the end of current block.Devang Patel2011-04-251-1/+1
| | | | llvm-svn: 130177
* Turn on byval parameters in Clang for ARM APCS. rdar://problem/7662569Stuart Hastings2011-04-251-11/+22
| | | | llvm-svn: 130176
* Simplify. There is no need to have a method to just call another method.Devang Patel2011-04-252-26/+14
| | | | llvm-svn: 130175
* Generalize case for built-in expressions havingFariborz Jahanian2011-04-251-11/+4
| | | | | | | side-effect to generate their ir. Not just for __builtin_expect. // rdar://9330105 llvm-svn: 130172
* For the warnings related to -Wparentheses, display first the note about how ↵Argyrios Kyrtzidis2011-04-251-16/+16
| | | | | | | | to silence the warning and any other suggestion after that. Related to rdar://9300260. llvm-svn: 130169
* Re-enable disable free optimization where the FrontendAction is not freed ↵Ted Kremenek2011-04-251-1/+4
| | | | | | when -disable-free is passed. This accidentally was commited in r128011. llvm-svn: 130168
* When generating printf fixits, preserve the original formating for unsigned ↵Ted Kremenek2011-04-251-1/+3
| | | | | | integers (e.g., 'x', 'o'). llvm-svn: 130164
* Ir-gen the side-effect(s) when __builtin_expect isFariborz Jahanian2011-04-251-0/+9
| | | | | | constant-folded. // rdar://9330105 llvm-svn: 130163
* Fix a crash when ASTReader emits diagnostic when another one is in flight. ↵Argyrios Kyrtzidis2011-04-251-4/+11
| | | | | | Fixes rdar//9334563. llvm-svn: 130162
OpenPOWER on IntegriCloud