This commit is contained in:
Robert Clipsham
2009-06-02 17:12:37 +01:00
5 changed files with 14 additions and 3 deletions

View File

@@ -1100,8 +1100,10 @@ namespace AsmParserx8632
{ "subps", Op_DstSrcSSE },
{ "subsd", Op_DstSrcSSE },
{ "subss", Op_DstSrcSSE },
{ "syscall", Op_0 },
{ "sysenter",Op_0 },
{ "sysexit", Op_0 },
{ "sysret", Op_0 },
{ "test", Op_SrcSrcF },
{ "ucomisd", Op_SrcSrcSSEF },
{ "ucomiss", Op_SrcSrcSSEF },

View File

@@ -730,7 +730,6 @@ namespace AsmParserx8664
{ "invlpga", Op_SrcMemNT },
{ "rdtscp", Op_0_DXAX },
{ "stgi", Op_Flags },
{ "sysret", Op_0 },
*/
{ "cmpxch16b", Op_cmpxchg8b },
@@ -1221,6 +1220,7 @@ namespace AsmParserx8664
{ "subsd", Op_DstSrcSSE },
{ "subss", Op_DstSrcSSE },
{ "swapgs", Op_DstSrcSSE },
{ "syscall", Op_0 },
{ "sysenter",Op_0 },
{ "sysexit", Op_0 },
{ "sysret", Op_0 },

View File

@@ -403,6 +403,14 @@ LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var, llvm::
//////////////////////////////////////////////////////////////////////////////////////////
LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1)
{
LLValue* v[2] = { DtoConstUint(i0), DtoConstUint(i1) };
return llvm::ConstantExpr::getGetElementPtr(ptr, v, 2);
}
//////////////////////////////////////////////////////////////////////////////////////////
void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
{
dst = DtoBitCast(dst,getVoidPtrType());

View File

@@ -48,6 +48,7 @@ LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* var=NULL, ll
LLValue* DtoGEPi1(LLValue* ptr, unsigned i0, const char* var=NULL, llvm::BasicBlock* bb=NULL);
LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var=NULL, llvm::BasicBlock* bb=NULL);
LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1);
// to constant helpers
LLConstantInt* DtoConstSize_t(uint64_t);

View File

@@ -719,11 +719,11 @@ void Module::genmoduleinfo()
m_name.append("9__classesZ");
assert(gIR->module->getGlobalVariable(m_name) == NULL);
llvm::GlobalVariable* m_gvar = new llvm::GlobalVariable(classArrTy, true, llvm::GlobalValue::InternalLinkage, c, m_name, gIR->module);
c = DtoBitCast(m_gvar, getPtrToType(classinfoTy));
c = DtoGEPi(m_gvar, 0, 0);
c = DtoConstSlice(DtoConstSize_t(classInits.size()), c);
}
else
c = DtoConstSlice( DtoConstSize_t(0), getNullValue(getPtrToType(classinfoTy)) );
c = DtoConstSlice( DtoConstSize_t(0), getNullValue(getPtrToType(getPtrToType(classinfoTy))) );
b.push(c);
// flags (4 means MIstandalone)