- Sep 29, 2008
-
-
Steve Naroff authored
llvm-svn: 56800
-
- Sep 28, 2008
-
-
Chris Lattner authored
wasn't covering checking builtins like __builtin___vsnprintf_chk) with a check that won't get out of date. llvm-svn: 56767
-
- Sep 17, 2008
-
-
- Sep 12, 2008
-
-
Daniel Dunbar authored
- For investigating warnings in system headers / builtins. - Currently also enables the behavior that allows silent redefinition of types in system headers. Conceptually these are separate but I didn't feel it was worth two options (or changing LangOptions). llvm-svn: 56163
-
- Sep 09, 2008
-
-
Argyrios Kyrtzidis authored
No functionality change. llvm-svn: 56014
-
Steve Naroff authored
- Replace string comparisons with pre-defined idents. - Avoid calling isBuiltinObjCType() to avoid two checks. - Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl(). - Have Sema::MergeTypeDefDecl() set the new type. This is a moidified version of an patch by David Chisnall. llvm-svn: 55990
-
- Sep 08, 2008
-
-
Daniel Dunbar authored
- Patch from Kevin Tew. llvm-svn: 55940
-
- Sep 05, 2008
-
-
Ted Kremenek authored
Add comment back that Argiris pointed out that I mistakenly removed (the comments below it were stale, so I accidently removed the whole thing). llvm-svn: 55841
-
Ted Kremenek authored
Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it. This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet). The motivation of this patch is as follows: - Capture more source information, necessary for refactoring/rewriting clients. - Pave the way to resolve ownership issues with RecordDecls with the forthcoming addition of DeclGroups. Current caveats: - Until DeclGroups are in place, we will leak RecordDecls not explicitly referenced by the AST. For example: typedef struct { ... } x; The RecordDecl for the struct will be leaked because the TypedefDecl doesn't refer to it. This will be solved with DeclGroups. - This patch also (temporarily) breaks CodeGen. More below. High-level changes: - As before, TagType still refers to a TagDecl, but it doesn't own it. When a struct/union/class is first referenced, a RecordType and RecordDecl are created for it, and the RecordType refers to that RecordDecl. Later, if a new RecordDecl is created, the pointer to a RecordDecl in RecordType is updated to point to the RecordDecl that defines the struct/union/class. - TagDecl and RecordDecl now how a method 'getDefinition()' to return the TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular enum/struct/class/union. This is useful from going from a RecordDecl* that defines a forward declaration to the RecordDecl* that provides the actual definition. Note that this also works for EnumDecls, except that in this case there is no distinction between forward declarations and definitions (yet). - Clients should no longer assume that 'isDefinition()' returns true from a RecordDecl if the corresponding struct/union/class has been defined. isDefinition() only returns true if a particular RecordDecl is the defining Decl. Use 'getDefinition()' instead to determine if a struct has been defined. - The main changes to Sema happen in ActOnTag. To make the changes more incremental, I split off the processing of enums and structs et al into two code paths. Enums use the original code path (which is in ActOnTag) and structs use the ActOnTagStruct. Eventually the two code paths will be merged, but the idea was to preserve the original logic both for comparison and not to change the logic for both enums and structs all at once. - There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls that correspond to the same type simply have a pointer to that type. If we need to figure out what are all the RecordDecls for a given type we can build a backmap. - The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the changes to RecordDecl. For some reason 'svn' marks the entire file as changed. Why is CodeGen broken: - Codegen assumes that there is an equivalence between RecordDecl* and RecordType*. This was true before because we only created one RecordDecl* for a given RecordType*, but it is no longer true. I believe this shouldn't be too hard to change, but the patch was big enough as it is. I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C). llvm-svn: 55839
-
Ted Kremenek authored
llvm-svn: 55822
-
Ted Kremenek authored
Remove "NextDecl" from RecordDecl. This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration. The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType. llvm-svn: 55821
-
- Sep 03, 2008
-
-
Daniel Dunbar authored
- PR2730 llvm-svn: 55739
-
Ted Kremenek authored
llvm-svn: 55707
-
- Sep 02, 2008
-
-
Ted Kremenek authored
When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new [CXX]RecordDecl with the RecordDecl chain. llvm-svn: 55652
-
Eli Friedman authored
offset-of-like expressions. llvm-svn: 55627
-
Eli Friedman authored
I'll try to come up with a correct fix for the testcase sometime soon. llvm-svn: 55614
-
- Sep 01, 2008
-
-
Nuno Lopes authored
llvm-svn: 55609
-
Nuno Lopes authored
llvm-svn: 55607
-
- Aug 29, 2008
-
-
Nico Weber authored
llvm-svn: 55538
-
- Aug 26, 2008
-
-
Daniel Dunbar authored
- Add ObjCMethodDecl::createImplicitParams. - Remove ObjCMethodDecl::set{Self,Cmd}Decl - Remove Sema::CreateImplicitParameter No (intended) functionality change. llvm-svn: 55356
-
- Aug 25, 2008
-
-
Eli Friedman authored
correctly. Not a regression, but made more obvious by my recent fix which made function type compatibility checking a bit more strict. llvm-svn: 55339
-
Eli Friedman authored
casting pointers to integers. Eventually, we should check whether we can evaluate an expression using Expr::tryEvaluate, and this codepath should be tightened to only handle standard-compliant cases. llvm-svn: 55331
-
- Aug 22, 2008
-
-
Anders Carlsson authored
llvm-svn: 55166
-
Eli Friedman authored
testing compatibility. This is necessary for some constructs, like merging redeclarations. Also, there are some ObjC changes to make sure that typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any ObjC code beyond the testsuite, so please tell me if there are any cases where this doesn't behave as expected. llvm-svn: 55158
-
- Aug 20, 2008
-
-
Ted Kremenek authored
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl. llvm-svn: 55037
-
- Aug 19, 2008
-
-
Argyrios Kyrtzidis authored
Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr): Expr -> CastExpr -> ExplicitCastExpr -> ImplicitCastExpr llvm-svn: 54955
-
- Aug 17, 2008
-
-
Chris Lattner authored
llvm-svn: 54874
-
- Aug 11, 2008
-
-
Daniel Dunbar authored
- Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
-
Daniel Dunbar authored
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
-
Daniel Dunbar authored
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into implementation .cpp llvm-svn: 54626
-
- Aug 10, 2008
-
-
Steve Naroff authored
Cleanup from yesterday...make isTentativeDefinition() a static helper function (no need for it to be part of the Sema API). llvm-svn: 54613
-
Steve Naroff authored
Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly). llvm-svn: 54612
-
Chris Lattner authored
llvm-svn: 54605
-
- Aug 09, 2008
-
-
Steve Naroff authored
Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate. Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec. llvm-svn: 54583
-
Argyrios Kyrtzidis authored
at which point the C++ struct/class/union is fully parsed. llvm-svn: 54569
-
- Aug 08, 2008
-
-
Steve Naroff authored
- Move checking from MergeVarDecl->FinializeDeclaratorGroup. Since MergeVarDecl is called before the initializer is attacted, it can't be done there (this removes a long standing FIXME). - Add Sema::isTentativeDefinition() and Sema::CheckForFileScopedRedefinitions(). - Remove FIXME's and touch-up test case. Still some more work to do (forthcoming)... llvm-svn: 54533
-
- Aug 07, 2008
-
-
Steve Naroff authored
Fixes <rdar://problem/6093889> Nested enum redefinition crashes sema. llvm-svn: 54463
-
- Aug 06, 2008
-
-
Daniel Dunbar authored
scimark2 on Darwin. - Added Sema support for asm-label on variables, which I forgot before. - Update CodeGen to use GlobalDeclMap to determine if static Decls require emission (instead of LLVM module name lookup). Important since the Decl name and the LLVM module name can differ. - <rdar://problem/6116729> llvm-svn: 54388
-
- Aug 05, 2008
-
-
Daniel Dunbar authored
ActOnDeclarator. llvm-svn: 54353
-
Daniel Dunbar authored
- ActOnDeclarator now takes an additional parameter which is the AsmLabel if used. Its unfortunate that this bubbles up this high, but we cannot just lump it in as an attribute without mistakenly *accepting* it as an attribute. - The actual asm-label itself is, however, encoded as an AsmLabelAttr on the FunctionDecl. - Slightly improved parser error recovery on malformed asm-labels. - CodeGen support still missing... llvm-svn: 54339
-