mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 14:40:40 +03:00
Added ~{memory} clobber when a jump_target is generated in inline asm (branch out of inline asm)
This commit is contained in:
parent
f0d33b1b20
commit
ae214b18e7
2 changed files with 9 additions and 3 deletions
|
@ -594,6 +594,7 @@ void AsmBlockStatement::toIR(IRState* p)
|
|||
// setup variable for output from asm
|
||||
outSetterStmt->out_c = "=*m,";
|
||||
outSetterStmt->out.push_back(jump_target);
|
||||
asmblock->clobs.insert("~{memory},");
|
||||
|
||||
asmblock->s.push_back(outSetterStmt);
|
||||
}
|
||||
|
|
11
gen/toir.cpp
11
gen/toir.cpp
|
@ -2593,7 +2593,11 @@ STUB(TupleExp);
|
|||
STUB(SymbolExp);
|
||||
#endif
|
||||
|
||||
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) {error("non-const expression '%s' or const Exp type "#x" not implemented", toChars()); fatal(); return NULL; }
|
||||
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) { \
|
||||
error("expression '%s' is not a constant", toChars()); \
|
||||
fatal(); \
|
||||
return NULL; \
|
||||
}
|
||||
CONSTSTUB(Expression);
|
||||
CONSTSTUB(GEPExp);
|
||||
CONSTSTUB(SliceExp);
|
||||
|
@ -2761,9 +2765,10 @@ int TypedefDeclaration::cvMember(unsigned char*)
|
|||
|
||||
void obj_includelib(const char* lib)
|
||||
{
|
||||
char *arg = (char *)mem.malloc(64);
|
||||
size_t n = strlen(lib)+3;
|
||||
char *arg = (char *)mem.malloc(n);
|
||||
strcpy(arg, "-l");
|
||||
strncat(arg, lib, 64);
|
||||
strncat(arg, lib, n);
|
||||
global.params.linkswitches->push(arg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue