Commit Graph

317 Commits

Author SHA1 Message Date
John McCall
e66c13cfe7 Change the 'walk' APIs to use virtual function dispatch
instead .
1,2d
1i
Change the 'walk' APIs to use virtual dispatch instead of
blocks.  This makes it much easier to thread information
through the API, as well to extend the API to handle
recursive visiting of other structures (e.g., Decls
and Patterns).



Swift SVN r1101
2012-01-26 04:31:38 +00:00
Chris Lattner
4ef27b82e4 simplify some code to use a foreach loop.
Swift SVN r1089
2012-01-19 06:41:49 +00:00
Chris Lattner
599e4b2528 switch to using the new llvm::MutableArrayRef class, this requires llvm r148463
Swift SVN r1088
2012-01-19 06:39:07 +00:00
Chris Lattner
e3298d8b98 rearrange some code to simplify it.
Swift SVN r1077
2012-01-18 07:26:47 +00:00
Chris Lattner
23a7fb46c1 now that name binding doesn't have weird "only kill some subtrees" behavior, switch it over to a standard walk.
Swift SVN r1076
2012-01-18 07:25:28 +00:00
Chris Lattner
0587519685 remove some bogus code now that name binding doesn't kill subtrees. Spare the forest!
Swift SVN r1075
2012-01-18 07:22:22 +00:00
Chris Lattner
ed7062c452 instead of having name binding kill off entire subtrees that contain invalid variable uses, have it turn the ivalid use into an ErrorExpr.
Swift SVN r1074
2012-01-18 07:21:25 +00:00
Chris Lattner
584ed537fc introduce a new ErrorExpr to represent a subexpression that is semantically
inconsistent (so it needs to be killed) but that we want to retain source
range information and not kill the entire subtree that contains it.


Swift SVN r1073
2012-01-18 07:18:57 +00:00
Chris Lattner
fa2ea94348 always turn a named reference to a type into an IdentifierType.
This preserving source location info and reduces redundancy in the parser.


Swift SVN r1065
2012-01-18 01:57:44 +00:00
Chris Lattner
1c42e8f6a6 rename DottedNameType to IdentifierType. It captures loc information for random uses of type names, among other things.
Swift SVN r1064
2012-01-18 01:52:28 +00:00
Chris Lattner
2f7cd03c6b switch type lookup to use value lookup for everything. Dead code ahoy.
Swift SVN r1057
2012-01-17 07:36:16 +00:00
Chris Lattner
51e44891af rip out now-dead code from NameBinding. It still generally needs to be beaten
into sense later, but this gets it closer to reasonable.


Swift SVN r1051
2012-01-17 06:35:34 +00:00
Chris Lattner
c8ca11a199 Drop in the new DottedNameType and wire it up in name binding.
This is horribly hack and slash (but enough to pass all tests) for a few reasons:
- I've #if 0'd out the tendrils of the old code 
- This handles *just* what was handled before instead of being more general
- We don't have an llvm::MutableArrayRef type, so there is some really gross
  const_cast'ing and other struggles to deal with its absence.



Swift SVN r1050
2012-01-17 06:32:00 +00:00
Chris Lattner
fab4ef8820 introduce a new OverloadSetRefExpr::createWithCopy method to eliminate
some redundancy in the code that always has to create an overload set
or a single declrefexpr depending on what various lookups produce.


Swift SVN r1044
2012-01-14 07:22:25 +00:00
Chris Lattner
f1db6de509 remove the :: token and DCE UnresolvedScopedIdentifierExpr.
Swift SVN r1043
2012-01-14 07:00:45 +00:00
Chris Lattner
9d10d231ea implement support for normal lookup to find module names, and build a
ModuleExpr of the right  type to represent it.  Not tested yet, because
nothing can handle module exprs.


Swift SVN r1041
2012-01-14 06:41:33 +00:00
Chris Lattner
ed47f92c85 remove the ability for a::b to resolve a member 'b' in type 'a'. It now
just works for module references like Builtin::int32.


Swift SVN r1028
2012-01-12 21:54:32 +00:00
John McCall
59bed696a5 Introduce a ParenExpr to represent the special case of
a tuple with one element and no labels.  This form is
treated specially in essentially every case, so it might
as well be its own expression kind.



Swift SVN r1021
2012-01-12 19:55:06 +00:00
John McCall
0138e451a1 Look through extension decls here, too. It's not clear to me why
we can't just the normal walker for this top-level walking.



Swift SVN r985
2011-12-23 02:36:14 +00:00
John McCall
6b935588e5 On second thought, components need to be known in the AST.
Swift SVN r918
2011-12-07 03:57:41 +00:00
Chris Lattner
a1b7419a36 remove support for looking up global names with dot syntax. "x.y" != "y(x)" now.
Swift SVN r917
2011-12-07 00:59:09 +00:00
Chris Lattner
5da9f8ade2 add TinyPtrVector to LLVM.h
Swift SVN r905
2011-12-06 01:46:23 +00:00
Chris Lattner
32b248b7e3 [gs]etterize various members of Module, and make them check the invariants they depend on.
Swift SVN r903
2011-12-06 01:02:09 +00:00
Chris Lattner
212b56afec actually, the ASTStage should be on Translation unit. There can be multiple modules in a context and they can all be in different phases of translation.
Swift SVN r902
2011-12-06 00:51:56 +00:00
Chris Lattner
eaa6fcb12a move prototype for the verifier into Subsystems.
Swift SVN r901
2011-12-06 00:34:16 +00:00
Chris Lattner
02c9d9a3f1 Make the AST "phase" part of ASTContext, this is generally useful for assertions.
Swift SVN r900
2011-12-06 00:32:00 +00:00
John McCall
d716f82984 Getterize ValueDecl.
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
9079154ded Getterize TypeAliasDecl.
Swift SVN r884
2011-11-18 00:48:14 +00:00
John McCall
50fb0d63f6 More incremental getterization.
.w



Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
d74f17259c Incremental getterization of Decl.h.
Swift SVN r882
2011-11-18 00:17:20 +00:00
Doug Gregor
55f635a0c0 Introduce an additional "context" parameter to the expression and
statement walk callback functions, where we can stash additional
information without breaking all of the callers. 

At present, the only information in the context is the parent
statement or expression.


Swift SVN r860
2011-11-10 17:02:43 +00:00
Doug Gregor
cd7a21de83 Introduce support for adding source ranges to diagnostics.
We don't yet properly perform the SourceRange -> llvm::SMRange mapping. 

Swift SVN r847
2011-11-09 17:53:30 +00:00
Chris Lattner
9e9f421f1a getAliasType() doesn't need an ASTContext argument anymore.
Swift SVN r816
2011-11-01 18:37:05 +00:00
Chris Lattner
d2ed4c2f3f remove some unneeded ASTContext arguments from subsystem entrypoints
now that it is reachable from TU


Swift SVN r815
2011-11-01 18:33:48 +00:00
Chris Lattner
2dcaed352b tidy up
Swift SVN r812
2011-11-01 06:47:50 +00:00
Chris Lattner
164ab0ffee move lookupTypeName out to Module::lookupGlobalType and have it look in the current
module as well for consistency.


Swift SVN r811
2011-11-01 06:27:24 +00:00
Chris Lattner
e0a18996cd move lookupGlobalValue into Module, making it accessable to all of sema.
Swift SVN r810
2011-11-01 06:22:44 +00:00
Chris Lattner
5d8d0fd2f6 Have the name binder publish the list of imported modules into the TranslationUnit,
making it a real part of the AST.  Also, rework TUModuleCache to do its computation
when it is constructed, instead of trying in each query.


Swift SVN r809
2011-11-01 06:19:36 +00:00
Chris Lattner
1f42ec4679 rename method for consistency.
Swift SVN r808
2011-11-01 06:01:45 +00:00
Chris Lattner
623de6cefc now that ModuleProvider is gone, we can match against the module name
instead of the access path.  Tracking just the access path in the
imports list greatly simplifies all of the client and means that we
don't have to create a bogus ImportDecl for the builtin module just
to make name lookup work.


Swift SVN r807
2011-11-01 05:40:55 +00:00
Chris Lattner
17fd6242fc now that Module's have their own cache of name lookup info... including the current
module we're working on, eliminate the cloned version of the value lookup code
from NameBinder.


Swift SVN r806
2011-11-01 05:36:57 +00:00
Chris Lattner
69fb3842fc give name binder the translation unit it is binding.
Swift SVN r805
2011-11-01 05:34:18 +00:00
Chris Lattner
dd63b23985 strength reduce.
Swift SVN r804
2011-11-01 05:25:54 +00:00
Chris Lattner
e3b53c3b15 move the module-level name lookup stuff out of NameBinding.cpp into the
Module class.  Add a new Module.cpp file to implement this (along with
the existing caching strategy, if you're curious).  This eliminates the
parallel 'ModuleProvider' heirarchy.


Swift SVN r802
2011-11-01 05:19:35 +00:00
Chris Lattner
4933a27098 clean up lookupType/lookupValue to only take an AccessPath instead of an import decl.
Strip of the module name implicit in the access path.


Swift SVN r801
2011-11-01 04:43:51 +00:00
Chris Lattner
2ea1e72890 merge two copies of the same predicate into a helper method.
Swift SVN r800
2011-11-01 04:30:25 +00:00
Chris Lattner
0ca79b1075 rename ASTContext::BuiltinModule -> TheBuiltinModule for consistency with
the other ASTContext members.


Swift SVN r799
2011-11-01 04:18:23 +00:00
Chris Lattner
8e1c6c8ac6 flatten ModuleKind discriminator into DeclContext's one. Now Module is an
abstract class and we have an actual AST-level concept of the builtin module.


Swift SVN r798
2011-11-01 04:07:57 +00:00
Chris Lattner
db0fd341de inline addBuiltinImport.
Swift SVN r796
2011-11-01 03:47:06 +00:00
Chris Lattner
e6e58d1390 Have NameBinder ctor set up the implicit import for the builtin
module.  Heap allocate it for consistency.


Swift SVN r795
2011-11-01 03:46:01 +00:00