- Oct 16, 2008
-
-
Daniel Dunbar authored
- Disables the freeing of the ASTContext and the TranslationUnit after parsing & sema. - Primarily for timing the impact on -fsyntax-only timings. llvm-svn: 57643
-
rdar://problem/6239726Steve Naroff authored
and http://llvm.org/bugs/show_bug.cgi?id=2893 llvm-svn: 57640
-
Daniel Dunbar authored
is to encode the state of the #pragma pack stack as an attribute when the structure is declared. - Extend PackedAttr to take an alignment (in bits), and reuse for both __attribute__((packed)) (which takes no argument, instead packing tightly (to "minimize the memory required") and for #pragma pack (which allows specification of the maximum alignment in bytes). __attribute__((packed)) is just encoded as Alignment=1. This conflates two related but different mechanisms, but it didn't seem worth another attribute. - I have attempted to follow the MSVC semantics as opposed to the gcc ones, since if I understand correctly #pragma pack originated with MSVC. The semantics are generally equivalent except when the stack is altered during the definition of a structure; its not clear if anyone does this in practice. See testcase if curious. llvm-svn: 57623
-
- Oct 15, 2008
-
-
Argyrios Kyrtzidis authored
typedef int f(); struct S { f *x; // incorrectly assuming this is function decl, leading to failed assertions. }; llvm-svn: 57598
-
Steve Naroff authored
Note: One day, we should consider moving the actual diags to ObjCQualifiedIdTypesAreCompatible(), since it has more information on the actual problem. GCC currently emits slightly more instructive errors for some cases involving protocols. I added a FIXME to the code. llvm-svn: 57529
-
- Oct 14, 2008
-
-
Argyrios Kyrtzidis authored
llvm-svn: 57514
-
Argyrios Kyrtzidis authored
llvm-svn: 57511
-
Daniel Dunbar authored
- Follows the MSVC (original) implementation, including support of pack(show) (useful for testing). - Implements support for named pack records which gcc seems to ignore (or implements incorrectly). - Not currently wired to anything, only functionality change is the type checking of the pragma. llvm-svn: 57476
-
- Oct 12, 2008
-
-
Chris Lattner authored
llvm-svn: 57391
-
- Oct 10, 2008
-
-
Steve Naroff authored
Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests. llvm-svn: 57337
-
- Oct 09, 2008
-
-
Argyrios Kyrtzidis authored
class C { static const int number = 50; static int arr[number]; }; Here's how it worked: -GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator. -VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr. -On exit they both tried to destroy that one DeclRefExpr. The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator. llvm-svn: 57313
-
- Oct 08, 2008
-
-
Steve Naroff authored
This required changes to attach the compound statement later on (like we do for functions). llvm-svn: 57304
-
Steve Naroff authored
- Modify BlockExpr to reference the BlockDecl. This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?). Still some follow-up work to finish this (forthcoming). llvm-svn: 57298
-
Ted Kremenek authored
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*. llvm-svn: 57275
-
- Oct 07, 2008
-
-
Argyrios Kyrtzidis authored
llvm-svn: 57220
-
Argyrios Kyrtzidis authored
Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr. Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization. In the case of "int x( expression );": -The Init expression of VarDecl 'x' will be the expression inside the parentheses. -VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;". llvm-svn: 57219
-
- Oct 06, 2008
-
-
Ted Kremenek authored
When processing Objective-C foreach statements, first check to see if the statement has a DeclStmt with a single Decl. Afterwards, use DeclStmt::getSolitaryDecl() to access that Decl (thus avoiding an assertion being triggered). These changes remove an unneeded use of ScopedDecl::getNextDeclarator() and DeclStmt::getDecl(). llvm-svn: 57207
-
Ted Kremenek authored
Use "unsigned" instead of "int" for i to remove a "comparison between unsigned and signed" warning (potential integer overflow). llvm-svn: 57201
-
Ted Kremenek authored
Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead of using DeclStmt::getDecl(). llvm-svn: 57196
-
Argyrios Kyrtzidis authored
Add a FIXME until class constructors are supported. llvm-svn: 57188
-
Argyrios Kyrtzidis authored
This is how this kind of initializers appear in the AST: -The Init expression of the VarDecl is a functional type construction (of the VarDecl's type). -The new VarDecl::hasCXXDirectInitializer() returns true. e.g, for "int x(1);": -VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr). -hasCXXDirectInitializer() of VarDecl 'x' returns true. A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code. Note that codegening works now for "int x(1);" without any changes to CodeGen. llvm-svn: 57178
-
Chris Lattner authored
constant lvalue. Implement this in codegen by moving the code out of CGBuiltin into EmitConstantExpr. llvm-svn: 57163
-
Chris Lattner authored
which is checking for something that can be inconsistent with what we can constant fold. llvm-svn: 57159
-
Chris Lattner authored
condition as a constant even if the unevaluated side is a not a constant. We don't do this when extensions are off, and we emit a warning when this happens: t.c:22:11: warning: expression is not a constant, but is accepted as one by GNU extensions short t = __builtin_constant_p(5353) ? 42 : somefunc(); ^ ~~~~~~~~~~ suggestions for improvement are welcome. This is obviously horrible, but is required for real-world code. llvm-svn: 57153
-
Anders Carlsson authored
llvm-svn: 57142
-
- Oct 05, 2008
-
-
Anders Carlsson authored
llvm-svn: 57121
-
- Oct 03, 2008
-
-
Daniel Dunbar authored
llvm-svn: 57019
-
Daniel Dunbar authored
llvm-svn: 56992
-
Steve Naroff authored
This is a temporary solution to help with the block rewriter (though it certainly has general utility). Once DeclGroup's are implemented, this SourceLocation should be stored with it (since it applies to all the decls). llvm-svn: 56985
-
Daniel Dunbar authored
- Enabled for builtins which are always constant expressions (__builtin_huge_val*, __builtin_inf*, __builtin_constant_p, __builtin_classify_type, __builtin___CFStringMakeConstantString). Added Builtin::Context::isConstantExpr. - Currently overly simply interface which only works for builtins whose constantexprness does not depend on their arguments. CallExpr::isBuiltinConstantExpr now takes an ASTContext argument. llvm-svn: 56983
-
- Oct 02, 2008
-
-
Daniel Dunbar authored
versions of sprintf and friends. - Added FIXME that this mechanism should be generalized. llvm-svn: 56962
-
Steve Naroff authored
This commit also includes some name changes in the blocks rewriter (no functionality change). llvm-svn: 56955
-
- Sep 30, 2008
-
-
Chris Lattner authored
llvm-svn: 56880
-
Chris Lattner authored
llvm-svn: 56879
-
Daniel Dunbar authored
llvm-svn: 56859
-
rdar://problem/6191148Steve Naroff authored
Fix <rdar://problem/6191148> [sema] Objective-C method lookup (at global scope) fails to handle overloaded selectors properly. Long standing bug in Sema::ActOnInstanceMessage(). We now warn when messaging an "id" with multiple method signatures in scope. The diags are a little verbose, however they can be streamlined if necessary. llvm-svn: 56843
-
rdar://problem/6247781Steve Naroff authored
Needed to make sure the relaxed type checking only applies to "readonly" properties. llvm-svn: 56838
-
-
- Sep 29, 2008
-
-
Steve Naroff authored
llvm-svn: 56800
-
Steve Naroff authored
Teach Sema::CheckAssignmentConstraints() to allow assignments between id and block pointer types (^{}). llvm-svn: 56793
-