| 34 | using namespace llvm; |
| 35 | |
| 36 | BfContext::BfContext(BfCompiler* compiler) : |
| 37 | mTypeDefTypeRefPool(true, true) |
| 38 | { |
| 39 | mCompiler = compiler; |
| 40 | mSystem = compiler->mSystem; |
| 41 | mBfTypeType = NULL; |
| 42 | mBfClassVDataPtrType = NULL; |
| 43 | mBfObjectType = NULL; |
| 44 | mCanSkipObjectCtor = true; |
| 45 | mCanSkipValueTypeCtor = true; |
| 46 | mMappedObjectRevision = 0; |
| 47 | mDeleting = false; |
| 48 | mLockModules = false; |
| 49 | mAllowLockYield = true; |
| 50 | |
| 51 | mCurTypeState = NULL; |
| 52 | mCurNamespaceNodes = NULL; |
| 53 | mCurConstraintState = NULL; |
| 54 | mResolvingVarField = false; |
| 55 | mAssertOnPopulateType = false; |
| 56 | |
| 57 | for (int i = 0; i < BfTypeCode_Length; i++) |
| 58 | { |
| 59 | mPrimitiveTypes[i] = NULL; |
| 60 | mPrimitiveStructTypes[i] = NULL; |
| 61 | } |
| 62 | |
| 63 | mScratchModule = new BfModule(this, ""); |
| 64 | mScratchModule->mIsSpecialModule = true; |
| 65 | mScratchModule->mIsScratchModule = true; |
| 66 | mScratchModule->mIsReified = true; |
| 67 | mScratchModule->mGeneratesCode = false; |
| 68 | mScratchModule->Init(); |
| 69 | |
| 70 | mUnreifiedModule = new BfModule(this, ""); |
| 71 | mUnreifiedModule->mIsSpecialModule = true; |
| 72 | mUnreifiedModule->mIsScratchModule = true; |
| 73 | mUnreifiedModule->mIsReified = false; |
| 74 | mUnreifiedModule->mGeneratesCode = false; |
| 75 | mUnreifiedModule->Init(); |
| 76 | |
| 77 | mValueTypeDeinitSentinel = (BfMethodInstance*)1; |
| 78 | |
| 79 | mCurStringObjectPoolId = 0; |
| 80 | mHasReifiedQueuedRebuildTypes = false; |
| 81 | } |
| 82 | |
| 83 | void BfReportMemory(); |
| 84 | |