diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2016-01-15 17:39:02 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2016-01-15 17:39:02 +0000 |
| commit | 2735783090a7aab13a3a06de2e5fc63b3cb66a38 (patch) | |
| tree | 4844f1dcbacd4d56405de3c099f169de2f16e4d5 | |
| parent | 7162e8c597b8053ace1fd8308a428c8c281b95ba (diff) | |
| download | bcm5719-llvm-2735783090a7aab13a3a06de2e5fc63b3cb66a38.tar.gz bcm5719-llvm-2735783090a7aab13a3a06de2e5fc63b3cb66a38.zip | |
Add the GC commandline options and throw errors if they are used
llvm-svn: 257907
| -rw-r--r-- | lld/lib/Driver/DarwinLdDriver.cpp | 16 | ||||
| -rw-r--r-- | lld/lib/Driver/DarwinLdOptions.td | 6 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc.objtxt | 15 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc_compaction.objtxt | 15 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc_only.objtxt | 15 |
5 files changed, 67 insertions, 0 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp index 40fad74c952..984958c905c 100644 --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -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()) { diff --git a/lld/lib/Driver/DarwinLdOptions.td b/lld/lib/Driver/DarwinLdOptions.td index cbf6ac1d4a4..2fad19cc2d5 100644 --- a/lld/lib/Driver/DarwinLdOptions.td +++ b/lld/lib/Driver/DarwinLdOptions.td @@ -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>; diff --git a/lld/test/darwin/cmdline-objc_gc.objtxt b/lld/test/darwin/cmdline-objc_gc.objtxt new file mode 100644 index 00000000000..b5225a1d184 --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc.objtxt @@ -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 ] + +... diff --git a/lld/test/darwin/cmdline-objc_gc_compaction.objtxt b/lld/test/darwin/cmdline-objc_gc_compaction.objtxt new file mode 100644 index 00000000000..acf7183d95e --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc_compaction.objtxt @@ -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 ] + +... diff --git a/lld/test/darwin/cmdline-objc_gc_only.objtxt b/lld/test/darwin/cmdline-objc_gc_only.objtxt new file mode 100644 index 00000000000..db1cef94ea5 --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc_only.objtxt @@ -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 ] + +... |

