Symbol table now properly handles scopes for function declarations.

Previously, they all went into one big pile that was never cleaned up;
this was the wrong thing to do in a world where one might have a 
function declaration inside another functions, say.
This commit is contained in:
Matt Pharr
2011-12-04 17:37:13 -08:00
parent 32904dfa11
commit f95504fb5e
7 changed files with 166 additions and 129 deletions

4
expr.h
View File

@@ -613,7 +613,7 @@ private:
*/
class FunctionSymbolExpr : public Expr {
public:
FunctionSymbolExpr(const char *name, std::vector<Symbol *> *candidateFunctions,
FunctionSymbolExpr(const char *name, const std::vector<Symbol *> &candFuncs,
SourcePos pos);
llvm::Value *GetValue(FunctionEmitContext *ctx) const;
@@ -649,7 +649,7 @@ private:
/** All of the functions with the name given in the function call;
there may be more then one, in which case we need to resolve which
overload is the best match. */
std::vector<Symbol *> *candidateFunctions;
std::vector<Symbol *> candidateFunctions;
/** The actual matching function found after overload resolution. */
Symbol *matchingFunc;