IR generation for curried functions. For now, parameters

are stored in a malloc'ed buffer that gets leaked.



Swift SVN r1092
This commit is contained in:
John McCall
2012-01-19 23:29:49 +00:00
parent 883a16710b
commit b85ddcb34a
9 changed files with 391 additions and 28 deletions

View File

@@ -76,14 +76,10 @@ public:
llvm::IntegerType *Int64Ty;
llvm::IntegerType *SizeTy;
llvm::PointerType *Int8PtrTy;
llvm::Constant *getMemCpyFn();
llvm::StructType *Int8PtrPairTy;
void unimplemented(SourceLoc, StringRef Message);
private:
llvm::Function *MemCpyFn;
//--- Types -----------------------------------------------------------------
public:
const TypeInfo &getFragileTypeInfo(Type T);
@@ -98,10 +94,21 @@ private:
//--- Globals ---------------------------------------------------------------
private:
llvm::DenseMap<Decl*, llvm::Constant*> Globals;
llvm::DenseMap<Decl*, llvm::GlobalVariable*> GlobalVars;
llvm::DenseMap<LinkEntity, llvm::Function*> GlobalFuncs;
void mangleGlobalInitializer(raw_ostream &buffer, TranslationUnit *D);
//--- Runtime ---------------------------------------------------------------
public:
llvm::Constant *getMemCpyFn();
llvm::Constant *getAllocationFunction();
private:
llvm::Function *MemCpyFn;
llvm::Constant *AllocFn;
//--- Generic ---------------------------------------------------------------
public:
IRGenModule(ASTContext &Context, Options &Opts, llvm::Module &Module,
const llvm::TargetData &TargetData);