Explicit representation of ASTs for all the functions in a compile unit.

Added AST and Function classes.
Now, we parse the whole file and build up the AST for all of the
  functions in the Module before we emit IR for the functions (vs. before,
  when we generated IR along the way as we parsed the source file.)
This commit is contained in:
Matt Pharr
2011-10-06 15:18:42 -07:00
parent ec5e627e56
commit f9c67ff806
15 changed files with 935 additions and 613 deletions

11
ctx.h
View File

@@ -59,14 +59,15 @@ struct CFInfo;
class FunctionEmitContext {
public:
/** Create a new FunctionEmitContext.
@param returnType The return type of the function
@param function LLVM function in the current module that corresponds
@param function The Function object representing the function
@param sym Symbol that corresponds to the function
@param llvmFunction LLVM function in the current module that corresponds
to the function
@param funSym Symbol that corresponds to the function
@param firstStmtPos Source file position of the first statement in the
function
*/
FunctionEmitContext(const Type *returnType, llvm::Function *function, Symbol *funSym,
FunctionEmitContext(Function *function, Symbol *funSym,
llvm::Function *llvmFunction,
SourcePos firstStmtPos);
~FunctionEmitContext();
@@ -86,6 +87,8 @@ public:
/** Returns the current mask value */
llvm::Value *GetMask();
void SetMaskPointer(llvm::Value *p);
/** Provides the value of the mask at function entry */
void SetEntryMask(llvm::Value *val);