summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Start creating CXXBindReferenceExpr nodes when binding complex types to ↵Anders Carlsson2010-01-315-3/+50
| | | | | | references. llvm-svn: 94964
* Diagnose binding a non-const reference to a vector element.Anders Carlsson2010-01-313-3/+29
| | | | llvm-svn: 94963
* Return early, reduce indentation, and simplify line breaks. No functionalityChandler Carruth2010-01-311-65/+64
| | | | | | | | | change. PS: I'm under the impression formatting-only patches don't need pre-commit review, but feel free to yell at me if I should post these first! =D llvm-svn: 94956
* Really trivial patch to accept pointer to const void in indirect goto. DespiteChandler Carruth2010-01-311-3/+3
| | | | | | the lack of documentation, this matches the behavior of GCC. llvm-svn: 94954
* Fix PR6159 and several other problems with value-dependent non-type templateChandler Carruth2010-01-311-9/+31
| | | | | | | | | | | | | arguments. This both prevents meaningless checks on these arguments and ensures that they are represented as an expression by the instantiation. Cleaned up and added standard text to the relevant test case. Also started adding tests for *rejected* cases. At least one FIXME here where (I think) we allow something we shouldn't. More to come in the area of rejecting crazy arguments with decent diagnostics. Suggestions welcome for still better diagnostics on these errors! llvm-svn: 94953
* Rework base and member initialization in constructors, with severalDouglas Gregor2010-01-3111-343/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (necessarily simultaneous) changes: - CXXBaseOrMemberInitializer now contains only a single initializer rather than a set of initialiation arguments + a constructor. The single initializer covers all aspects of initialization, including constructor calls as necessary but also cleanup of temporaries created by the initializer (which we never handled before!). - Rework + simplify code generation for CXXBaseOrMemberInitializers, since we can now just emit the initializer as an initializer. - Switched base and member initialization over to the new initialization code (InitializationSequence), so that it - Improved diagnostics for the new initialization code when initializing bases and members, to match the diagnostics produced by the previous (special-purpose) code. - Simplify the representation of type-checked constructor initializers in templates; instead of keeping the fully-type-checked AST, which is rather hard to undo at template instantiation time, throw away the type-checked AST and store the raw expressions in the AST. This simplifies instantiation, but loses a little but of information in the AST. - When type-checking implicit base or member initializers within a dependent context, don't add the generated initializers into the AST, because they'll look like they were explicit. - Record in CXXConstructExpr when the constructor call is to initialize a base class, so that CodeGen does not have to infer it from context. This ensures that we call the right kind of constructor. There are also a few "opportunity" fixes here that were needed to not regress, for example: - Diagnose default-initialization of a const-qualified class that does not have a user-declared default constructor. We had this diagnostic specifically for bases and members, but missed it for variables. That's fixed now. - When defining the implicit constructors, destructor, and copy-assignment operator, set the CurContext to that constructor when we're defining the body. llvm-svn: 94952
* Try to unbreak MSVC build.Benjamin Kramer2010-01-311-1/+1
| | | | llvm-svn: 94951
* Fix PR6156 and test several of the basic aspects of non-type template argumentsChandler Carruth2010-01-311-1/+2
| | | | | | when implicitly supplied to the injected class name. llvm-svn: 94948
* Handle instantiation of templates with non-type arguments expressed with anChandler Carruth2010-01-311-0/+16
| | | | | | | explicit '&' by introducing an address-of operator prior to checking the argument's type. llvm-svn: 94947
* When performing a derived-to-base cast that we know will not change the ↵Anders Carlsson2010-01-311-52/+49
| | | | | | offset, we don't need to null check the input pointer. Fixes PR5965. llvm-svn: 94942
* When doing a base-to-derived cast we don't need to null check the derived ↵Anders Carlsson2010-01-311-10/+15
| | | | | | value if the class offset is 0. llvm-svn: 94939
* Some class related cleanup.Anders Carlsson2010-01-316-41/+39
| | | | llvm-svn: 94938
* Simplify.Daniel Dunbar2010-01-301-2/+1
| | | | llvm-svn: 94929
* Remove the SmallVectors from AsmStmt. Fixes PR6105.Anders Carlsson2010-01-302-24/+52
| | | | llvm-svn: 94926
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-308-24/+31
| | | | llvm-svn: 94925
* ASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine isDaniel Dunbar2010-01-301-7/+12
| | | | | | | | | live as long as the ASTUnit. This is useful for clients which want to maintain pointers to the LangOptions object which ultimately lives in the CompilerInvocation, although it would be nice to make all of this ownership stuff more explicit and obvious. llvm-svn: 94924
* CompilerInstance: Change to not contain the CompilerInvocation object.Daniel Dunbar2010-01-301-2/+7
| | | | | | | | This allows clients to install their own CompilerInvocation object, which is important for clients that may wish to create references to things like LangOptions whose lifetime will extend past that of the CompilerInstance. llvm-svn: 94923
OpenPOWER on IntegriCloud