summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement promotion for enumeration types.Douglas Gregor2010-02-024-19/+64
| | | | | | | | | | | | | | | | | | | | | | | | | WHAT!?! It turns out that Type::isPromotableIntegerType() was not considering enumeration types to be promotable, so we would never do the promotion despite having properly computed the promotion type when the enum was defined. Various operations on values of enum type just "worked" because we could still compute the integer rank of an enum type; the oddity, however, is that operations such as "add an enum and an unsigned" would often have an enum result type (!). The bug actually showed up as a spurious -Wformat diagnostic (<rdar://problem/7595366>), but in theory it could cause miscompiles. In this commit: - Enum types with a promotion type of "int" or "unsigned int" are promotable. - Tweaked the computation of promotable types for enums - For all of the ABIs, treat enum types the same way as their underlying types (*not* their promotion types) for argument passing and return values - Extend the ABI tester with support for enumeration types llvm-svn: 95117
* Set the correct vtable pointers _before_ generating code for any member ↵Anders Carlsson2010-02-021-5/+10
| | | | | | initializers. Fixes about ~2000 clang/LLVM tests in the clang-on-clang build. llvm-svn: 95116
* update for llvm api change.Chris Lattner2010-02-021-6/+0
| | | | llvm-svn: 95110
* Dump the constructor type for a CXXConstructExpr.John McCall2010-02-021-0/+2
| | | | llvm-svn: 95106
* Fix this comment.John McCall2010-02-021-1/+1
| | | | llvm-svn: 95104
* Check for redefinitions in MergeVarDecl. This finds redefinitions of globals ↵Sebastian Redl2010-02-021-0/+11
| | | | | | without an initializer in C++ and thus fixes PR5451. llvm-svn: 95098
* Fix up rewriting of protocol qualified types in objc rewriter.Fariborz Jahanian2010-02-021-1/+9
| | | | | | Fixes radar 7589414. llvm-svn: 95097
* Fix a C++ regression where redefinitions weren't diagnosed.Sebastian Redl2010-02-021-1/+3
| | | | llvm-svn: 95096
* the declspec of a declaration can have storage-class specifiers,Chris Lattner2010-02-021-7/+18
| | | | | | | | | type qualifiers and type specifiers in any order. For example, this is valid: struct x {...} typedef y; This fixes PR6208. llvm-svn: 95094
* Driver/Darwin: Don't error/warn on conflicting deployment targets. ApparentlyDaniel Dunbar2010-02-021-5/+14
| | | | | | this is still a popular thing to do. llvm-svn: 95093
* Use the Arg variable rather than re-computing it. This also silences GCC'sChandler Carruth2010-02-021-1/+1
| | | | | | unused variable warning. llvm-svn: 95085
* Mark dtors for parameter variables and eliminate some redundant type munging.John McCall2010-02-025-20/+15
| | | | llvm-svn: 95079
* Access control for implicit destructor calls. Diagnostic could be orders ofJohn McCall2010-02-024-4/+34
| | | | | | magnitude clearer. llvm-svn: 95078
* Codegen CXXConstructExprs with trivial constructors as constants.John McCall2010-02-021-0/+23
| | | | | | Eliminates a lot of spurious global initializers, fixing PR6205. llvm-svn: 95077
* Check in a test case and a nasty workaround for PR6199.Anders Carlsson2010-02-021-1/+3
| | | | llvm-svn: 95076
* Extract a common base class between UnresolvedLookupExpr andJohn McCall2010-02-024-107/+44
| | | | | | UnresolvedMemberExpr and employ it in a few places where it's useful. llvm-svn: 95072
* Improve handling of emitting 'null' pointers to data members.Anders Carlsson2010-02-024-51/+101
| | | | llvm-svn: 95066
* Move pointer to data member emission to CodeGenModule and use it in ↵Anders Carlsson2010-02-026-34/+45
| | | | | | CGExprConstant. Fixes PR5674. llvm-svn: 95063
* Improve the diagnostic used when an incompatible overload set is passedJohn McCall2010-02-021-0/+18
| | | | | | as an argument during overload resolution. llvm-svn: 95057
* Implement C++ [temp.deduct.call]p6, template argument deduction for overloadedJohn McCall2010-02-021-31/+111
| | | | | | | | | | arguments. Fix a bug where incomplete explicit specializations were being passed through as legitimate. Fix a bug where the absence of an explicit specialization in an overload set was causing overall deduction to fail. Fixes PR6191. llvm-svn: 95052
* Add a stop gap to Sema::CorrectTypo() to correct only up to 20 typos.Ted Kremenek2010-02-023-2/+12
| | | | | | | | | | | | | | | | | This is to address a serious performance problem observed when running 'clang -fsyntax-only' on really broken source files. In one case, repeatedly calling CorrectTypo() caused one source file to be rejected after 2 minutes instead of 1 second. This patch causes typo correction to take neglible time on that file while still providing correction results for the first 20 cases. I felt this was a reasonable number for moderately broken source files. I don't claim this is the best solution. Comments welcome. It is necessary for us to address this issue because it is a serious performance problem. llvm-svn: 95049
* Fix bug in GRExprEngine::VisitSizeOfAlignOfExpr() where we do not addTed Kremenek2010-02-021-0/+2
| | | | | | | 'Pred' to 'Dst' for cases we currently don't handle. This fixes <rdar://problem/7593875>. llvm-svn: 95048
* Implement PR6180, substantially improving the diagnostics we get fromChris Lattner2010-02-021-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | forgetting a ';' at the end of a struct. For something like: class c { } void foo() {} we now produce: t.cc:3:2: error: expected ';' after class } ^ ; instead of: t.cc:4:1: error: cannot combine with previous 'class' declaration specifier void foo() {} ^ t.cc:2:7: error: 'class c' can not be defined in the result type of a function class c { ^ GCC produces: t.cc:4: error: new types may not be defined in a return type t.cc:4: note: (perhaps a semicolon is missing after the definition of ‘c’) t.cc:4: error: two or more data types in declaration of ‘foo’ I *think* I got the follow set right, but if I forgot anything, we'll start getting spurious "expected ';' after class" errors, let me know if you see any. llvm-svn: 95042
* improve diagnostics for C++ struct ; issues. Before:Chris Lattner2010-02-021-12/+8
| | | | | | | | | | | | | | | | | | | | | | t.cc:4:3: error: expected ';' at end of declaration list int y; ^ t.cc:6:1: error: expected ';' at end of declaration list }; ^ After: t.cc:3:8: error: expected ';' at end of declaration list int x ^ ; t.cc:5:8: error: expected ';' at end of declaration list int z ^ ; llvm-svn: 95039
* improve diagnostics on missing ; in a struct. Before:Chris Lattner2010-02-021-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | t.c:4:3: error: expected ';' at end of declaration list int y; ^ t.c:4:8: warning: extra ';' inside a struct or union int y; ^ t.c:6:1: warning: expected ';' at end of declaration list }; ^ After: t.c:3:8: error: expected ';' at end of declaration list int x // expected-error {{expected ';' at end of declaration list}} ^ ; t.c:5:8: warning: expected ';' at end of declaration list int z ^ ; llvm-svn: 95038
* Hoist diagnostic generation in ReturnStackAddressChecker into a separate ↵Ted Kremenek2010-02-021-58/+69
| | | | | | method. No functionality change. llvm-svn: 95037
* Improve handling of enumerator values for C and C++, including:Douglas Gregor2010-02-011-39/+133
| | | | | | | | | | | | | | | | | - In C++, prior to the closing '}', set the type of enumerators based on the type of their initializer. Don't perform unary conversions on the enumerator values. - In C++, handle overflow when an enumerator has no initializer and its value cannot be represented in the type of the previous enumerator. - In C, handle overflow more gracefully, by complaining and then falling back to the C++ rules. - In C, if the enumerator value is representable in an int, convert the expression to the type 'int'. Fixes PR5854 and PR4515. llvm-svn: 95031
* ARM/APCS: Fix classification of small complex integer types as "integer like".Daniel Dunbar2010-02-011-3/+3
| | | | llvm-svn: 95030
* ARM/APCS: Pass Complex types following llvm-gcc.Daniel Dunbar2010-02-011-0/+8
| | | | llvm-svn: 95029
* Add format string type checking support for 'long double'.Ted Kremenek2010-02-011-1/+4
| | | | llvm-svn: 95026
* Fix FIXME and surrounding comment.Devang Patel2010-02-011-4/+1
| | | | llvm-svn: 95023
* Use appropriate context descriptor in RecordDecl's debug info.Devang Patel2010-02-011-3/+9
| | | | llvm-svn: 95016
* Do not use clang type name to name a local variable, e.g. Decl.Devang Patel2010-02-011-44/+44
| | | | llvm-svn: 95010
* Do not use clang type name to name a local variable, e.g. Decl.Devang Patel2010-02-011-29/+25
| | | | llvm-svn: 95009
* Use DeclContext as getContextDescriptor() argument.Devang Patel2010-02-011-18/+27
| | | | llvm-svn: 95008
* Driver/Darwin: Darwin uses -fobjc-legacy-dispatch on ARM.Daniel Dunbar2010-02-012-1/+6
| | | | llvm-svn: 95006
* NeXT: Add support for -fobjc-legacy-dispatch.Daniel Dunbar2010-02-011-0/+4
| | | | llvm-svn: 95005
* Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.Daniel Dunbar2010-02-012-1/+16
| | | | llvm-svn: 95004
* Don't explicitly force utf strings into the __TEXT,__ustringChris Lattner2010-02-012-8/+0
| | | | | | | | | | by setting the section of the generated global. This is an optimization done by the code generator, and the code being removed didn't handle the case when the string contained an embedded nul (which the code generator does correctly handle). This is rdar://7589850 llvm-svn: 95003
* In C++, an initializer on a variable doesn't necessarily mean it's the ↵Sebastian Redl2010-02-017-30/+29
| | | | | | definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function. llvm-svn: 94999
* fix PR6187: various load functions in xmmintrin.h were missing 'const'.Chris Lattner2010-02-011-7/+7
| | | | | | emmintrin looks ok. llvm-svn: 94998
* Use early return as suggested by Cristian Draghici.Ted Kremenek2010-02-011-12/+9
| | | | llvm-svn: 94994
* Format string checking: selectively ignore implicit casts to 'int'Ted Kremenek2010-02-011-6/+17
| | | | | | | | when checking if the format specifier matches the type of the data argument and the length modifier indicates the data type is 'char' or 'short'. llvm-svn: 94992
* Emit debug info for namespaces.Devang Patel2010-02-012-1/+29
| | | | llvm-svn: 94991
* Note that an overload candidate was non-viable because template argumentJohn McCall2010-02-012-9/+77
| | | | | | | deduction failed. Right now there's a very vague diagnostic for most cases and a good diagnostic for incomplete deduction. llvm-svn: 94988
* Fix for PR5185. C99 [*] VLA notation should be disallowed in function ↵Sam Weinig2010-02-011-0/+14
| | | | | | definitions. llvm-svn: 94972
* Access checking for implicit user-defined conversions.John McCall2010-02-014-17/+60
| | | | llvm-svn: 94971
* Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the ↵Sebastian Redl2010-01-316-56/+97
| | | | | | logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list. llvm-svn: 94968
* Switch expressions like T() and T(1,2) over to new-style initialization. I'mEli Friedman2010-01-314-140/+13
| | | | | | | not quite sure what we want to do about the AST representation; comments welcome. llvm-svn: 94967
* Simplify EmitMemberInitializer; no intended functionality change.Eli Friedman2010-01-311-19/+1
| | | | llvm-svn: 94965
OpenPOWER on IntegriCloud