mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
[dcomptue] codegen (#2126)
* code generation * simplify logic * apply clang-format * Undo completely inane choice by clang-format * Guard the use of the command line args.
This commit is contained in:
parent
cae9ccd9a4
commit
ae6ff33fc1
23 changed files with 378 additions and 92 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "gen/abi.h"
|
||||
#include "gen/arrays.h"
|
||||
#include "gen/classes.h"
|
||||
#include "gen/dcompute/target.h"
|
||||
#include "gen/dvalue.h"
|
||||
#include "gen/funcgenstate.h"
|
||||
#include "gen/function-inlining.h"
|
||||
|
@ -977,7 +978,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
#if LDC_LLVM_VER >= 500
|
||||
0, // Address space
|
||||
#endif
|
||||
"alloca point", beginbb);
|
||||
"alloca_point", beginbb);
|
||||
funcGen.allocapoint = allocaPoint;
|
||||
|
||||
// debug info - after all allocas, but before any llvm.dbg.declare etc
|
||||
|
@ -1127,6 +1128,11 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
}
|
||||
|
||||
gIR->scopes.pop_back();
|
||||
|
||||
if (gIR->dcomputetarget && hasKernelAttr(fd)) {
|
||||
auto fn = gIR->module.getFunction(fd->mangleString);
|
||||
gIR->dcomputetarget->addKernelMetadata(fd, fn);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue