top | up | prev | next

Context Class

Definition at line 17 of Context.hpp

Constructors

Context()

Member Functions

void AddLineInfo(Instruction* inst)
void AddMDStructItem(MDStruct* mdStruct, const std::string& fieldName, MDItem* item)
void AddValue(Value* value)
Instruction* CreateAdd(Value* left, Value* right)
Instruction* CreateAnd(Value* left, Value* right)
Instruction* CreateArg(Value* arg)
Instruction* CreateBitCast(Value* arg, Type* destType)
Instruction* CreateBranch(Value* cond, BasicBlock* trueDest, BasicBlock* falseDest)
Instruction* CreateCall(Value* function)
Instruction* CreateDiv(Value* left, Value* right)
Instruction* CreateElemAddr(Value* ptr, Value* index)
Instruction* CreateEqual(Value* left, Value* right)
Instruction* CreateFloatToInt(Value* arg, Type* destType)
GlobalVariable* CreateGlobalStringPtr(const std::string& stringValue)
Instruction* CreateIntToFloat(Value* arg, Type* destType)
Instruction* CreateIntToPtr(Value* arg, Type* destType)
Instruction* CreateJump(BasicBlock* dest)
Instruction* CreateLess(Value* left, Value* right)
Instruction* CreateLoad(Value* ptr)
Instruction* CreateLocal(Type* type)
MDBasicBlockRef* CreateMDBasicBlockRef(void* bb)
MDBool* CreateMDBool(bool value)
MDLong* CreateMDLong(int64_t value)
MDString* CreateMDString(const std::string& value)
MDStruct* CreateMDStruct()
MDStructRef* CreateMDStructRef(int id)
Instruction* CreateMod(Value* left, Value* right)
Instruction* CreateMul(Value* left, Value* right)
Instruction* CreateNeg(Value* arg)
Instruction* CreateNop()
Instruction* CreateNot(Value* arg)
Instruction* CreateOr(Value* left, Value* right)
Instruction* CreateParam(Type* type)
Instruction* CreatePtrDiff(Value* leftPtr, Value* rightPtr)
Instruction* CreatePtrOffset(Value* ptr, Value* offset)
Instruction* CreatePtrToInt(Value* arg, Type* destType)
Instruction* CreateRet(Value* value)
Instruction* CreateSave()
Instruction* CreateShl(Value* left, Value* right)
Instruction* CreateShr(Value* left, Value* right)
Instruction* CreateSignExtend(Value* arg, Type* destType)
Instruction* CreateStore(Value* value, Value* ptr)
Type* CreateStructureType()
Instruction* CreateSub(Value* left, Value* right)
Instruction* CreateSwitch(Value* cond, BasicBlock* defaultDest)
Instruction* CreateTrap(const std::vector<Value*>& args)
Instruction* CreateTruncate(Value* arg, Type* destType)
Instruction* CreateXor(Value* left, Value* right)
Instruction* CreateZeroExtend(Value* arg, Type* destType)
Type* GetArrayType(Type* elementType, uint64_t size)
ArrayValue* GetArrayValue(Type* arrayType, const std::vector<ConstantValue*>& elements, const std::string& prefix)
Type* GetBoolType()
ConstantValue* GetBoolValue(bool value)
Type* GetByteType()
ConstantValue* GetByteValue(uint8_t value)
ClsIdValue* GetClsIdValue(const std::string& typeId)
ConversionValue* GetConversionValue(Type* type, ConstantValue* from)
BasicBlock* GetCurrentBasicBlock() const
DataRepository& GetDataRepository()
ConstantValue* GetDefaultBoolValue()
ConstantValue* GetDefaultByteValue()
ConstantValue* GetDefaultDoubleValue()
ConstantValue* GetDefaultFloatValue()
ConstantValue* GetDefaultIntValue()
ConstantValue* GetDefaultLongValue()
ConstantValue* GetDefaultSByteValue()
ConstantValue* GetDefaultShortValue()
ConstantValue* GetDefaultUIntValue()
ConstantValue* GetDefaultULongValue()
ConstantValue* GetDefaultUShortValue()
Type* GetDoubleType()
ConstantValue* GetDoubleValue(double value)
Type* GetFloatType()
ConstantValue* GetFloatValue(float value)
Type* GetFunctionType(Type* returnType, const std::vector<Type*>& paramTypes)
Type* GetIntType()
ConstantValue* GetIntValue(int32_t value)
Type* GetLongType()
ConstantValue* GetLongValue(int64_t value)
MDStructRef* GetMDStructRefForSourceFile(const std::string& sourceFileName)
Metadata& GetMetadata()
ConstantValue* GetNullValue(PtrType* ptrType)
GlobalVariable* GetOrInsertGlobal(const std::string& name, Type* type)
Type* GetPtrType(Type* baseType)
Type* GetSByteType()
ConstantValue* GetSByteValue(int8_t value)
Type* GetShortType()
ConstantValue* GetShortValue(int16_t value)
StringValue* GetStringValue(Type* stringType, const std::string& value)
Type* GetStructureType(const std::vector<Type*>& memberTypes)
StructureValue* GetStructureValue(Type* structureType, const std::vector<ConstantValue*>& members)
TypeRepository& GetTypeRepository()
Type* GetUIntType()
ConstantValue* GetUIntValue(uint32_t value)
Type* GetULongType()
ConstantValue* GetULongValue(uint64_t value)
Type* GetUShortType()
ConstantValue* GetUShortValue(uint16_t value)
Type* GetVoidType()
void SetCompileUnitId(const std::string& compileUnitId_)
void SetCurrentBasicBlock(BasicBlock* bb)
void SetCurrentLineNumber(int lineNumber)
void SetMetadataRef(Instruction* inst, MDStructRef* metadataRef)

Member Variables

BasicBlock* currentBasicBlock
Function* currentFunction
int currentLineNumber
DataRepository dataRepository
std::unordered_map<int, MDStructRef*> lineNumberInfoMap
Metadata metadata
std::unordered_map<std::string, MDStructRef*> sourceFileMap
TypeRepository typeRepository
std::vector<std::unique_ptr<Value>> values

Constructor Details

Context Constructor

cmsxi::Context::Context()

Definition at line 12 of Context.cpp :
 12 : currentFunction(nullptr)currentBasicBlock(nullptr)metadata()currentLineNumber(0)
 13 {
 14 }


Declaration at line 20 of Context.hpp


Member Function Details

AddLineInfo Member Function

void cmsxi::Context::AddLineInfo(Instruction * inst)

Definition at line 487 of Context.cpp
Declaration at line 121 of Context.hpp

Calls: cmsxi::Instruction::IsNoOperation , cmsxi::Instruction::SetMetadataRef , cmsxi::MDStruct::AddItem , cmsxi::MDStruct::Id , cmsxi::Metadata::CreateMDLong , cmsxi::Metadata::CreateMDStruct , cmsxi::Metadata::CreateMDStructRef

Called by: cmsxi::Context::CreateAdd , cmsxi::Context::CreateAnd , cmsxi::Context::CreateArg , cmsxi::Context::CreateBitCast , cmsxi::Context::CreateBranch , cmsxi::Context::CreateCall , cmsxi::Context::CreateDiv , cmsxi::Context::CreateElemAddr , cmsxi::Context::CreateEqual , cmsxi::Context::CreateFloatToInt , cmsxi::Context::CreateIntToFloat , cmsxi::Context::CreateIntToPtr , cmsxi::Context::CreateJump , cmsxi::Context::CreateLess , cmsxi::Context::CreateLoad , cmsxi::Context::CreateLocal , cmsxi::Context::CreateMod , cmsxi::Context::CreateMul , cmsxi::Context::CreateNeg , cmsxi::Context::CreateNot , cmsxi::Context::CreateOr , cmsxi::Context::CreateParam , cmsxi::Context::CreatePtrDiff , cmsxi::Context::CreatePtrOffset , cmsxi::Context::CreatePtrToInt , cmsxi::Context::CreateRet , cmsxi::Context::CreateShl , cmsxi::Context::CreateShr , cmsxi::Context::CreateSignExtend , cmsxi::Context::CreateStore , cmsxi::Context::CreateSub , cmsxi::Context::CreateSwitch , cmsxi::Context::CreateTrap , cmsxi::Context::CreateTruncate , cmsxi::Context::CreateXor , cmsxi::Context::CreateZeroExtend


AddMDStructItem Member Function

void cmsxi::Context::AddMDStructItem(MDStruct * mdStruct, const std::string& fieldName, MDItem * item)

Definition at line 474 of Context.cpp :
475 {
476     mdStruct->AddItem(fieldNameitem);
477 }


Declaration at line 119 of Context.hpp

Calls: cmsxi::MDStruct::AddItem


AddValue Member Function

void cmsxi::Context::AddValue(Value * value)

Definition at line 16 of Context.cpp :
 17 {
 18     values.push_back(std::unique_ptr<Value>(value));
 19 }


Declaration at line 69 of Context.hpp

Called by: cmsxi::Context::GetArrayValue , cmsxi::Context::GetBoolValue , cmsxi::Context::GetByteValue , cmsxi::Context::GetClsIdValue , cmsxi::Context::GetConversionValue , cmsxi::Context::GetDoubleValue , cmsxi::Context::GetFloatValue , cmsxi::Context::GetIntValue , cmsxi::Context::GetLongValue , cmsxi::Context::GetSByteValue , cmsxi::Context::GetShortValue , cmsxi::Context::GetStringValue , cmsxi::Context::GetStructureValue , cmsxi::Context::GetUIntValue , cmsxi::Context::GetULongValue , cmsxi::Context::GetUShortValue


CreateAdd Member Function

Instruction * cmsxi::Context::CreateAdd(Value * left, Value * right)

Definition at line 149 of Context.cpp :
150 {
151     Instruction* inst = new AddInstruction(leftright);
152     AddLineInfo(inst);
153     currentBasicBlock->AddInstruction(inst);
154     return inst;
155 }


Declaration at line 74 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateAnd Member Function

Instruction * cmsxi::Context::CreateAnd(Value * left, Value * right)

Definition at line 189 of Context.cpp :
190 {
191     Instruction* inst = new AndInstruction(leftright);
192     AddLineInfo(inst);
193     currentBasicBlock->AddInstruction(inst);
194     return inst;
195 }


Declaration at line 79 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateArg Member Function

Instruction * cmsxi::Context::CreateArg(Value * arg)

Definition at line 341 of Context.cpp :
342 {
343     Instruction* inst = new ArgInstruction(arg);
344     AddLineInfo(inst);
345     currentBasicBlock->AddInstruction(inst);
346     return inst;
347 }


Declaration at line 98 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo

Called by: cmsxi::Context::CreateTrap


CreateBitCast Member Function

Instruction * cmsxi::Context::CreateBitCast(Value * arg, Type * destType)

Definition at line 269 of Context.cpp :
270 {
271     Instruction* inst = new BitCastInstruction(argdestType);
272     AddLineInfo(inst);
273     currentBasicBlock->AddInstruction(inst);
274     return inst;
275 }


Declaration at line 89 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateBranch Member Function

Instruction * cmsxi::Context::CreateBranch(Value * cond, BasicBlock * trueDest, BasicBlock * falseDest)

Definition at line 397 of Context.cpp :
398 {
399     Instruction* inst = new BranchInstruction(condtrueDestfalseDest);
400     AddLineInfo(inst);
401     currentBasicBlock->AddInstruction(inst);
402     return inst;
403 }


Declaration at line 105 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateCall Member Function

Instruction * cmsxi::Context::CreateCall(Value * function)

Definition at line 373 of Context.cpp :
374 {
375     Instruction* inst = new CallInstruction(function);
376     AddLineInfo(inst);
377     currentBasicBlock->AddInstruction(inst);
378     return inst;
379 }


Declaration at line 102 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateDiv Member Function

Instruction * cmsxi::Context::CreateDiv(Value * left, Value * right)

Definition at line 173 of Context.cpp :
174 {
175     Instruction* inst = new DivInstruction(leftright);
176     AddLineInfo(inst);
177     currentBasicBlock->AddInstruction(inst);
178     return inst;
179 }


Declaration at line 77 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateElemAddr Member Function

Instruction * cmsxi::Context::CreateElemAddr(Value * ptr, Value * index)

Definition at line 349 of Context.cpp :
350 {
351     Instruction* inst = new ElemAddrInstruction(ptrindex);
352     AddLineInfo(inst);
353     currentBasicBlock->AddInstruction(inst);
354     return inst;
355 }


Declaration at line 99 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateEqual Member Function

Instruction * cmsxi::Context::CreateEqual(Value * left, Value * right)

Definition at line 229 of Context.cpp :
230 {
231     Instruction* inst = new EqualInstruction(leftright);
232     AddLineInfo(inst);
233     currentBasicBlock->AddInstruction(inst);
234     return inst;
235 }


Declaration at line 84 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateFloatToInt Member Function

Instruction * cmsxi::Context::CreateFloatToInt(Value * arg, Type * destType)

Definition at line 285 of Context.cpp :
286 {
287     Instruction* inst = new FloatToIntInstruction(argdestType);
288     AddLineInfo(inst);
289     currentBasicBlock->AddInstruction(inst);
290     return inst;
291 }


Declaration at line 91 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateGlobalStringPtr Member Function

GlobalVariable * cmsxi::Context::CreateGlobalStringPtr(const std::string& stringValue)

Definition at line 464 of Context.cpp :
465 {
466     return dataRepository.CreateGlobalStringPtr(*thisstringValue);
467 }


Declaration at line 111 of Context.hpp

Calls: cmsxi::DataRepository::CreateGlobalStringPtr


CreateIntToFloat Member Function

Instruction * cmsxi::Context::CreateIntToFloat(Value * arg, Type * destType)

Definition at line 277 of Context.cpp :
278 {
279     Instruction* inst = new IntToFloatInstruction(argdestType);
280     AddLineInfo(inst);
281     currentBasicBlock->AddInstruction(inst);
282     return inst;
283 }


Declaration at line 90 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateIntToPtr Member Function

Instruction * cmsxi::Context::CreateIntToPtr(Value * arg, Type * destType)

Definition at line 293 of Context.cpp :
294 {
295     Instruction* inst = new IntToPtrInstruction(argdestType);
296     AddLineInfo(inst);
297     currentBasicBlock->AddInstruction(inst);
298     return inst;
299 }


Declaration at line 92 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateJump Member Function

Instruction * cmsxi::Context::CreateJump(BasicBlock * dest)

Definition at line 389 of Context.cpp :
390 {
391     Instruction* inst = new JumpInstruction(dest);
392     AddLineInfo(inst);
393     currentBasicBlock->AddInstruction(inst);
394     return inst;
395 }


Declaration at line 104 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateLess Member Function

Instruction * cmsxi::Context::CreateLess(Value * left, Value * right)

Definition at line 237 of Context.cpp :
238 {
239     Instruction* inst = new LessInstruction(leftright);
240     AddLineInfo(inst);
241     currentBasicBlock->AddInstruction(inst);
242     return inst;
243 }


Declaration at line 85 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateLoad Member Function

Instruction * cmsxi::Context::CreateLoad(Value * ptr)

Definition at line 325 of Context.cpp :
326 {
327     Instruction* inst = new LoadInstruction(ptr);
328     AddLineInfo(inst);
329     currentBasicBlock->AddInstruction(inst);
330     return inst;
331 }


Declaration at line 96 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateLocal Member Function

Instruction * cmsxi::Context::CreateLocal(Type * type)

Definition at line 317 of Context.cpp :
318 {
319     Instruction* inst = new LocalInstruction(type);
320     AddLineInfo(inst);
321     currentBasicBlock->AddInstruction(inst);
322     return inst;
323 }


Declaration at line 95 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateMDBasicBlockRef Member Function

MDBasicBlockRef * cmsxi::Context::CreateMDBasicBlockRef(void * bb)

Definition at line 118 of Context.hpp :
118 { return metadata.CreateMDBasicBlockRef(bb); }

Calls: cmsxi::Metadata::CreateMDBasicBlockRef


CreateMDBool Member Function

MDBool * cmsxi::Context::CreateMDBool(bool value)

Definition at line 113 of Context.hpp :
113 { return metadata.CreateMDBool(value); }

Calls: cmsxi::Metadata::CreateMDBool


CreateMDLong Member Function

MDLong * cmsxi::Context::CreateMDLong(int64_t value)

Definition at line 114 of Context.hpp :
114 { return metadata.CreateMDLong(value); }

Calls: cmsxi::Metadata::CreateMDLong


CreateMDString Member Function

MDString * cmsxi::Context::CreateMDString(const std::string& value)

Definition at line 115 of Context.hpp :
115 { return metadata.CreateMDString(value); }

Calls: cmsxi::Metadata::CreateMDString


CreateMDStruct Member Function

MDStruct * cmsxi::Context::CreateMDStruct()

Definition at line 117 of Context.hpp :
117 { return metadata.CreateMDStruct();  }

Calls: cmsxi::Metadata::CreateMDStruct


CreateMDStructRef Member Function

MDStructRef * cmsxi::Context::CreateMDStructRef(int id)

Definition at line 116 of Context.hpp :
116 { return metadata.CreateMDStructRef(id); }

Calls: cmsxi::Metadata::CreateMDStructRef


CreateMod Member Function

Instruction * cmsxi::Context::CreateMod(Value * left, Value * right)

Definition at line 181 of Context.cpp :
182 {
183     Instruction* inst = new ModInstruction(leftright);
184     AddLineInfo(inst);
185     currentBasicBlock->AddInstruction(inst);
186     return inst;
187 }


Declaration at line 78 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateMul Member Function

Instruction * cmsxi::Context::CreateMul(Value * left, Value * right)

Definition at line 165 of Context.cpp :
166 {
167     Instruction* inst = new MulInstruction(leftright);
168     AddLineInfo(inst);
169     currentBasicBlock->AddInstruction(inst);
170     return inst;
171 }


Declaration at line 76 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateNeg Member Function

Instruction * cmsxi::Context::CreateNeg(Value * arg)

Definition at line 141 of Context.cpp :
142 {
143     Instruction* inst = new NegInstruction(arg);
144     AddLineInfo(inst);
145     currentBasicBlock->AddInstruction(inst);
146     return inst;
147 }


Declaration at line 73 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateNop Member Function

Instruction * cmsxi::Context::CreateNop()

Definition at line 445 of Context.cpp :
446 {
447     Instruction* inst = new NoOperationInstruction();
448     currentBasicBlock->AddInstruction(inst);
449     return inst;
450 }


Declaration at line 108 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction


CreateNot Member Function

Instruction * cmsxi::Context::CreateNot(Value * arg)

Definition at line 133 of Context.cpp :
134 {
135     Instruction* inst = new NotInstruction(arg);
136     AddLineInfo(inst);
137     currentBasicBlock->AddInstruction(inst);
138     return inst;
139 }


Declaration at line 72 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateOr Member Function

Instruction * cmsxi::Context::CreateOr(Value * left, Value * right)

Definition at line 197 of Context.cpp :
198 {
199     Instruction* inst = new OrInstruction(leftright);
200     AddLineInfo(inst);
201     currentBasicBlock->AddInstruction(inst);
202     return inst;
203 }


Declaration at line 80 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateParam Member Function

Instruction * cmsxi::Context::CreateParam(Type * type)

Definition at line 309 of Context.cpp :
310 {
311     Instruction* inst = new ParamInstruction(type);
312     AddLineInfo(inst);
313     currentBasicBlock->AddInstruction(inst);
314     return inst;
315 }


Declaration at line 94 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreatePtrDiff Member Function

Instruction * cmsxi::Context::CreatePtrDiff(Value * leftPtr, Value * rightPtr)

Definition at line 365 of Context.cpp :
366 {
367     Instruction* inst = new PtrDiffInstruction(leftPtrrightPtr);
368     AddLineInfo(inst);
369     currentBasicBlock->AddInstruction(inst);
370     return inst;
371 }


Declaration at line 101 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreatePtrOffset Member Function

Instruction * cmsxi::Context::CreatePtrOffset(Value * ptr, Value * offset)

Definition at line 357 of Context.cpp :
358 {
359     Instruction* inst = new PtrOffsetInstruction(ptroffset);
360     AddLineInfo(inst);
361     currentBasicBlock->AddInstruction(inst);
362     return inst;
363 }


Declaration at line 100 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreatePtrToInt Member Function

Instruction * cmsxi::Context::CreatePtrToInt(Value * arg, Type * destType)

Definition at line 301 of Context.cpp :
302 {
303     Instruction* inst = new PtrToIntInstruction(argdestType);
304     AddLineInfo(inst);
305     currentBasicBlock->AddInstruction(inst);
306     return inst;
307 }


Declaration at line 93 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateRet Member Function

Instruction * cmsxi::Context::CreateRet(Value * value)

Definition at line 381 of Context.cpp :
382 {
383     Instruction* inst = new RetInstruction(value);
384     AddLineInfo(inst);
385     currentBasicBlock->AddInstruction(inst);
386     return inst;
387 }


Declaration at line 103 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateSave Member Function

Instruction * cmsxi::Context::CreateSave()

Definition at line 452 of Context.cpp :
453 {
454     Instruction* inst = new SaveInstruction();
455     currentBasicBlock->AddInstruction(inst);
456     return inst;
457 }


Declaration at line 109 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction


CreateShl Member Function

Instruction * cmsxi::Context::CreateShl(Value * left, Value * right)

Definition at line 213 of Context.cpp :
214 {
215     Instruction* inst = new ShlInstruction(leftright);
216     AddLineInfo(inst);
217     currentBasicBlock->AddInstruction(inst);
218     return inst;
219 }


Declaration at line 82 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateShr Member Function

Instruction * cmsxi::Context::CreateShr(Value * left, Value * right)

Definition at line 221 of Context.cpp :
222 {
223     Instruction* inst = new ShrInstruction(leftright);
224     AddLineInfo(inst);
225     currentBasicBlock->AddInstruction(inst);
226     return inst;
227 }


Declaration at line 83 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateSignExtend Member Function

Instruction * cmsxi::Context::CreateSignExtend(Value * arg, Type * destType)

Definition at line 245 of Context.cpp :
246 {
247     Instruction* inst = new SignExtendInstruction(argdestType);
248     AddLineInfo(inst);
249     currentBasicBlock->AddInstruction(inst);
250     return inst;
251 }


Declaration at line 86 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateStore Member Function

Instruction * cmsxi::Context::CreateStore(Value * value, Value * ptr)

Definition at line 333 of Context.cpp :
334 {
335     Instruction* inst = new StoreInstruction(valueptr);
336     AddLineInfo(inst);
337     currentBasicBlock->AddInstruction(inst);
338     return inst;
339 }


Declaration at line 97 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateStructureType Member Function

Type * cmsxi::Context::CreateStructureType()

Definition at line 38 of Context.hpp :
 38 { return typeRepository.CreateStructureType(); }

Calls: cmsxi::TypeRepository::CreateStructureType


CreateSub Member Function

Instruction * cmsxi::Context::CreateSub(Value * left, Value * right)

Definition at line 157 of Context.cpp :
158 {
159     Instruction* inst = new SubInstruction(leftright);
160     AddLineInfo(inst);
161     currentBasicBlock->AddInstruction(inst);
162     return inst;
163 }


Declaration at line 75 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateSwitch Member Function

Instruction * cmsxi::Context::CreateSwitch(Value * cond, BasicBlock * defaultDest)

Definition at line 405 of Context.cpp :
406 {
407     Instruction* inst = new SwitchInstruction(conddefaultDest);
408     AddLineInfo(inst);
409     currentBasicBlock->AddInstruction(inst);
410     return inst;
411 }


Declaration at line 106 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateTrap Member Function

Instruction * cmsxi::Context::CreateTrap(const std::vector<Value *>& args)

Definition at line 413 of Context.cpp
Declaration at line 107 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo , cmsxi::Context::CreateArg


CreateTruncate Member Function

Instruction * cmsxi::Context::CreateTruncate(Value * arg, Type * destType)

Definition at line 261 of Context.cpp :
262 {
263     Instruction* inst = new TruncateInstruction(argdestType);
264     AddLineInfo(inst);
265     currentBasicBlock->AddInstruction(inst);
266     return inst;
267 }


Declaration at line 88 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateXor Member Function

Instruction * cmsxi::Context::CreateXor(Value * left, Value * right)

Definition at line 205 of Context.cpp :
206 {
207     Instruction* inst = new XorInstruction(leftright);
208     AddLineInfo(inst);
209     currentBasicBlock->AddInstruction(inst);
210     return inst;
211 }


Declaration at line 81 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


CreateZeroExtend Member Function

Instruction * cmsxi::Context::CreateZeroExtend(Value * arg, Type * destType)

Definition at line 253 of Context.cpp :
254 {
255     Instruction* inst = new ZeroExtendInstruction(argdestType);
256     AddLineInfo(inst);
257     currentBasicBlock->AddInstruction(inst);
258     return inst;
259 }


Declaration at line 87 of Context.hpp

Calls: cmsxi::BasicBlock::AddInstruction , cmsxi::Context::AddLineInfo


GetArrayType Member Function

Type * cmsxi::Context::GetArrayType(Type * elementType, uint64_t size)

Definition at line 39 of Context.hpp :
 39 { return typeRepository.GetArrayType(elementTypesize); }

Calls: cmsxi::TypeRepository::GetArrayType


GetArrayValue Member Function

ArrayValue * cmsxi::Context::GetArrayValue(Type * arrayType, const std::vector<ConstantValue *>& elements, const std::string& prefix)

Definition at line 98 of Context.cpp :
 99 {
100     ArrayValue* arrayValue = new ArrayValue(arrayTypeelementsprefix);
101     AddValue(arrayValue);
102     return arrayValue;
103 }


Declaration at line 64 of Context.hpp

Calls: cmsxi::Context::AddValue


GetBoolType Member Function

Type * cmsxi::Context::GetBoolType()

Definition at line 25 of Context.hpp :
 25 { return typeRepository.GetBoolType(); }

Calls: cmsxi::TypeRepository::GetBoolType

Called by: cmsxi::BoolValue::GetType , cmsxi::Context::GetDefaultBoolValue , cmsxi::EqualInstruction::GetType , cmsxi::LessInstruction::GetType


GetBoolValue Member Function

ConstantValue * cmsxi::Context::GetBoolValue(bool value)

Definition at line 21 of Context.cpp :
 22 {
 23     ConstantValue* boolValue = new BoolValue(value);
 24     AddValue(boolValue);
 25     return boolValue;
 26 }


Declaration at line 53 of Context.hpp

Calls: cmsxi::Context::AddValue


GetByteType Member Function

Type * cmsxi::Context::GetByteType()

Definition at line 27 of Context.hpp :
 27 { return typeRepository.GetByteType(); }

Calls: cmsxi::TypeRepository::GetByteType

Called by: cmsxi::ByteValue::GetType , cmsxi::Context::GetDefaultByteValue , cmsxi::DataRepository::CreateGlobalStringPtr


GetByteValue Member Function

ConstantValue * cmsxi::Context::GetByteValue(uint8_t value)

Definition at line 35 of Context.cpp :
 36 {
 37     ConstantValue* byteValue = new ByteValue(value);
 38     AddValue(byteValue);
 39     return byteValue;
 40 }


Declaration at line 55 of Context.hpp

Calls: cmsxi::Context::AddValue


GetClsIdValue Member Function

ClsIdValue * cmsxi::Context::GetClsIdValue(const std::string& typeId)

Definition at line 126 of Context.cpp :
127 {
128     ClsIdValue* clsIdValue = new ClsIdValue(typeId);
129     AddValue(clsIdValue);
130     return clsIdValue;
131 }


Declaration at line 68 of Context.hpp

Calls: cmsxi::Context::AddValue


GetConversionValue Member Function

ConversionValue * cmsxi::Context::GetConversionValue(Type * type, ConstantValue * from)

Definition at line 119 of Context.cpp :
120 {
121     ConversionValue* conversionValue = new ConversionValue(typefrom);
122     AddValue(conversionValue);
123     return conversionValue;
124 }


Declaration at line 67 of Context.hpp

Calls: cmsxi::Context::AddValue


GetCurrentBasicBlock Member Function

BasicBlock * cmsxi::Context::GetCurrentBasicBlock() const

Definition at line 71 of Context.hpp :
 71 { return currentBasicBlock; }


GetDataRepository Member Function

DataRepository & cmsxi::Context::GetDataRepository()

Definition at line 22 of Context.hpp :
 22 { return dataRepository; }

Called by: cmsxi::CompileUnit::Write


GetDefaultBoolValue Member Function

ConstantValue * cmsxi::Context::GetDefaultBoolValue()

Definition at line 41 of Context.hpp :
 41 { return GetBoolType()->DefaultValue(); }

Calls: cmsxi::Context::GetBoolType , cmsxi::Type::DefaultValue


GetDefaultByteValue Member Function

ConstantValue * cmsxi::Context::GetDefaultByteValue()

Definition at line 43 of Context.hpp :
 43 { return GetByteType()->DefaultValue(); }

Calls: cmsxi::Context::GetByteType , cmsxi::Type::DefaultValue


GetDefaultDoubleValue Member Function

ConstantValue * cmsxi::Context::GetDefaultDoubleValue()

Definition at line 51 of Context.hpp :
 51 { return GetDoubleType()->DefaultValue(); }

Calls: cmsxi::Context::GetDoubleType , cmsxi::Type::DefaultValue


GetDefaultFloatValue Member Function

ConstantValue * cmsxi::Context::GetDefaultFloatValue()

Definition at line 50 of Context.hpp :
 50 { return GetFloatType()->DefaultValue(); }

Calls: cmsxi::Context::GetFloatType , cmsxi::Type::DefaultValue


GetDefaultIntValue Member Function

ConstantValue * cmsxi::Context::GetDefaultIntValue()

Definition at line 46 of Context.hpp :
 46 { return GetIntType()->DefaultValue(); }

Calls: cmsxi::Context::GetIntType , cmsxi::Type::DefaultValue


GetDefaultLongValue Member Function

ConstantValue * cmsxi::Context::GetDefaultLongValue()

Definition at line 48 of Context.hpp :
 48 { return GetLongType()->DefaultValue(); }

Calls: cmsxi::Context::GetLongType , cmsxi::Type::DefaultValue


GetDefaultSByteValue Member Function

ConstantValue * cmsxi::Context::GetDefaultSByteValue()

Definition at line 42 of Context.hpp :
 42 { return GetSByteType()->DefaultValue(); }

Calls: cmsxi::Context::GetSByteType , cmsxi::Type::DefaultValue


GetDefaultShortValue Member Function

ConstantValue * cmsxi::Context::GetDefaultShortValue()

Definition at line 44 of Context.hpp :
 44 { return GetShortType()->DefaultValue(); }

Calls: cmsxi::Context::GetShortType , cmsxi::Type::DefaultValue


GetDefaultUIntValue Member Function

ConstantValue * cmsxi::Context::GetDefaultUIntValue()

Definition at line 47 of Context.hpp :
 47 { return GetUIntType()->DefaultValue(); }

Calls: cmsxi::Context::GetUIntType , cmsxi::Type::DefaultValue


GetDefaultULongValue Member Function

ConstantValue * cmsxi::Context::GetDefaultULongValue()

Definition at line 49 of Context.hpp :
 49 { return GetULongType()->DefaultValue(); }

Calls: cmsxi::Context::GetULongType , cmsxi::Type::DefaultValue


GetDefaultUShortValue Member Function

ConstantValue * cmsxi::Context::GetDefaultUShortValue()

Definition at line 45 of Context.hpp :
 45 { return GetUShortType()->DefaultValue(); }

Calls: cmsxi::Context::GetUShortType , cmsxi::Type::DefaultValue


GetDoubleType Member Function

Type * cmsxi::Context::GetDoubleType()

Definition at line 35 of Context.hpp :
 35 { return typeRepository.GetDoubleType(); }

Calls: cmsxi::TypeRepository::GetDoubleType

Called by: cmsxi::Context::GetDefaultDoubleValue , cmsxi::DoubleValue::GetType


GetDoubleValue Member Function

ConstantValue * cmsxi::Context::GetDoubleValue(double value)

Definition at line 91 of Context.cpp :
 92 {
 93     ConstantValue* doubleValue = new DoubleValue(value);
 94     AddValue(doubleValue);
 95     return doubleValue;
 96 }


Declaration at line 63 of Context.hpp

Calls: cmsxi::Context::AddValue


GetFloatType Member Function

Type * cmsxi::Context::GetFloatType()

Definition at line 34 of Context.hpp :
 34 { return typeRepository.GetFloatType(); }

Calls: cmsxi::TypeRepository::GetFloatType

Called by: cmsxi::Context::GetDefaultFloatValue , cmsxi::FloatValue::GetType


GetFloatValue Member Function

ConstantValue * cmsxi::Context::GetFloatValue(float value)

Definition at line 84 of Context.cpp :
 85 {
 86     ConstantValue* floatValue = new FloatValue(value);
 87     AddValue(floatValue);
 88     return floatValue;
 89 }


Declaration at line 62 of Context.hpp

Calls: cmsxi::Context::AddValue


GetFunctionType Member Function

Type * cmsxi::Context::GetFunctionType(Type * returnType, const std::vector<Type *>& paramTypes)

Definition at line 40 of Context.hpp :
 40 { return typeRepository.GetFunctionType(returnTypeparamTypes); }

Calls: cmsxi::TypeRepository::GetFunctionType


GetIntType Member Function

Type * cmsxi::Context::GetIntType()

Definition at line 30 of Context.hpp :
 30 { return typeRepository.GetIntType(); }

Calls: cmsxi::TypeRepository::GetIntType

Called by: cmsxi::Context::GetDefaultIntValue , cmsxi::IntValue::GetType


GetIntValue Member Function

ConstantValue * cmsxi::Context::GetIntValue(int32_t value)

Definition at line 56 of Context.cpp :
 57 {
 58     ConstantValue* intValue = new IntValue(value);
 59     AddValue(intValue);
 60     return intValue;
 61 }


Declaration at line 58 of Context.hpp

Calls: cmsxi::Context::AddValue


GetLongType Member Function

Type * cmsxi::Context::GetLongType()

Definition at line 32 of Context.hpp :
 32 { return typeRepository.GetLongType(); }

Calls: cmsxi::TypeRepository::GetLongType

Called by: cmsxi::Context::GetDefaultLongValue , cmsxi::LongValue::GetType , cmsxi::PtrDiffInstruction::GetType , cmsxi::TrapInstruction::GetType


GetLongValue Member Function

ConstantValue * cmsxi::Context::GetLongValue(int64_t value)

Definition at line 70 of Context.cpp :
 71 {
 72     ConstantValue* longValue = new LongValue(value);
 73     AddValue(longValue);
 74     return longValue;
 75 }


Declaration at line 60 of Context.hpp

Calls: cmsxi::Context::AddValue


GetMDStructRefForSourceFile Member Function

MDStructRef * cmsxi::Context::GetMDStructRefForSourceFile(const std::string& sourceFileName)

Definition at line 509 of Context.cpp
Declaration at line 122 of Context.hpp

Calls: cmsxi::MDStruct::AddItem , cmsxi::MDStruct::Id , cmsxi::Metadata::CreateMDLong , cmsxi::Metadata::CreateMDString , cmsxi::Metadata::CreateMDStruct , cmsxi::Metadata::CreateMDStructRef

Called by: cmsxi::CompileUnit::SetSourceFilePath


GetMetadata Member Function

Metadata & cmsxi::Context::GetMetadata()

Definition at line 23 of Context.hpp :
 23 { return metadata; }

Called by: cmsxi::CompileUnit::Write


GetNullValue Member Function

ConstantValue * cmsxi::Context::GetNullValue(PtrType * ptrType)

Definition at line 52 of Context.hpp :
 52 { return ptrType->DefaultValue(); }

Calls: cmsxi::PtrType::DefaultValue


GetOrInsertGlobal Member Function

GlobalVariable * cmsxi::Context::GetOrInsertGlobal(const std::string& name, Type * type)

Definition at line 459 of Context.cpp :
460 {
461     return dataRepository.GetOrInsertGlobal(nametype);
462 }


Declaration at line 110 of Context.hpp

Calls: cmsxi::DataRepository::GetOrInsertGlobal


GetPtrType Member Function

Type * cmsxi::Context::GetPtrType(Type * baseType)

Definition at line 36 of Context.hpp :
 36 { return typeRepository.GetPtrType(baseType); }

Calls: cmsxi::TypeRepository::GetPtrType

Called by: cmsxi::ClsIdValue::GetType , cmsxi::ElemAddrInstruction::GetType , cmsxi::GlobalVariable::GetType , cmsxi::LocalInstruction::GetType


GetSByteType Member Function

Type * cmsxi::Context::GetSByteType()

Definition at line 26 of Context.hpp :
 26 { return typeRepository.GetSByteType(); }

Calls: cmsxi::TypeRepository::GetSByteType

Called by: cmsxi::Context::GetDefaultSByteValue , cmsxi::SByteValue::GetType


GetSByteValue Member Function

ConstantValue * cmsxi::Context::GetSByteValue(int8_t value)

Definition at line 28 of Context.cpp :
 29 {
 30     ConstantValue* sbyteValue = new SByteValue(value);
 31     AddValue(sbyteValue);
 32     return sbyteValue;
 33 }


Declaration at line 54 of Context.hpp

Calls: cmsxi::Context::AddValue


GetShortType Member Function

Type * cmsxi::Context::GetShortType()

Definition at line 28 of Context.hpp :
 28 { return typeRepository.GetShortType(); }

Calls: cmsxi::TypeRepository::GetShortType

Called by: cmsxi::Context::GetDefaultShortValue , cmsxi::ShortValue::GetType


GetShortValue Member Function

ConstantValue * cmsxi::Context::GetShortValue(int16_t value)

Definition at line 42 of Context.cpp :
 43 {
 44     ConstantValue* shortValue = new ShortValue(value);
 45     AddValue(shortValue);
 46     return shortValue;
 47 }


Declaration at line 56 of Context.hpp

Calls: cmsxi::Context::AddValue


GetStringValue Member Function

StringValue * cmsxi::Context::GetStringValue(Type * stringType, const std::string& value)

Definition at line 112 of Context.cpp :
113 {
114     StringValue* stringValue = new StringValue(stringTypevalue);
115     AddValue(stringValue);
116     return stringValue;
117 }


Declaration at line 66 of Context.hpp

Calls: cmsxi::Context::AddValue

Called by: cmsxi::DataRepository::CreateGlobalStringPtr


GetStructureType Member Function

Type * cmsxi::Context::GetStructureType(const std::vector<Type *>& memberTypes)

Definition at line 37 of Context.hpp :
 37 { return typeRepository.GetStructureType(memberTypes); }

Calls: cmsxi::TypeRepository::GetStructureType


GetStructureValue Member Function

StructureValue * cmsxi::Context::GetStructureValue(Type * structureType, const std::vector<ConstantValue *>& members)

Definition at line 105 of Context.cpp :
106 {
107     StructureValue* structureValue = new StructureValue(structureTypemembers);
108     AddValue(structureValue);
109     return structureValue;
110 }


Declaration at line 65 of Context.hpp

Calls: cmsxi::Context::AddValue


GetTypeRepository Member Function

TypeRepository & cmsxi::Context::GetTypeRepository()

Definition at line 21 of Context.hpp :
 21 { return typeRepository; }

Called by: cmsxi::CompileUnit::Write


GetUIntType Member Function

Type * cmsxi::Context::GetUIntType()

Definition at line 31 of Context.hpp :
 31 { return typeRepository.GetUIntType(); }

Calls: cmsxi::TypeRepository::GetUIntType

Called by: cmsxi::Context::GetDefaultUIntValue , cmsxi::UIntValue::GetType


GetUIntValue Member Function

ConstantValue * cmsxi::Context::GetUIntValue(uint32_t value)

Definition at line 63 of Context.cpp :
 64 {
 65     ConstantValue* uintValue = new UIntValue(value);
 66     AddValue(uintValue);
 67     return uintValue;
 68 }


Declaration at line 59 of Context.hpp

Calls: cmsxi::Context::AddValue


GetULongType Member Function

Type * cmsxi::Context::GetULongType()

Definition at line 33 of Context.hpp :
 33 { return typeRepository.GetULongType(); }

Calls: cmsxi::TypeRepository::GetULongType

Called by: cmsxi::Context::GetDefaultULongValue , cmsxi::ULongValue::GetType


GetULongValue Member Function

ConstantValue * cmsxi::Context::GetULongValue(uint64_t value)

Definition at line 77 of Context.cpp :
 78 {
 79     ConstantValue* ulongValue = new ULongValue(value);
 80     AddValue(ulongValue);
 81     return ulongValue;
 82 }


Declaration at line 61 of Context.hpp

Calls: cmsxi::Context::AddValue


GetUShortType Member Function

Type * cmsxi::Context::GetUShortType()

Definition at line 29 of Context.hpp :
 29 { return typeRepository.GetUShortType(); }

Calls: cmsxi::TypeRepository::GetUShortType

Called by: cmsxi::Context::GetDefaultUShortValue , cmsxi::UShortValue::GetType


GetUShortValue Member Function

ConstantValue * cmsxi::Context::GetUShortValue(uint16_t value)

Definition at line 49 of Context.cpp :
 50 {
 51     ConstantValue* ushortValue = new UShortValue(value);
 52     AddValue(ushortValue);
 53     return ushortValue;
 54 }


Declaration at line 57 of Context.hpp

Calls: cmsxi::Context::AddValue


GetVoidType Member Function

Type * cmsxi::Context::GetVoidType()

Definition at line 24 of Context.hpp :
 24 { return typeRepository.GetVoidType(); }

Calls: cmsxi::TypeRepository::GetVoidType

Called by: cmsxi::ClsIdValue::GetType , cmsxi::Instruction::GetType


SetCompileUnitId Member Function

void cmsxi::Context::SetCompileUnitId(const std::string& compileUnitId_)

Definition at line 469 of Context.cpp :
470 {
471     dataRepository.SetCompileUnitId(compileUnitId_);
472 }


Declaration at line 112 of Context.hpp

Calls: cmsxi::DataRepository::SetCompileUnitId


SetCurrentBasicBlock Member Function

void cmsxi::Context::SetCurrentBasicBlock(BasicBlock * bb)

Definition at line 70 of Context.hpp :
 70 { currentBasicBlock = bb; }


SetCurrentLineNumber Member Function

void cmsxi::Context::SetCurrentLineNumber(int lineNumber)

Definition at line 479 of Context.cpp :
480 {
481     if (lineNumber != -1)
482     {
483         currentLineNumber = lineNumber;
484     }
485 }


Declaration at line 120 of Context.hpp


SetMetadataRef Member Function

void cmsxi::Context::SetMetadataRef(Instruction * inst, MDStructRef * metadataRef)

Definition at line 527 of Context.cpp :
528 {
529     inst->SetMetadataRef(metadataRef);
530 }


Declaration at line 123 of Context.hpp

Calls: cmsxi::Instruction::SetMetadataRef


top | up | prev | next