Commit Graph

3405 Commits

Author SHA1 Message Date
Douglas Gregor eff93e0401 Improve the representation of template type parameters. We now
canonicalize by template parameter depth, index, and name, and the
unnamed version of a template parameter serves as the canonical.

TemplateTypeParmDecl no longer needs to inherit from
TemplateParmPosition, since depth and index information is present
within the type.

llvm-svn: 63899
2009-02-05 23:33:38 +00:00
Chris Lattner fbe2272fc8 add support to the diagnostics machinery for mapping warnings and
errors to 'fatal' error severity.

llvm-svn: 63894
2009-02-05 22:47:05 +00:00
Ted Kremenek 0ca23d3f73 Add 'AppendValue' to the list of magic CF function names that cause a tracked object to escape. Fixes <rdar://problem/6560661>.
llvm-svn: 63891
2009-02-05 22:34:53 +00:00
Fariborz Jahanian 33f66e640a objc2's nonfragile-abi - API selection for when receiver is a class
llvm-svn: 63881
2009-02-05 20:41:40 +00:00
Anders Carlsson 31f8649f83 Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.
llvm-svn: 63879
2009-02-05 19:43:10 +00:00
Fariborz Jahanian 4f9d349e07 More objc2's API chanes.
llvm-svn: 63878
2009-02-05 19:35:43 +00:00
Douglas Gregor 700792c4e4 Improvements and fixes for name lookup with using directives, from Piotr Rak!
Also, put Objective-C protocols into their own identifier
namespace. Otherwise, we find protocols when we don't want to in C++
(but not in C).

llvm-svn: 63877
2009-02-05 19:25:20 +00:00
Torok Edwin c6853c1531 Add Debian gcc 4.3 header search directories.
llvm-svn: 63872
2009-02-05 18:12:45 +00:00
Fariborz Jahanian 9065541262 #ifdef'out out objc2 API selection which is not done in gcc (unlike
the documentation to the contrary).

llvm-svn: 63871
2009-02-05 18:00:27 +00:00
Sebastian Redl 0fb63471de Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.

llvm-svn: 63868
2009-02-05 15:12:41 +00:00
Sebastian Redl 726a0d9524 Put the invalid flag of OwningResult into the Action pointer.
This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two.
This leads to simpler client code and speeds up my benchmark by 2.7%.
For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp.

llvm-svn: 63867
2009-02-05 15:02:23 +00:00
Sebastian Redl 16d307d8d0 Remove some non-ASCII in comment.
llvm-svn: 63866
2009-02-05 12:33:33 +00:00
Daniel Dunbar 5d3dbd64e1 Implement Direct ABIInfo semantics.
- No intended functionality change, this is essentially enabling
   direct passing of complex and aggregate values, which no ABI is
   using.

llvm-svn: 63863
2009-02-05 11:13:54 +00:00
Daniel Dunbar cea3af4e54 Simplify test for whether we need an alloca to hold an indirect return
value.
 - No functionality change.

llvm-svn: 63859
2009-02-05 09:24:53 +00:00
Daniel Dunbar 747865af0c Implement ABI Indirect sematics for arguments.
- No intended functionality change, all current ABI implementations
   were only using indirect for complex/aggregate types, which were
   being passed indirectly with the Direct ABIInfo kind.

llvm-svn: 63858
2009-02-05 09:16:39 +00:00
Daniel Dunbar b8b1c679c4 Merge ABIInfo StructRet/ByVal into Indirect.
- No (intended) functionality change, the semantic changes are to come.

llvm-svn: 63850
2009-02-05 08:00:50 +00:00
Chris Lattner d0a79b2eb8 make clang agree with gcc 4.2's x86-64 predefines and settings.
llvm-svn: 63849
2009-02-05 07:32:46 +00:00
Chris Lattner fafd8d1be9 correct and generalize computation of __INTMAX_MAX__.
llvm-svn: 63848
2009-02-05 07:27:41 +00:00
Chris Lattner 8181312251 fix some differences between apple gcc and clang on darwin/x86-32.
llvm-svn: 63846
2009-02-05 07:19:24 +00:00
Daniel Dunbar c79407fc40 Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.
llvm-svn: 63845
2009-02-05 07:09:07 +00:00
Zhongxing Xu 9103df1688 Make SymbolicRegion subclass TypedRegion, for symbols usually have types, so
do the symblic regions associated with them and we need them to be typed.

Current SymbolicRegion::getRValueType() method is very restricting. It may be
modified when we are more clear about what could be the types of symblic
regions.

BasicConstraintManager::Assume() is changed due to that now SymblicRegion is a
subclass of SubRegion.
 

llvm-svn: 63844
2009-02-05 06:57:29 +00:00
Ted Kremenek 400aae7fa4 Remove a bunch of obscene double-buffering of BugReports in the retain/release
checker. This was previously needed because BugReport objects were previously
allocated on the stack and not owned by BugReporter. Now we can just issue them
on the fly. This change was motivated because we were seeing some weird cases
where some really long paths would get issued for bugs (particularly leaks)
because of some double-caching.

llvm-svn: 63840
2009-02-05 06:50:21 +00:00
Dale Johannesen 621c3512a3 Reapply Daniel's patch to match up with llvm 63765.
Untested, Daniel or Nate please review.

llvm-svn: 63814
2009-02-05 01:50:47 +00:00
Daniel Dunbar 70245be397 x86-32: Use Ignore to avoid passing empty structs (instead of Expand).
llvm-svn: 63813
2009-02-05 01:50:07 +00:00
Daniel Dunbar 0103574d55 Honor ByVal alignment. Patch by Nate Begeman!
llvm-svn: 63811
2009-02-05 01:31:19 +00:00
Fariborz Jahanian 4e87c834d3 This patch generates messaging code for objc2's non-fragile abi.
llvm-svn: 63810
2009-02-05 01:13:09 +00:00
Daniel Dunbar 8045343ca2 Initialize alignment field for ByVal ABIInfo correctly.
llvm-svn: 63809
2009-02-05 01:01:30 +00:00
Ted Kremenek fb379b2660 Fix regression: Leak (BugType) object should have 'isLeak()' return true.
llvm-svn: 63803
2009-02-05 00:38:00 +00:00
Daniel Dunbar fff09f335d Unbreak CGFunctionInfo::Profile method and reenable caching of ABI
information.

llvm-svn: 63799
2009-02-05 00:00:23 +00:00
Ted Kremenek fc5d067ea0 Overhaul BugReporter interface and implementation. The new interface cleans up
the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes,
and BugTypes are owned by the BugReporter object.

The major functionality change in this patch is that reports are not immediately
emitted by a call to BugReporter::EmitWarning (now called EmitReport), but
instead of queued up in report "equivalence classes". When
BugReporter::FlushReports() is called, it emits one diagnostic per report
equivalence class. This provides a nice cleanup with the caching of reports as
well as enables the BugReporter engine to select the "best" path for reporting a
path-sensitive bug based on all the locations in the ExplodedGraph that the same
bug could occur.

Along with this patch, Leaks are now coalesced into a common equivalence class
by their allocation site, and the "summary" diagnostic for leaks now reports the
allocation site as the location of the bug (this may later be augmented to also
provide an example location where the leak occurs).

llvm-svn: 63796
2009-02-04 23:49:09 +00:00
Daniel Dunbar 400c040e01 Chase LLVM TOT in circles (i.e., revert r63773 to match revert of
r63765).

llvm-svn: 63795
2009-02-04 23:40:00 +00:00
Daniel Dunbar 56e7552c73 Add ABIArgInfo::dump()
llvm-svn: 63794
2009-02-04 23:24:38 +00:00
Douglas Gregor fc4f8a1834 Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a
bit... interesting... but we follow GNU's lead and don't permit too
much crazy code in this area.

Also, make the "excess initializers" error message a bit more
informative.

Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561

llvm-svn: 63785
2009-02-04 22:46:25 +00:00
Mike Stump 82f071faa7 Add support for blocks with explicit return types.
llvm-svn: 63784
2009-02-04 22:31:32 +00:00
Daniel Dunbar 46353ece18 Use correct signature for calling enumeration mutation function.
llvm-svn: 63782
2009-02-04 22:00:33 +00:00
Daniel Dunbar fb5fdf1f14 Temporarily disable caching of ABI results; this is going horribly
wrong in some cases.

llvm-svn: 63780
2009-02-04 21:36:22 +00:00
Sebastian Redl 18f8ff62a3 Implement taking address of member functions, including overloaded ones.
llvm-svn: 63779
2009-02-04 21:23:32 +00:00
Daniel Dunbar 1e8052b36d Add -femit-all-decls codegen option.
- Emits all declarations, even unused (static) ones.
 - Useful when doing minimization of codegen problems (otherwise
   problems localized to a static function aren't minimized well).

llvm-svn: 63776
2009-02-04 21:19:06 +00:00
Daniel Dunbar a45bdbbb6a Add asserts that the function signature matches the other arguments provide
to CGCall functions.

llvm-svn: 63775
2009-02-04 21:17:21 +00:00
Daniel Dunbar 91b73d441e (llvm up) Update for intrinsic lookup changes.
llvm-svn: 63773
2009-02-04 21:09:15 +00:00
Fariborz Jahanian e4dc35deb9 Some early code for objc2's nonfragile abi messaging.
llvm-svn: 63770
2009-02-04 20:42:28 +00:00
Fariborz Jahanian b73a23e47e Patch fixes messaging for GNU runtime.
Patch by David Chisnall

llvm-svn: 63769
2009-02-04 20:31:19 +00:00
Chris Lattner 022923a22a Fix PR3464 by searching for headers from the predefines
buffer as if the #include happened from the main file.

llvm-svn: 63764
2009-02-04 19:45:07 +00:00
Douglas Gregor ec6e1893d7 Improve documentation for Sema::getTypeName. Also, it's return type is
DeclTy*, not TypeTy*.

llvm-svn: 63756
2009-02-04 19:16:12 +00:00
Douglas Gregor ded2d7b021 Basic representation of C++ class templates, from Andrew Sutton.
llvm-svn: 63750
2009-02-04 19:02:06 +00:00
Douglas Gregor 2ada048975 Some name-lookup-related fixes, from Piotr Rak!
- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.

llvm-svn: 63739
2009-02-04 17:27:36 +00:00
Steve Naroff 189d41f625 Fix <rdar://problem/6552648> error: redefinition of 'XCElementAnchorDelegate' as different kind of symbol.
At first glance, this looked like a recent regression (possibly created by http://llvm.org/viewvc/llvm-project?view=rev&revision=63354, which was the only recent change to this section of Sema::ActOnStartClassInterface()). After more investigation, it looks like an edge case bug that we didn't cover in our tests.

llvm-svn: 63738
2009-02-04 17:14:05 +00:00
Douglas Gregor 8a6be5ec64 Diagnose ambiguities in getTypeName. Fixes http://llvm.org/bugs/show_bug.cgi?id=3475
llvm-svn: 63737
2009-02-04 17:00:24 +00:00
Douglas Gregor 94eabf3355 Bring operator name lookup (as required for C++ operator overloading)
into the general name-lookup fold. This cleans up some ugly,
not-quite-working code in the handling of operator overloading.

llvm-svn: 63735
2009-02-04 16:44:47 +00:00
Douglas Gregor b8a9a41dd6 Fix our semantic analysis of
unqualified-id '('

in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.

As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.

Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like

  operator+(x, y)

llvm-svn: 63733
2009-02-04 15:01:18 +00:00