summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert r103770, "Added basic source locations to Elaborated and DependentNameDaniel Dunbar2010-05-145-106/+24
| | | | | | types.", it is breaking Clang bootstrap. llvm-svn: 103775
* Make sure that value-initialized pointers to data members are initialized ↵Anders Carlsson2010-05-141-1/+1
| | | | | | correctly. llvm-svn: 103771
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-145-24/+106
| | | | llvm-svn: 103770
* Namespaces can only be defined at global or namespace scope. Fixes PR6596.Douglas Gregor2010-05-141-0/+8
| | | | llvm-svn: 103767
* Make sure to search semantic scopes and appropriate template-parameterDouglas Gregor2010-05-141-16/+48
| | | | | | | scopes during unqualified name lookup that has fallen out to namespace scope. Fixes PR7133. llvm-svn: 103766
* A vtable is used if the key function is defined... even if that keyDouglas Gregor2010-05-141-2/+1
| | | | | | | function's definition is an out-of-class definition marked "inline". Fixes an assertion in WebKit. llvm-svn: 103763
* C++/Darwin/x86: Teach IRgen it can pass reference types in registers.Daniel Dunbar2010-05-141-2/+2
| | | | llvm-svn: 103761
* Driver: Enable -integrated-as by default, at least for Darwin/x86 without ↵Daniel Dunbar2010-05-142-3/+15
| | | | | | | | -static. - How else will we figure out what is broken, eh? llvm-svn: 103759
* Fix context in class static variable's debugging information entry.Devang Patel2010-05-131-4/+13
| | | | | | This fixes bunch of failures in gdb testsuite. llvm-svn: 103745
* Disable the available_externally optimization for inline virtualDouglas Gregor2010-05-131-11/+0
| | | | | | | | | | | | methods for which the key function is guaranteed to be in another translation unit. Unfortunately, this guarantee isn't the case when dealing with shared libraries that fail to export these virtual method definitions. I'm reopening PR6747 so we can consider this again at a later point in time. llvm-svn: 103741
* Objective-C++ Sema. Fix a bug in instantiation of receivers.Fariborz Jahanian2010-05-131-1/+6
| | | | | | Completes radar 7963410. llvm-svn: 103719
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-1316-219/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions. The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily). From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass). Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable. Fixes PR7114 and PR6564. llvm-svn: 103718
* Don't add a null successor to a CFGBlock when the contents of an ↵Ted Kremenek2010-05-131-2/+1
| | | | | | | | @synchronized statement is empty. Fixes <rdar://problem/7979430>. llvm-svn: 103717
* Teach the AKA calculation to look at sugar on the pointee type for pointers andChandler Carruth2010-05-131-64/+69
| | | | | | | | references. This is a WIP as we should handle function pointers, etc. Reshuffle the code to do this to facilitate recursing in this manner, and to check for the type already being printed first rather than last. llvm-svn: 103712
* Rebuild builtin_id * as an ObjCObjectPointerType, where builtin_id is theJohn McCall2010-05-131-5/+13
| | | | | | magic type that 'id' is a pointer to. llvm-svn: 103708
* Relax an assertion. Various cases could lead to non-symbol values.Zhongxing Xu2010-05-131-1/+4
| | | | llvm-svn: 103707
* When performing template argument deduction, match Objective C pointersJohn McCall2010-05-131-3/+9
| | | | | | against pointer patterns. llvm-svn: 103706
* Delete a dead function at sabre's request.Chandler Carruth2010-05-131-11/+0
| | | | llvm-svn: 103705
* Update the types for warning option subgroup arrays to 'short', we have moreChandler Carruth2010-05-131-4/+4
| | | | | | | than 127 groups so this was already failing given -fsigned-char. A subsequent to commit to TableGen will generate shorts for the arrays themselves. llvm-svn: 103703
* add a couple of key functions for classes without them.Chris Lattner2010-05-132-1/+5
| | | | llvm-svn: 103688
* If given location is invalid then use current location.Devang Patel2010-05-122-107/+58
| | | | | | | | | This fixes recent regressions reported by gdb testsuite. Tighter verification of debug info generated by FE found these regressions. Refactor code to extract line number and column number from SourceLocation. llvm-svn: 103678
* Objective-C++ Sema. Support for conversion of a C++Fariborz Jahanian2010-05-123-0/+34
| | | | | | | class object used as a receiver to an objective-c pointer via a converwsion function. wip. llvm-svn: 103672
* "this patch properly addresses escaping < and > which might appearChris Lattner2010-05-121-1/+2
| | | | | | | | | | | (e.g. for C++ operators) in the xml dump. I also re-enabled the unit test for ast-print-xml (or so I think) at least, make test didn't fail..." patch by Sebastien Binet! llvm-svn: 103671
* improve comments.Chris Lattner2010-05-121-3/+3
| | | | llvm-svn: 103670
* Driver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't ↵Daniel Dunbar2010-05-121-1/+11
| | | | | | support the necessary ABI yet. llvm-svn: 103632
* Simplify.Daniel Dunbar2010-05-121-3/+3
| | | | llvm-svn: 103631
* Objective-C++ Sema - Allow static_cast of one objc pointer toFariborz Jahanian2010-05-121-1/+5
| | | | | | another. llvm-svn: 103630
* Whenever we instantiate a function definition or class, enter a newDouglas Gregor2010-05-122-0/+4
| | | | | | | potentially-evaluated expression context, to ensure that used declarations get properly marked. Fixes PR7123. llvm-svn: 103624
* When we emit an error during the implicit definition of a specialDouglas Gregor2010-05-122-5/+41
| | | | | | | | member function (default constructor, copy constructor, copy assignment operator, destructor), emit a note showing where that implicit definition was required. llvm-svn: 103619
* Improve commentary on the indirect-goto jump scope checker and extractJohn McCall2010-05-121-69/+76
| | | | | | a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
* When checking scopes for indirect goto, be more permissive (but still safe)John McCall2010-05-121-70/+249
| | | | | | | | | | | | | | | | | | | | | | | | | about the permitted scopes. Specifically: 1) Permit labels and gotos to appear after a prologue of variable initializations. 2) Permit indirect gotos to jump out of scopes that don't require cleanup. 3) Diagnose possible attempts to indirect-jump out of scopes that do require cleanup. This requires a substantial reinvention of the algorithm for checking indirect goto. The current algorithm is Omega(M*N), with M = the number of unique scopes being jumped from and N = the number of unique scopes being jumped to, with an additional factor that is probably (worst-case) linear in the depth of scopes. Thus the entire thing is likely cubic given some truly bizarre ill-formed code; on well-formed code the additional factor collapses to an amortized constant (when amortized over the entire function) and so the algorithm is quadratic. Even this requires every label to appear in its own scope, which would be very unusual for indirect-goto code (and extremely unlikely for well-formed code); it is far more likely that all labels will be in the same scope and so the algorithm becomes linear. For such a marginal feature, I am fairly happy with this result. (this is using JumpDiagnostic's definition of scope, where successive variables in a block appear in their own scope) llvm-svn: 103536
* Use end location of DeclStmt to mark stop point. Devang Patel2010-05-121-1/+4
| | | | | | This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite. llvm-svn: 103533
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-1127-354/+305
| | | | llvm-svn: 103517
* Speculatively revert r103497, "Do not mark the virtual members of anDaniel Dunbar2010-05-113-89/+10
| | | | | | implicitly-instantiated class as ...", which seems to have broken bootstrap. llvm-svn: 103515
* IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.Daniel Dunbar2010-05-111-0/+24
| | | | | | - Fixes PR7098. llvm-svn: 103514
* Do not mark the virtual members of an implicitly-instantiated class asDouglas Gregor2010-05-113-10/+89
| | | | | | | | referenced unless we see one of them defined (or the key function defined, if it as one) or if we need the vtable for something. Fixes PR7114. llvm-svn: 103497
* VISIBILITY_HIDDEN was renamed LLVM_LIBRARY_VISIBILITY.Duncan Sands2010-05-112-33/+33
| | | | llvm-svn: 103494
* It's bad form to create VarDecl's without DeclContextsDouglas Gregor2010-05-111-1/+3
| | | | llvm-svn: 103484
* The C++98/03 standard is disturbingly silent about out-of-scopeDouglas Gregor2010-05-111-3/+12
| | | | | | | | | | explicit instantiations of template. C++0x clarifies the intent (they're ill-formed in some cases; see [temp.explicit] for details). However, one could squint at the C++98/03 standard and conclude they are permitted, so reduce the error to a warning (controlled by -Wc++0x-compat) in C++98/03 mode. llvm-svn: 103482
* Static data members intialized in-class that have constant values areDouglas Gregor2010-05-111-1/+1
| | | | | | | | value-dependent if their initializers are value-dependent; my recent tweak to these dependent rules overstepped by taking away this value-dependents. Fixes a Boost.GIL regression. llvm-svn: 103476
* Minor refactoring of my last patch.Fariborz Jahanian2010-05-111-4/+5
| | | | llvm-svn: 103475
* Fix indentationDouglas Gregor2010-05-111-1/+1
| | | | llvm-svn: 103465
* A DeclRefExpr that refers to a member function or a static data memberDouglas Gregor2010-05-112-4/+25
| | | | | | | | | | | | | | of the current instantiation is value-dependent. The C++ standard fails to enumerate this case and, therefore, we missed it. Chandler did all of the hard work of reducing the last remaining Boost.PtrContainer failure (which had to do with static initialization in the Serialization library) down to this simple little test. While I'm at it, clean up the dependence rules for template arguments that are declarations, and implement the dependence rules for template argument packs. llvm-svn: 103464
* Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor2010-05-112-3/+3
| | | | llvm-svn: 103458
* Initialize Column.Devang Patel2010-05-101-6/+12
| | | | llvm-svn: 103448
* Allow static_cast to objective-c pointers.Fariborz Jahanian2010-05-101-2/+3
| | | | | | Fixes radar 7952457. llvm-svn: 103447
* Refactor the constant-evaluator so that it only supports a single formJohn McCall2010-05-101-62/+80
| | | | | | | | | of constant-evaluation. Formerly you could control whether it accepted local l-values or not; now it always evaluates local l-values in the core routines, but filters them out where consumed by the top-level routines. This will make it much easier to cache evaluability. llvm-svn: 103444
* Objective-C++ Code gen. Handle code gen. for propertyFariborz Jahanian2010-05-102-2/+20
| | | | | | | reference dot-syntax notation in a varierty of cases. Fixes radar 7964490. llvm-svn: 103440
* Allocate most of DeclarationNamesTable using ASTContext's allcocator. The ↵Ted Kremenek2010-05-102-27/+22
| | | | | | | | only things that aren't allocated this way are the internal FoldingSets. llvm-svn: 103429
* Start converting pieces of DeclarationNameTable to be allocated using ↵Ted Kremenek2010-05-102-5/+16
| | | | | | | | | | ASTContext's allocator. While DeclarationNameTable doesn't leak, it uses 'malloc' too often. Start with having 'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method to DeclarationNameTable that is called by ~ASTContext. llvm-svn: 103426
OpenPOWER on IntegriCloud