mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-14 14:57:00 +02:00
Emit all D inline asm labels as local labels.
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:
---
import core.exception;
void main() {
asm {
jmp Lfoo;
Lfoo:
;
}
throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
assert(0);
}
---
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#include "template.h"
|
||||
#include "module.h"
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
|
||||
#include "gen/tollvm.h"
|
||||
#include "gen/irstate.h"
|
||||
#include "gen/runtime.h"
|
||||
@@ -1851,3 +1854,11 @@ void callPostblit(Loc &loc, Expression *exp, LLValue *val)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void printLabelName(std::ostream& target, const char* func_mangle, const char* label_name)
|
||||
{
|
||||
target << gTargetMachine->getMCAsmInfo()->getPrivateGlobalPrefix() <<
|
||||
func_mangle << "_" << label_name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user