- 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
-
Ted Kremenek authored
llvm-svn: 103716
-
Chandler Carruth authored
llvm-svn: 103713
-
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
-
-
Ted Kremenek authored
llvm-svn: 103696
-
Chris Lattner authored
llvm-svn: 103688
-
Ted Kremenek authored
can blow out the stack. llvm-svn: 103687
-
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
code. ...", this was a lit bug which should be fixed in r103652. llvm-svn: 103654
-
Ted Kremenek authored
unbreaks the test with lit+Windows. llvm-svn: 103650
-
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
-
Daniel Dunbar authored
llvm-svn: 103615
-
Daniel Dunbar authored
llvm-svn: 103614
-
Ted Kremenek authored
llvm-svn: 103588
-
Ted Kremenek authored
llvm-svn: 103587
-
Ted Kremenek authored
many things. llvm-svn: 103583
-
Ted Kremenek authored
llvm-svn: 103582
-
Ted Kremenek authored
Correctly check if a cursor is a declaration before returning its location/range in clang_getCursorLocation()/clang_getCursorExtent(). This fixes a horrible bug reported in <rdar://problem/7961995> and <rdar://problem/7967123> where declarations with attributes would get grossly annotated with the wrong tokens because the attribute would be interpreted as if it was a Decl*. llvm-svn: 103581
-
Ted Kremenek authored
llvm-svn: 103578
-
Ted Kremenek authored
when annotating tokens. Fixes <rdar://problem/7971430>. llvm-svn: 103577
-
Chris Lattner authored
llvm-svn: 103566
-
John McCall authored
a convenience routine to find the innermost common ancestor of two scopes. llvm-svn: 103565
-
John McCall authored
the test suite after modifying this diagnostic. llvm-svn: 103537
-
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
-