summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Support friend declarations in templates and test that argdep lookupJohn McCall2009-08-141-6/+56
| | | | | | still works. llvm-svn: 78979
* Patch to force synthesis of copy assignment operatorFariborz Jahanian2009-08-131-0/+1
| | | | | | | | function in the order according to c++03. ir-gen for copy assignment in the trivial case and the first test case. llvm-svn: 78938
* change cast to dyn_cast because d may not be a FunctionDeclRyan Flynn2009-08-131-1/+1
| | | | llvm-svn: 78876
* change a dyn_cast to castRyan Flynn2009-08-121-1/+1
| | | | llvm-svn: 78862
* More toward synthesizing copy assignments. SWIP.Fariborz Jahanian2009-08-121-2/+5
| | | | llvm-svn: 78861
* Patch for synthesizing copy assignment operator.Fariborz Jahanian2009-08-121-0/+1
| | | | | | WIP. llvm-svn: 78841
* error on property of objc interface type instead of crashingFariborz Jahanian2009-08-121-0/+2
| | | | llvm-svn: 78826
* Fix a fixme by allocating ShuffleVectorExprs in the ContextNate Begeman2009-08-121-2/+2
| | | | llvm-svn: 78780
* Add newline at end of file.Benjamin Kramer2009-08-111-1/+1
| | | | llvm-svn: 78735
* Patch to warn if a property which is 'assign' by defaultFariborz Jahanian2009-08-111-1/+17
| | | | | | may not implement NSCopying protocol in -fobjc-gc[-only] mode. llvm-svn: 78726
* Add a FriendClassDecl type for holding declarations of friend types in John McCall2009-08-111-54/+84
| | | | | | the AST, and create such declarations. llvm-svn: 78719
* ir-gen support for anonymous union data memberFariborz Jahanian2009-08-111-2/+8
| | | | | | | copying in copy constructors and used in default constructor's initializer list. llvm-svn: 78700
* Fix DISABLE_SMART_POINTERS buildDouglas Gregor2009-08-111-1/+2
| | | | llvm-svn: 78674
* Argument-dependent lookup for friend declarations. Add a new decl type,John McCall2009-08-114-41/+56
| | | | | | | | | | | | FriendFunctionDecl, and create instances as appropriate. The design of FriendFunctionDecl is still somewhat up in the air; you can befriend arbitrary types of functions --- methods, constructors, etc. --- and it's not clear that this representation captures that very well. We'll have a better picture when we start consuming this data in access control. llvm-svn: 78653
* Refactor the template-instantiation logic for expressions into aDouglas Gregor2009-08-114-1407/+2455
| | | | | | | generic tree transformation (also used for recanonicalization) and a small amount of template-instantiation-specific logic. llvm-svn: 78645
* Check whether a tag was defined in a C++ condition declaration using ↵Argyrios Kyrtzidis2009-08-111-13/+5
| | | | | | GetTypeForDeclarator. llvm-svn: 78644
* Take 2 on AltiVec-style vector initializers. Nate Begeman2009-08-105-17/+158
| | | | | | | | | | | | Fixes PR4704 problems Addresses Eli's patch feedback re: ugly cast code Updates all postfix operators to remove ParenListExprs. While this is awful, no better solution (say, in the parser) is obvious to me. Better solutions welcome. llvm-svn: 78621
* Add a CastInfo struct that will be used for cast information when ↵Anders Carlsson2009-08-102-3/+4
| | | | | | constructing cast expressions. Right now it only stores the cast kind, but in the future it might store conversion functions and constructors. llvm-svn: 78599
* fix a couple of problems with section attributes:Chris Lattner2009-08-101-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Passing something that isn't a string used to cause: "argument to annotate attribute was not a string literal" make it say "section attribute" instead. 2. Fix the location of the above message to point to the bad argument instead of the section token. 3. Implement rdar://4341926, by diagnosing invalid section specifiers in the frontend rather than letting them slip all the way to the assembler (a QoI win). An example of #3 is that we used to produce something like this: /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.). Daniel improved clang to use llvm_report_error, so now we got: $ clang t.c -c fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier requires a segment and section separated by a comma. with no loc info. Now we get: $ clang t.c -fsyntax-only t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma int x __attribute__((section("sadf"))); ^ which is nice :) llvm-svn: 78586
* Revert r78535, it is causing a number of failures to build projects.Daniel Dunbar2009-08-104-147/+13
| | | | | | | | | | | | | | | | | | | | | | | | --- Reverse-merging r78535 into '.': D test/Sema/altivec-init.c U include/clang/Basic/DiagnosticSemaKinds.td U include/clang/AST/Expr.h U include/clang/AST/StmtNodes.def U include/clang/Parse/Parser.h U include/clang/Parse/Action.h U tools/clang-cc/clang-cc.cpp U lib/Frontend/PrintParserCallbacks.cpp U lib/CodeGen/CGExprScalar.cpp U lib/Sema/SemaInit.cpp U lib/Sema/Sema.h U lib/Sema/SemaExpr.cpp U lib/Sema/SemaTemplateInstantiateExpr.cpp U lib/AST/StmtProfile.cpp U lib/AST/Expr.cpp U lib/AST/StmtPrinter.cpp U lib/Parse/ParseExpr.cpp U lib/Parse/ParseExprCXX.cpp llvm-svn: 78551
* warn, as gcc does, if __attribute__((malloc)) applied to function returning ↵Ryan Flynn2009-08-091-0/+7
| | | | | | non-pointer type llvm-svn: 78542
* map previously ignored __attribute((malloc)) to noalias attribute of llvm ↵Ryan Flynn2009-08-091-0/+17
| | | | | | function's return llvm-svn: 78541
* AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);Nate Begeman2009-08-094-13/+147
| | | | | | | | In addition to being defined by the AltiVec PIM, this is also the vector initializer syntax used by OpenCL, so that vector literals are compatible with macro arguments. llvm-svn: 78535
* Refactor some code and implement support for global destructors for static ↵Anders Carlsson2009-08-081-1/+1
| | | | | | variables. llvm-svn: 78507
* Use CastExpr::CK_ArrayToPointerDecay and fix an assert.Anders Carlsson2009-08-081-1/+1
| | | | llvm-svn: 78502
* PR4700 - remove shift by 0 warningRyan Flynn2009-08-081-10/+1
| | | | llvm-svn: 78488
* Introduce a new PragmaPack attribute, and use it for #pragma pack. The ↵Anders Carlsson2009-08-082-3/+3
| | | | | | | | PackedAttr now only represents __attribute__((packed)). This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug. llvm-svn: 78483
* getFunctionLevelDeclContext needs to get the previous DeclContext if ↵Anders Carlsson2009-08-081-1/+2
| | | | | | EnterDeclaratorContext has been called. Fixes PR4694. (Doug, please review) llvm-svn: 78480
* Factor some code to get the "function level" DeclContext out into a separate ↵Anders Carlsson2009-08-082-9/+12
| | | | | | function. llvm-svn: 78478
* Make sure to diagnose use of declarations in the case where we create an ↵Anders Carlsson2009-08-081-0/+2
| | | | | | implicit CXXThisExpr. llvm-svn: 78474
* Patch should implement packed enums - PR4098. Credit to Anders Johnsen.Edward O'Callaghan2009-08-083-7/+35
| | | | llvm-svn: 78471
* Get rid of Stmt::Clone now that we can reference count statements instead.Anders Carlsson2009-08-083-6/+5
| | | | llvm-svn: 78452
* Introduce reference counting for statements and expressions, using itDouglas Gregor2009-08-083-24/+18
| | | | | | | to allow sharing of nodes. Simplifies some aspects of template instantiation, and fixes both PR3444 and <rdar://problem/6757457>. llvm-svn: 78450
* Add a CK_ArrayToPointerDecay cast kind.Anders Carlsson2009-08-071-1/+2
| | | | llvm-svn: 78434
* Add CK_ToUnion and use it for aggregate expression codegen.Anders Carlsson2009-08-071-0/+2
| | | | llvm-svn: 78429
* More CastKind work.Anders Carlsson2009-08-075-25/+30
| | | | llvm-svn: 78415
* Just add global scope to the associated namespaces set instead of tracking itJohn McCall2009-08-072-77/+67
| | | | | | | separately. Add the framework (currently unfed) for finding friend declarations during argument-dependent lookup. llvm-svn: 78414
* Use the correct cast kind as suggested by Doug.Anders Carlsson2009-08-071-1/+2
| | | | llvm-svn: 78395
* PR3333: warn when shifting by invalid amountRyan Flynn2009-08-071-0/+23
| | | | llvm-svn: 78385
* Minor refactoring to introduce a new transformation function,Douglas Gregor2009-08-061-1/+18
| | | | | | TransformStmt, into the tree transformer. llvm-svn: 78347
* Drop the friend-inner-class diagnostic from an extwarn to an ext and don'tJohn McCall2009-08-061-2/+2
| | | | | | guard its report on GNUMode. llvm-svn: 78338
* Permit a class to friend its members in C++0x, without restriction.John McCall2009-08-061-7/+18
| | | | | | | Permit a class to friend its class members in C++ 98, as long as extensions are enabled (and even when they aren't, only give an extwarn about it). llvm-svn: 78332
* Set and use Elidable in elimination of copy ctors.Fariborz Jahanian2009-08-062-4/+7
| | | | llvm-svn: 78331
* After reporting ill-formed copy constructor(12.8.p3)Fariborz Jahanian2009-08-061-1/+2
| | | | | | don't recurs and crash. llvm-svn: 78323
* When we encounter a dependent type that was parsed before we know thatDouglas Gregor2009-08-064-1/+147
| | | | | | | | | | | | | | | | | | | | | | we were going to enter into the scope of a class template or class template partial specialization, rebuild that type so that it can refer to members of the current instantiation, as in code like template<typename T> struct X { typedef T* pointer; pointer data(); }; template<typename T> typename X<T>::pointer X<T>::data() { ... } Without rebuilding the return type of this out-of-line definition, the canonical return type of the out-of-line definition (a TypenameType) will not match the canonical return type of the declaration (the canonical type of T*). llvm-svn: 78316
* Implement transformation of template names within the generic treeDouglas Gregor2009-08-062-71/+180
| | | | | | | | | | | | | | | transform, then use the result for template instantiation. The generic transformation fixes a few issues: - It copes better with template template parameters and member templates (when they're implemented). - The logic used to replace template template parameters with their arguments is now centralized in TransformDecl, so that it will apply for other declaration-instantiation steps. - The error-recovery strategy is normalized now, so that any error results in a NULL TemplateName. llvm-svn: 78292
* Implement transformation of nested-name-specifiers within the generalDouglas Gregor2009-08-063-69/+139
| | | | | | | tree transformation. Template instantiation uses this general transformation rather than implementing its own transformation. llvm-svn: 78286
* Support nested-name-specifiers for C++ member access expressions, e.g.,Douglas Gregor2009-08-065-32/+126
| | | | | | | | this->Base::foo from James Porter! llvm-svn: 78278
* add support for FreeBSD's format(printf0,x,y) attribute; allows null format ↵Ryan Flynn2009-08-063-3/+20
| | | | | | string. llvm-svn: 78276
* First pass at friend semantics.John McCall2009-08-064-12/+254
| | | | llvm-svn: 78274
OpenPOWER on IntegriCloud