mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-16 04:20:59 +00:00
Add the GC commandline options and throw errors if they are used
llvm-svn: 257907
This commit is contained in:
parent
7162e8c597
commit
2735783090
@ -673,6 +673,22 @@ bool DarwinLdDriver::parse(llvm::ArrayRef<const char *> args,
|
||||
}
|
||||
}
|
||||
|
||||
// Handle obsolete ObjC options: -objc_gc_compaction, -objc_gc, -objc_gc_only
|
||||
if (parsedArgs.getLastArg(OPT_objc_gc_compaction)) {
|
||||
diagnostics << "error: -objc_gc_compaction is not supported\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parsedArgs.getLastArg(OPT_objc_gc)) {
|
||||
diagnostics << "error: -objc_gc is not supported\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parsedArgs.getLastArg(OPT_objc_gc_only)) {
|
||||
diagnostics << "error: -objc_gc_only is not supported\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle -pie or -no_pie
|
||||
if (llvm::opt::Arg *pie = parsedArgs.getLastArg(OPT_pie, OPT_no_pie)) {
|
||||
switch (ctx.outputMachOType()) {
|
||||
|
@ -205,3 +205,9 @@ def single_module : Flag<["-"], "single_module">,
|
||||
HelpText<"Default for dylibs">, Group<grp_obsolete>;
|
||||
def multi_module : Flag<["-"], "multi_module">,
|
||||
HelpText<"Unsupported way to build dylibs">, Group<grp_obsolete>;
|
||||
def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">,
|
||||
HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>;
|
||||
def objc_gc : Flag<["-"], "objc_gc">,
|
||||
HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>;
|
||||
def objc_gc_only : Flag<["-"], "objc_gc_only">,
|
||||
HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>;
|
||||
|
15
lld/test/darwin/cmdline-objc_gc.objtxt
Normal file
15
lld/test/darwin/cmdline-objc_gc.objtxt
Normal file
@ -0,0 +1,15 @@
|
||||
# RUN: not lld -flavor darwin -arch x86_64 -objc_gc %s 2>&1 | FileCheck %s
|
||||
#
|
||||
# Test that the -objc_gc is rejected.
|
||||
#
|
||||
|
||||
# CHECK: error: -objc_gc is not supported
|
||||
|
||||
--- !native
|
||||
defined-atoms:
|
||||
- name: _main
|
||||
type: code
|
||||
scope: global
|
||||
content: [ 0x90 ]
|
||||
|
||||
...
|
15
lld/test/darwin/cmdline-objc_gc_compaction.objtxt
Normal file
15
lld/test/darwin/cmdline-objc_gc_compaction.objtxt
Normal file
@ -0,0 +1,15 @@
|
||||
# RUN: not lld -flavor darwin -arch x86_64 -objc_gc_compaction %s 2>&1 | FileCheck %s
|
||||
#
|
||||
# Test that the -objc_gc_compaction is rejected.
|
||||
#
|
||||
|
||||
# CHECK: error: -objc_gc_compaction is not supported
|
||||
|
||||
--- !native
|
||||
defined-atoms:
|
||||
- name: _main
|
||||
type: code
|
||||
scope: global
|
||||
content: [ 0x90 ]
|
||||
|
||||
...
|
15
lld/test/darwin/cmdline-objc_gc_only.objtxt
Normal file
15
lld/test/darwin/cmdline-objc_gc_only.objtxt
Normal file
@ -0,0 +1,15 @@
|
||||
# RUN: not lld -flavor darwin -arch x86_64 -objc_gc_only %s 2>&1 | FileCheck %s
|
||||
#
|
||||
# Test that the -objc_gc_only is rejected.
|
||||
#
|
||||
|
||||
# CHECK: error: -objc_gc_only is not supported
|
||||
|
||||
--- !native
|
||||
defined-atoms:
|
||||
- name: _main
|
||||
type: code
|
||||
scope: global
|
||||
content: [ 0x90 ]
|
||||
|
||||
...
|
Loading…
Reference in New Issue
Block a user