Permalink
Browse files

Added missing new files.

  • Loading branch information...
1 parent be3bfbf commit 06a29342d3d3f1d5e15c5f1e1a2ffd05cae0d324 @lindquist lindquist committed Mar 27, 2009
Showing with 55 additions and 0 deletions.
  1. +34 −0 ir/ir.cpp
  2. +1 −0 ir/irsymbol.cpp
  3. +20 −0 ir/irsymbol.h
View
@@ -0,0 +1,34 @@
+#include "llvm/Target/TargetData.h"
+
+#include "gen/irstate.h"
+#include "gen/tollvm.h"
+#include "gen/functions.h"
+
+#include "ir/ir.h"
+#include "ir/irfunction.h"
+
+
+unsigned GetTypeAlignment(Ir* ir, Type* t)
+{
+ return gTargetData->getABITypeAlignment(DtoType(t));
+}
+
+Ir::Ir()
+: irs(NULL)
+{
+}
+
+void Ir::addFunctionBody(IrFunction * f)
+{
+ functionbodies.push_back(f);
+}
+
+void Ir::emitFunctionBodies()
+{
+ while (!functionbodies.empty())
+ {
+ IrFunction* irf = functionbodies.front();
+ functionbodies.pop_front();
+ DtoDefineFunction(irf->decl);
+ }
+}
View
@@ -0,0 +1 @@
+#include "ir/irsymbol.h"
View
@@ -0,0 +1,20 @@
+#ifndef __LDC_IR_IRSYMBOL_H__
+#define __LDC_IR_IRSYMBOL_H__
+
+#include "ir/ir.h"
+
+/// Base class for all symbols.
+struct IrSymbol
+{
+ ///
+ IrSymbol(Ir* ir) : ir(ir) {}
+
+ /// Migrate symbols to current module if necessary.
+ virtual void migrate() = 0;
+
+protected:
+ ///
+ Ir* ir;
+};
+
+#endif

0 comments on commit 06a2934

Please sign in to comment.