aboutsummaryrefslogtreecommitdiff
path: root/Sema/SemaDecl.cpp
AgeCommit message (Collapse)Author
2008-02-04Add experimental support for address space qualified types. Address spaceChristopher Lamb
qualifiers use the __attribute__((address_space(id))) syntax. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46691 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Hack Sema::MergeTypeDefDecl() to silently ignore duplicate typedef's in ↵Steve Naroff
system headers files. A bizarre, non-standard hook that many compilers appear to implement (sigh:-). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Add TODO marker so that it is easier to search.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Ignore __aligned__ with zero arguments in addition to __aligned__ with Eli Friedman
one argument. Lets stuff using pthread.h compile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Many refinements to Sema::MergeVarDecl(). This routine still needs some ↵Steve Naroff
re-work to fully handle tentative decls. This includes a fix to bz1908. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Use the canonical type when comparing array types so the comparison Eli Friedman
doesn't get confused by typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Implement "private extern" on function decls!Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()). Steve Naroff
Test case included from bz1948 (thanks Neil!). Also fixed an 80 column violation... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Add more support for Apple's "private extern" extension...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Replace Sema::CheckVariableInitList, CheckConstantInitList, and ↵Steve Naroff
CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers. This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-) Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46339 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Fix a bug recovering from broken code with a goto that Eli reported.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46336 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22- Add Sema::CheckStringLiteralInit, Sema::IsStringLiteralInit.Steve Naroff
- Use previous hooks to simplify Sema::CheckInitializerTypes()... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21Sema::CheckInitializerTypes(). Start simpliying and cleaning up...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule ↵Steve Naroff
when dealing with arrays. Bug submitted by Eli. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for ↵Steve Naroff
tentative definitions with incomplete types. Touch up all test cases that are effected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46152 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function ↵Steve Naroff
declarations/definitions). Patch by Carl Lewis! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14Fix build issue on cygwin, patch by Sam BishopChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14Fix crasher when redefining functions. Not 100% pleased with this solution, ↵Steve Naroff
but it is clearly an improvement. Will discuss with Chris later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12Add first pieces of support for parsing and representing Chris Lattner
extern "C" in C++ mode. Patch by Mike Stump! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10- Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I ↵Steve Naroff
noticed it was missing). - Rename CheckInitializer() to CheckInitializerTypes(). - Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately. - Added CheckForConstantInitializer(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45840 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-09Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls ↵Steve Naroff
that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-09Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 ↵Steve Naroff
6.7.2.2p4). Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek
some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04Merge all the 'assignment' diagnostic code into one routine, decloning Chris Lattner
it from several places. This merges the diagnostics, making them more uniform and fewer in number. This also simplifies and cleans up the code. Some highlights: 1. This removes a bunch of very-similar diagnostics. 2. This renames AssignmentCheckResult -> AssignConvertType 3. This merges PointerFromInt + IntFromPointer which were always treated the same. 4. This updates a bunch of test cases that have minor changes to the produced diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03give better diagnostics for converting between function pointer and void*.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02When promoting array to pointer for argument, don't lose type qualifiers.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Fix the embarassing typo for real this time (- vs _), sorry about breaking ↵Anders Carlsson
the tests Steve. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Revert Anders r45191 commit...it broke several of the tests.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Fix an embarassing typo and add some very limited support for the aligned ↵Anders Carlsson
attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Normalize attribute names if possible so we won't have to do two strcmps for ↵Anders Carlsson
every attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19fix broken assert.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18Fix const propagation bug.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Sema::ActOnFinishFunctionBody(): Since we no longer synthesize a ↵Steve Naroff
FunctionDecl for each method, remove the unconditional initialization to 0 and corresponding comment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45008 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12TargetInfo no longer includes a reference to SourceManager.Ted Kremenek
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12split objc pieces of SemaDecl.cpp out into SemaDeclObjC.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44925 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11simplify code now that isConstantExpr really does alwaysChris Lattner
return a loc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11For @optional unimplemented methods do not issue the warning.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44872 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Change err_undef_protocolref to warn_undef_protocolref (this is consistent ↵Steve Naroff
with GCC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Explicitly set the string literal type from "char *" to "constant array of ↵Steve Naroff
char". At this point, I am fairly certain the front-end is correct. Unfortunately, the back-end is still unhappy. That said, I've commented out the two lines in globalinit.c that are causing problems. Chris, please have a look...thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10Add support for initializing char arrays from string literals.Steve Naroff
Adapted from a patch by Anders Carlsson. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07Have Sema::CheckConstantInitList skip semantic analysis when the element ↵Steve Naroff
type is a record (until we implement the FIXME). This removes a bogus error for the following code... snarofflocal% cat bug.m #import <Foundation/NSGeometry.h> #define NUMHELICOPTERRECTS 5 static NSRect helicopterRects[NUMHELICOPTERRECTS] = { {{27, 0}, {18, 11}}, // Bottom {{0, 8}, {4, 11}}, // Tail {{0, 16}, {50, 1}}, {{22, 5}, {18, 12}}, // Body {{0, 10}, {42, 3}} }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44684 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07Rewrite 'super' within a class method. This required some minor tweaks to ↵Steve Naroff
the front-end. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Revert DidWarn change - It won't catch all cases anyway and GCC warns for ↵Anders Carlsson
every excess element. Maybe later we can add back the limit and make it smarter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44603 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Recognize CompoundLiteralExpr's as valid lvalue's.Steve Naroff
Also updated a FIXME in Sema::CheckInitializer()... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44602 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Simplified setting up Method's scope before generating AST for its nody.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Handle initializing vector elements correctly. Emit just one warning if ↵Anders Carlsson
there are excess initializers, instead of one per initializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02restore these lines, which fixes some regtest failures.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02improve VC++ compatibility, patch by Cédric Venet.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44496 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29Yesterday, I simplified how we stream top-level decls.Steve Naroff
After a discussion with Ted, we both came to the conclusion that adding a "HandleTopLevelDeclaration" hook to ASConsumer is far more elegant. The default implementation of HandleTopLevelDeclaration will be responsible for iterating over the ScopedDecl (which has a chain of the decls:-). TODO: Once Ted adds HandleTopLevelDeclaration, make sure TagDecls are chainged appropriately... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44445 91177308-0d34-0410-b5e6-96231b3b80d8