summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Support arithmetic on pointer-to-function types as a GNUDouglas Gregor2009-01-231-4/+39
| | | | | | extension. Addresses clang PR/3371. llvm-svn: 62823
* Reimplement the handling of the "current object" in designatorDouglas Gregor2009-01-222-149/+209
| | | | | | | | | | | initializers, so that we are within the appropriate subobject after we've processed a multi-designator designation. We're matching GCC and EDG's behavior on all examples I've found thus far. *Huge* thanks to Eli Friedman for pointing out my fundamental misunderstanding of "current object" in the C99 spec. llvm-svn: 62812
* inline Sema::getLangOptions, rdar://6515190. This speeds upChris Lattner2009-01-222-6/+4
| | | | | | fsyntax-only with PTH by 3%. llvm-svn: 62774
* EXTWARNify the warning about unnamed typedefs of enumsDouglas Gregor2009-01-221-2/+3
| | | | llvm-svn: 62766
* Initial implementation of semantic analysis and ASTs for C99Douglas Gregor2009-01-224-38/+374
| | | | | | | | | | | | | | | | | | designated initializers. This implementation should cover all of the constraints in C99 6.7.8, including long, complex designations and computing the size of incomplete array types initialized with a designated initializer. Please see the new test-case and holler if you find cases where this doesn't work. There are still some wrinkles with GNU's anonymous structs and anonymous unions (it isn't clear how these should work; we'll just follow GCC's lead) and with designated initializers for the members of a union. I'll tackle those very soon. CodeGen is still nonexistent, and there's some leftover code in the parser's representation of designators that I'll also need to clean up. llvm-svn: 62737
* Fix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work ↵Steve Naroff2009-01-211-1/+3
| | | | | | | | around a Visual Studio compiler bug. Thanks to Doug Gregor for the suggestion. llvm-svn: 62723
* Fix an inline asm sema bug that I introduced.Anders Carlsson2009-01-211-2/+2
| | | | llvm-svn: 62666
* Don't look up decls with no name (such as parameters and unnamed tagged types),Chris Lattner2009-01-211-13/+15
| | | | | | this removes 4266 calls to LookupDecl. llvm-svn: 62662
* Convert expressions over to Sebastian's spiffy ASTContext::new() operator.Steve Naroff2009-01-211-113/+106
| | | | | | No functionality change. llvm-svn: 62640
* Provide a placement new taking an ASTContext argument.Sebastian Redl2009-01-201-8/+6
| | | | | | | This allows more concise syntax when allocating an object using the ASTContext's allocator. Convert a few allocations to this operator to for test purposes. llvm-svn: 62623
* Fix a crash Anders' was seeing due to free'ing an invalid pointerChris Lattner2009-01-201-12/+2
| | | | | | caused by my previous commit. llvm-svn: 62613
* Convert more exprs to use ASTContext's Allocator.Steve Naroff2009-01-201-11/+18
| | | | | | | | When using a BumpPtrAllocator, this reduces malloc overhead from 2.2->1.9% (for Cocoa.h). At this point, malloc() has dropped the fourth most expensive routine (behind Preprocessor::HandleIdentifier()). llvm-svn: 62612
* Improvements to Sema of asm statements. Fixes <rdar://problem/6156893>Anders Carlsson2009-01-201-7/+16
| | | | llvm-svn: 62609
* Allocate expresssions through ASTContext (still more work to do).Steve Naroff2009-01-201-23/+36
| | | | | | Add debug hook to DeclContext. llvm-svn: 62605
* Optimize Declarator to avoid malloc/free traffic for the argument list of aChris Lattner2009-01-201-1/+1
| | | | | | | | | | | | | | | | function DeclaratorChunk in common cases. This uses a fixed array in Declarator when it is small enough for the first function declarator chunk in a declarator. This eliminates all malloc/free traffic from DeclaratorChunk::getFunction when running on Cocoa.h except for five functions: signal/bsd_signal/sigset, which have multiple Function DeclChunk's, and CFUUIDCreateWithBytes/CFUUIDGetConstantUUIDWithBytes, which take more than 16 arguments. This patch was pair programmed with Steve. llvm-svn: 62599
* Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and ↵Douglas Gregor2009-01-201-1/+1
| | | | | | document both it and DeclContext::addDecl properly llvm-svn: 62581
* Remove the TopLevelDecls from TranslationUnit, since all of those decls are ↵Douglas Gregor2009-01-201-1/+0
| | | | | | owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow llvm-svn: 62568
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-2012-129/+102
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Convert more expression actions to smart pointers.Sebastian Redl2009-01-192-84/+97
| | | | llvm-svn: 62537
* Type of property and its ivar is more restrictiveFariborz Jahanian2009-01-191-0/+15
| | | | | | that rules for assignment. llvm-svn: 62524
* Centralize error reporting of improper uses of incomplete types in theDouglas Gregor2009-01-197-53/+138
| | | | | | | | | | new DiagnoseIncompleteType. It provides additional information about struct/class/union/enum types when possible, either by pointing to the forward declaration of that type or by pointing to the definition (if we're in the process of defining that type). Fixes <rdar://problem/6500531>. llvm-svn: 62521
* Convert more expression actions to smart pointers.Sebastian Redl2009-01-194-241/+281
| | | | | | Fix type of logical negation for C++. llvm-svn: 62475
* Convert a few expression actions to smart pointers.Sebastian Redl2009-01-183-138/+143
| | | | | | These actions are extremely widely used (identifier expressions and literals); still no performance regression. llvm-svn: 62468
* Convert ObjC statement actions to smart pointers.Sebastian Redl2009-01-182-47/+46
| | | | llvm-svn: 62465
* Convert asm statement action to smart pointers.Sebastian Redl2009-01-182-77/+72
| | | | llvm-svn: 62464
* Convert more statement actions to smart pointers.Sebastian Redl2009-01-182-66/+65
| | | | llvm-svn: 62463
* Vector codegen improvementsNate Begeman2009-01-181-1/+1
| | | | llvm-svn: 62458
* Support evaluation of vector constant expressions, and codegen of same.Nate Begeman2009-01-182-8/+7
| | | | llvm-svn: 62455
* Update support for vector component access on ExtVectors.Nate Begeman2009-01-181-38/+39
| | | | llvm-svn: 62440
* Remove outdated diagnostic. Tests are coming.Nate Begeman2009-01-181-11/+1
| | | | llvm-svn: 62437
* Change TargetInfo::validateInputConstraint to take begin/end name iterators ↵Anders Carlsson2009-01-171-1/+2
| | | | | | instead of the number of outputs. No functionality change. llvm-svn: 62433
* Diagnose when method parameter is an object.Fariborz Jahanian2009-01-171-0/+5
| | | | llvm-svn: 62431
* Warn about typedefs of enums without any declarator name. Fixes ↵Douglas Gregor2009-01-171-3/+3
| | | | | | rdar://problem/6503878 llvm-svn: 62397
* PODify LookupResult, for a measly 1% speedup on Cocoa.h.Douglas Gregor2009-01-172-103/+77
| | | | llvm-svn: 62391
* Teach DeclContext how to find the primary declaration for any TagDeclDouglas Gregor2009-01-173-38/+35
| | | | | | | | | | | | | even when we are still defining the TagDecl. This is required so that qualified name lookup of a class name within its definition works (see the new bits in test/SemaCXX/qualified-id-lookup.cpp). As part of this, move the nested redefinition checking code into ActOnTag. This gives us diagnostics earlier (when we try to perform the nested redefinition, rather than when we try to complete the 2nd definition) and removes some code duplication. llvm-svn: 62386
* Convert some more statement actions to smart pointers.Sebastian Redl2009-01-162-64/+81
| | | | | | Fix a type error; parser wanted to pass the third part of a for-statement as a statement; should be expression. llvm-svn: 62380
* Don't ICE (issue diagnostics) when receiver is a non-objcFariborz Jahanian2009-01-161-2/+3
| | | | | | type. llvm-svn: 62355
* Don't ICE on user redeclaration of objc's built-in types.Fariborz Jahanian2009-01-161-4/+11
| | | | | | Issue diagnostics instead if types do not match. llvm-svn: 62349
* silence release-assert warning.Chris Lattner2009-01-161-4/+4
| | | | llvm-svn: 62346
* Fix <rdar://problem/6502934>. We were creating an ImplicitCastExprDouglas Gregor2009-01-161-2/+4
| | | | | | with reference type (it should be an lvalue with non-reference type). llvm-svn: 62345
* minor cleanups to StringLiteralParser: no need to pass target infoChris Lattner2009-01-161-7/+1
| | | | | | | into its ctor. Also, make it handle validity checking of pascal strings instead of making clients do it. llvm-svn: 62332
* Part one of handling C++ functional casts. This handles semanticDouglas Gregor2009-01-161-17/+26
| | | | | | | | analysis and AST-building for the cases where we have N != 1 arguments. For N == 1 arguments, we need to finish the C++ implementation of explicit type casts (C++ [expr.cast]). llvm-svn: 62329
* Use a single function for doing vararg argument promotion. Also, make sure ↵Anders Carlsson2009-01-164-28/+36
| | | | | | to do the promotion before checking the type - fixes PR3340. llvm-svn: 62323
* rename PP::getPhysicalCharacterAt -> PP::getSpelledCharacterAt.Chris Lattner2009-01-161-4/+4
| | | | | | | Slightly speed up sema of numbers like '1' by going directly to TargetInfo instead of through ASTContext. llvm-svn: 62314
* Extract code dealing with typedef declarators into a separate function.Zhongxing Xu2009-01-162-37/+49
| | | | | | No functionality change. llvm-svn: 62303
* Extract code dealing with variable declarator into a separate function.Zhongxing Xu2009-01-162-100/+113
| | | | | | No functionality change. llvm-svn: 62300
* Extract code dealing with declarators of function type into a separate functionZhongxing Xu2009-01-162-288/+307
| | | | | | | Sema::ActOnFunctionDeclarator(). No functionality change. llvm-svn: 62290
* Improve diagnostics for ambiguous name lookup resultsDouglas Gregor2009-01-164-10/+56
| | | | llvm-svn: 62287
* PR3330: given an enum like this:Chris Lattner2009-01-151-2/+3
| | | | | | | | | | | enum E { A = 1U, B }; Don't make an implicit cast expr of null for B. llvm-svn: 62274
* Fix some unused variable, control reaches end of non-void function,Daniel Dunbar2009-01-151-1/+1
| | | | | | and uninitialized use options. llvm-svn: 62270
OpenPOWER on IntegriCloud