Add the GC commandline options and throw errors if they are used

llvm-svn: 257907
This commit is contained in:
Pete Cooper 2016-01-15 17:39:02 +00:00
parent 7162e8c597
commit 2735783090
5 changed files with 67 additions and 0 deletions

View File

@ -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()) {

View File

@ -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>;

View 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 ]
...

View 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 ]
...

View 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 ]
...