- May 13, 2010
-
-
Douglas Gregor authored
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
-
Fariborz Jahanian authored
Completes radar 7963410. llvm-svn: 103719
-
Douglas Gregor authored
"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
-
Ted Kremenek authored
Fixes <rdar://problem/7979430>. llvm-svn: 103717
-
Chandler Carruth authored
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
-
John McCall authored
magic type that 'id' is a pointer to. llvm-svn: 103708
-
Zhongxing Xu authored
llvm-svn: 103707
-
John McCall authored
against pointer patterns. llvm-svn: 103706
-
Chandler Carruth authored
llvm-svn: 103705
-
Chandler Carruth authored
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
-
Chris Lattner authored
llvm-svn: 103688
-
Devang Patel authored
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
-
Fariborz Jahanian authored
class object used as a receiver to an objective-c pointer via a converwsion function. wip. llvm-svn: 103672
-
Chris Lattner authored
(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
-
Chris Lattner authored
llvm-svn: 103670
-
- May 12, 2010
-
-
Daniel Dunbar authored
Driver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't support the necessary ABI yet. llvm-svn: 103632
-
Daniel Dunbar authored
llvm-svn: 103631
-
Fariborz Jahanian authored
another. llvm-svn: 103630
-
Douglas Gregor authored
potentially-evaluated expression context, to ensure that used declarations get properly marked. Fixes PR7123. llvm-svn: 103624
-
Douglas Gregor authored
member function (default constructor, copy constructor, copy assignment operator, destructor), emit a note showing where that implicit definition was required. llvm-svn: 103619
-
John McCall authored
a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
-
John McCall authored
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
-
Devang Patel authored
This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite. llvm-svn: 103533
-
- May 11, 2010
-
-
Abramo Bagnara authored
llvm-svn: 103517
-
Daniel Dunbar authored
implicitly-instantiated class as ...", which seems to have broken bootstrap. llvm-svn: 103515
-
Daniel Dunbar authored
- Fixes PR7098. llvm-svn: 103514
-
Douglas Gregor authored
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
-
Duncan Sands authored
llvm-svn: 103494
-
Douglas Gregor authored
llvm-svn: 103484
-
Douglas Gregor authored
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
-
Douglas Gregor authored
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
-
Fariborz Jahanian authored
llvm-svn: 103475
-
Douglas Gregor authored
llvm-svn: 103465
-
Douglas Gregor authored
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
-
Douglas Gregor authored
llvm-svn: 103458
-
Devang Patel authored
llvm-svn: 103448
-
Fariborz Jahanian authored
Fixes radar 7952457. llvm-svn: 103447
-
John McCall authored
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
-
Fariborz Jahanian authored
reference dot-syntax notation in a varierty of cases. Fixes radar 7964490. llvm-svn: 103440
-
- May 10, 2010
-
-
Ted Kremenek authored
aren't allocated this way are the internal FoldingSets. llvm-svn: 103429
-