File tree 4 files changed +11
-6
lines changed
4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -811,8 +811,7 @@ version (IN_LLVM)
811
811
Expression getTargetInfo (const (char )* name, const ref Loc loc);
812
812
bool isCalleeDestroyingArgs (TypeFunction tf);
813
813
bool libraryObjectMonitors (FuncDeclaration fd, Statement fbody) { return true ; }
814
- bool supportsLinkerDirective () const { return true ; }
815
-
814
+ bool supportsLinkerDirective () const ;
816
815
}
817
816
else // !IN_LLVM
818
817
{
Original file line number Diff line number Diff line change 17
17
#include " dmd/init.h"
18
18
#include " dmd/nspace.h"
19
19
#include " dmd/root/rmem.h"
20
+ #include " dmd/target.h"
20
21
#include " dmd/template.h"
21
22
#include " driver/cl_options.h"
22
23
#include " gen/classes.h"
@@ -440,7 +441,7 @@ class CodegenVisitor : public Visitor {
440
441
}
441
442
} else if (decl->ident == Id::linkerDirective) {
442
443
// embed in object file (if supported)
443
- if (triple. isWindowsMSVCEnvironment () || triple. isOSBinFormatMachO ()) {
444
+ if (target. supportsLinkerDirective ()) {
444
445
assert (decl->args );
445
446
llvm::SmallVector<llvm::StringRef, 2 > args;
446
447
args.reserve (decl->args ->length );
Original file line number Diff line number Diff line change @@ -325,3 +325,8 @@ bool Target::isCalleeDestroyingArgs(TypeFunction* tf) {
325
325
return global.params .targetTriple ->isWindowsMSVCEnvironment () ||
326
326
tf->linkage != LINK::cpp;
327
327
}
328
+
329
+ bool Target::supportsLinkerDirective () const {
330
+ return global.params .targetTriple ->isWindowsMSVCEnvironment () ||
331
+ global.params .targetTriple ->isOSBinFormatMachO ();
332
+ }
Original file line number Diff line number Diff line change 1
- // RUN: %ldc -mtriple=x86_64-linux-gnu -output-ll -of=%t.ll %s && FileCheck %s < %t.ll
1
+ // RUN: not %ldc -mtriple=x86_64-linux-gnu -o- %s
2
+ // RUN: %ldc -mtriple=x86_64-linux-gnu -ignore -output-ll -of=%t.ll %s && FileCheck %s < %t.ll
2
3
3
4
// REQUIRES: target_X86
4
5
5
6
// CHECK: !llvm.dependent-libraries = !{!0}
6
7
// CHECK: !0 = !{!"mylib"}
7
8
pragma (lib , "mylib" );
8
9
9
- // silently ignored because not (yet?) embeddable in ELF object file:
10
+ // not (yet?) embeddable in ELF object file
10
11
pragma (linkerDirective , "-myflag" );
11
- pragma (linkerDirective , "-framework" , "CoreFoundation" );
You can’t perform that action at this time.
0 commit comments