- May 22, 2010
-
-
Douglas Gregor authored
enum contexts (along with block contexts, which we already did). Fixes PR7196. llvm-svn: 104444
-
- May 15, 2010
-
-
John McCall authored
ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
-
Douglas Gregor authored
return value optimization. Sema marks return statements with their NRVO candidates (which may or may not end up using the NRVO), then, at the end of a function body, computes and marks those variables that can be allocated into the return slot. I've checked this locally with some debugging statements (not committed), but there won't be any tests until CodeGen comes along. llvm-svn: 103865
-
- May 13, 2010
-
-
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
-
Chandler Carruth authored
llvm-svn: 103705
-
- May 11, 2010
-
-
Abramo Bagnara authored
llvm-svn: 103517
-
- May 06, 2010
-
-
John McCall authored
"bottom-up" when implicit casts and comparisons are inserted, compute them "top-down" when the full expression is finished. Makes it easier to coordinate warnings and thus implement -Wconversion for signedness conversions without double-warning with -Wsign-compare. Also makes it possible to realize that a signedness conversion is okay because the context is performing the inverse conversion. Also simplifies some logic that was trying to calculate the ultimate comparison/result type and getting it wrong. Also fixes a problem with the C++ explicit casts which are often "implemented" in the AST with a series of implicit cast expressions. llvm-svn: 103174
-
- Apr 24, 2010
-
-
Anders Carlsson authored
llvm-svn: 102260
-
Anders Carlsson authored
llvm-svn: 102249
-
Anders Carlsson authored
Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come. llvm-svn: 102245
-
Anders Carlsson authored
llvm-svn: 102218
-
- Apr 09, 2010
-
-
Douglas Gregor authored
the implicit template instantiations we need to perform. Otherwise, we end up erroneously diagnosing static functions as used if they were only used within an implicit template instantiation. Fixes a bunch of spurious failures when building Clang with Clang. llvm-svn: 100872
-
- Mar 25, 2010
-
-
Douglas Gregor authored
how to handle a diagnostic during template argument deduction, which may be "substitution failure", "suppress", or "report". This keeps us from, e.g., emitting warnings while performing template argument deduction. llvm-svn: 99560
-
- Mar 23, 2010
-
-
Ted Kremenek authored
are called (transitively) by regular functions/blocks within a translation untion. llvm-svn: 99233
-
- Mar 19, 2010
-
-
Douglas Gregor authored
ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
-
- Mar 02, 2010
-
-
Douglas Gregor authored
which has the label map, switch statement stack, etc. Previously, we had a single set of maps in Sema (for the function) along with a stack of block scopes. However, this lead to funky behavior with nested functions, e.g., in the member functions of local classes. The explicit-stack approach is far cleaner, and we retain a 1-element cache so that we're not malloc/free'ing every time we enter a function. Fixes PR6382. Also, tweaked the unused-variable warning suppression logic to look at errors within a given Scope rather than within a given function. The prior code wasn't looking at the right number-of-errors count when dealing with blocks, since the block's count would be deallocated before we got to ActOnPopScope. This approach works with nested blocks/functions, and gives tighter error recovery. llvm-svn: 97518
-
- Mar 01, 2010
-
-
Chris Lattner authored
a fixme and PR6451. Only perform jump checking if the containing function has no errors, and add the infrastructure needed to do this. On the testcase in the PR, we produce: t.cc:6:3: error: illegal goto into protected scope goto later; ^ t.cc:7:5: note: jump bypasses variable initialization X x; ^ llvm-svn: 97497
-
- Feb 12, 2010
-
-
Tanya Lattner authored
llvm-svn: 95940
-
- Feb 09, 2010
-
-
Douglas Gregor authored
it available within the AST library, of which Sema is one client. No functionality change. llvm-svn: 95701
-
- Feb 02, 2010
-
-
Ted Kremenek authored
This is to address a serious performance problem observed when running 'clang -fsyntax-only' on really broken source files. In one case, repeatedly calling CorrectTypo() caused one source file to be rejected after 2 minutes instead of 1 second. This patch causes typo correction to take neglible time on that file while still providing correction results for the first 20 cases. I felt this was a reasonable number for moderately broken source files. I don't claim this is the best solution. Comments welcome. It is necessary for us to address this issue because it is a serious performance problem. llvm-svn: 95049
-
- Jan 31, 2010
-
-
Sebastian Redl authored
Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list. llvm-svn: 94968
-
- Jan 13, 2010
-
-
John McCall authored
llvm-svn: 93362
-
- Jan 10, 2010
-
-
Anton Korobeynikov authored
1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
-
- Jan 05, 2010
-
-
John McCall authored
overlap between this and -Wsign-compare, which is why I want them in the same place. llvm-svn: 92543
-
- Dec 29, 2009
-
-
Anders Carlsson authored
llvm-svn: 92246
-
- Dec 19, 2009
-
-
John McCall authored
llvm-svn: 91772
-
- Dec 07, 2009
-
-
Anders Carlsson authored
Rework how virtual member functions are marked. If a class has no key function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557. llvm-svn: 90752
-
John McCall authored
but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
-
- Nov 26, 2009
-
-
Douglas Gregor authored
maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
-
Fariborz Jahanian authored
This fixes pr5611. llvm-svn: 89895
-
- Nov 23, 2009
-
-
Fariborz Jahanian authored
objective-c pointer type. This was a serious mishap and luckily, Ted's test caught that (and patch fixes the test case). llvm-svn: 89680
-
- Nov 21, 2009
-
-
Fariborz Jahanian authored
type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
-
- Nov 19, 2009
-
-
Fariborz Jahanian authored
Will do it later. Fixes pr5552. llvm-svn: 89269
-
- Nov 13, 2009
-
-
Daniel Dunbar authored
- Provide Sema in callbacks, instead of requiring it in constructor. This eliminates the need for a factory function. Clients now just pass the object to consume the results in directly. - CodeCompleteConsumer is cheap to construct, so building it whenever we are doing code completion is reasonable. Doug, please review. llvm-svn: 87099
-
- Nov 11, 2009
-
-
John McCall authored
the -Wconversion check. llvm-svn: 86891
-
Douglas Gregor authored
with its corresponding template parameter. This can happen when we performed some substitution into the default template argument and what we had doesn't match any more, e.g., template<int> struct A; template<typename T, template<T> class X = A> class B; B<long> b; Previously, we'd emit a pretty but disembodied diagnostic showing how the default argument didn't match the template parameter. The diagnostic was good, but nothing tied it to the *use* of the default argument in "B<long>". This commit fixes that. Also, tweak the counting of active template instantiations to avoid counting non-instantiation records, such as those we create for (surprise!) checking default arguments, instantiating default arguments, and performing substitutions as part of template argument deduction. llvm-svn: 86884
-
- Nov 07, 2009
-
-
John McCall authored
core requirements. Fixes rdar://problem/6389954 llvm-svn: 86364
-
John McCall authored
type (or smaller) to stay "closed" within the type. llvm-svn: 86356
-
John McCall authored
significant work left to be done to reduce the false-positive rate here. llvm-svn: 86326
-
- Nov 04, 2009
-
-
John McCall authored
appears in a deprecated context. In the new strategy, we emit the warnings as usual unless we're currently parsing a declaration, where "declaration" is restricted to mean a decl group or a few special cases in Objective C. If we *are* parsing a declaration, we queue up the deprecation warnings until the declaration has been completely parsed, and then emit them only if the decl is not deprecated. We also standardize the bookkeeping for deprecation so as to avoid special cases. llvm-svn: 85998
-