From: Dave Lee Date: Sun, 4 Apr 2021 21:52:26 +0000 (-0700) Subject: [lldb] Replace unneeded use of Foundation with ObjectiveC in tests (NFC) X-Git-Tag: llvmorg-14-init~10474 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1a1798e51a30fbf537e9fd8931a49b504f37a25;p=platform%2Fupstream%2Fllvm.git [lldb] Replace unneeded use of Foundation with ObjectiveC in tests (NFC) When referencing `NSObject`, it's enough to import `objc/NSObject.h`. Importing `Foundation` is unnecessary in these cases. Differential Revision: https://reviews.llvm.org/D99867 --- diff --git a/lldb/test/API/commands/expression/context-object-objc/Makefile b/lldb/test/API/commands/expression/context-object-objc/Makefile index a3198db..11fce1e 100644 --- a/lldb/test/API/commands/expression/context-object-objc/Makefile +++ b/lldb/test/API/commands/expression/context-object-objc/Makefile @@ -1,3 +1,4 @@ OBJC_SOURCES := main.m -LD_EXTRAS := -framework Foundation +LD_EXTRAS := -lobjc + include Makefile.rules diff --git a/lldb/test/API/commands/expression/context-object-objc/main.m b/lldb/test/API/commands/expression/context-object-objc/main.m index 5c495b2..dd63b7b 100644 --- a/lldb/test/API/commands/expression/context-object-objc/main.m +++ b/lldb/test/API/commands/expression/context-object-objc/main.m @@ -1,4 +1,4 @@ -#import +#import @interface ObjcClass : NSObject { int field; diff --git a/lldb/test/API/commands/expression/namespace_local_var_same_name_obj_c/main.mm b/lldb/test/API/commands/expression/namespace_local_var_same_name_obj_c/main.mm index 70e9598..62e4475 100644 --- a/lldb/test/API/commands/expression/namespace_local_var_same_name_obj_c/main.mm +++ b/lldb/test/API/commands/expression/namespace_local_var_same_name_obj_c/main.mm @@ -1,4 +1,4 @@ -#import +#import @interface Util : NSObject + (void)debugPrintErrorStatic; - (void)debugPrintError; diff --git a/lldb/test/API/commands/frame/recognizer/Makefile b/lldb/test/API/commands/frame/recognizer/Makefile index 8248c01..09f6bd5 100644 --- a/lldb/test/API/commands/frame/recognizer/Makefile +++ b/lldb/test/API/commands/frame/recognizer/Makefile @@ -1,9 +1,5 @@ OBJC_SOURCES := main.m - CFLAGS_EXTRAS := -g0 # No debug info. MAKE_DSYM := NO - - -LD_EXTRAS := -framework Foundation include Makefile.rules diff --git a/lldb/test/API/commands/frame/recognizer/main.m b/lldb/test/API/commands/frame/recognizer/main.m index 5d064c2..6546692 100644 --- a/lldb/test/API/commands/frame/recognizer/main.m +++ b/lldb/test/API/commands/frame/recognizer/main.m @@ -1,4 +1,4 @@ -#import +#import void foo(int a, int b) { diff --git a/lldb/test/API/functionalities/type_lookup/Makefile b/lldb/test/API/functionalities/type_lookup/Makefile index 8763401..547bb7e 100644 --- a/lldb/test/API/functionalities/type_lookup/Makefile +++ b/lldb/test/API/functionalities/type_lookup/Makefile @@ -1,8 +1,5 @@ OBJCXX_SOURCES := main.mm - CFLAGS_EXTRAS := -w +LD_EXTRAS := -lobjc - - -LD_EXTRAS := -framework Foundation include Makefile.rules diff --git a/lldb/test/API/functionalities/type_lookup/main.mm b/lldb/test/API/functionalities/type_lookup/main.mm index 663bd11..88da46d 100644 --- a/lldb/test/API/functionalities/type_lookup/main.mm +++ b/lldb/test/API/functionalities/type_lookup/main.mm @@ -1,4 +1,4 @@ -#import +#import class MyCPPClass { public: diff --git a/lldb/test/API/lang/objc/bitfield_ivars/Makefile b/lldb/test/API/lang/objc/bitfield_ivars/Makefile index a68dad5..1b3b326 100644 --- a/lldb/test/API/lang/objc/bitfield_ivars/Makefile +++ b/lldb/test/API/lang/objc/bitfield_ivars/Makefile @@ -1,4 +1,4 @@ OBJC_SOURCES := main.m -LD_EXTRAS = -framework Foundation +LD_EXTRAS = -lobjc include Makefile.rules diff --git a/lldb/test/API/lang/objc/bitfield_ivars/main.m b/lldb/test/API/lang/objc/bitfield_ivars/main.m index ce0ca31..75d3239 100644 --- a/lldb/test/API/lang/objc/bitfield_ivars/main.m +++ b/lldb/test/API/lang/objc/bitfield_ivars/main.m @@ -1,4 +1,4 @@ -#import +#import typedef struct { unsigned char fieldOne : 1; diff --git a/lldb/test/API/lang/objc/blocks/Makefile b/lldb/test/API/lang/objc/blocks/Makefile index df76ed3..14af79a 100644 --- a/lldb/test/API/lang/objc/blocks/Makefile +++ b/lldb/test/API/lang/objc/blocks/Makefile @@ -1,4 +1,4 @@ OBJC_SOURCES := ivars-in-blocks.m main.m -LD_EXTRAS := -lobjc -framework Foundation +LD_EXTRAS := -lobjc include Makefile.rules diff --git a/lldb/test/API/lang/objc/blocks/ivars-in-blocks.h b/lldb/test/API/lang/objc/blocks/ivars-in-blocks.h index 1ceac33..cf5eba7 100644 --- a/lldb/test/API/lang/objc/blocks/ivars-in-blocks.h +++ b/lldb/test/API/lang/objc/blocks/ivars-in-blocks.h @@ -1,4 +1,4 @@ -#import +#import @interface IAmBlocky : NSObject { diff --git a/lldb/test/API/lang/objc/blocks/ivars-in-blocks.m b/lldb/test/API/lang/objc/blocks/ivars-in-blocks.m index 1098a91..37d266f 100644 --- a/lldb/test/API/lang/objc/blocks/ivars-in-blocks.m +++ b/lldb/test/API/lang/objc/blocks/ivars-in-blocks.m @@ -1,4 +1,5 @@ #import "ivars-in-blocks.h" +#import typedef int (^my_block_ptr_type) (int); diff --git a/lldb/test/API/lang/objc/conflicting-definition/Test/Test.h b/lldb/test/API/lang/objc/conflicting-definition/Test/Test.h index 73928c5..ff50ddb 100644 --- a/lldb/test/API/lang/objc/conflicting-definition/Test/Test.h +++ b/lldb/test/API/lang/objc/conflicting-definition/Test/Test.h @@ -1,5 +1,5 @@ -#import #import +#import @interface Test : NSObject { @public diff --git a/lldb/test/API/lang/objc/forward-decl/Container.h b/lldb/test/API/lang/objc/forward-decl/Container.h index 85bbd06..2b53e28 100644 --- a/lldb/test/API/lang/objc/forward-decl/Container.h +++ b/lldb/test/API/lang/objc/forward-decl/Container.h @@ -1,4 +1,4 @@ -#import +#import @class ForwardDeclaredClass; diff --git a/lldb/test/API/lang/objc/forward-decl/Makefile b/lldb/test/API/lang/objc/forward-decl/Makefile index cfae251..252dfb6 100644 --- a/lldb/test/API/lang/objc/forward-decl/Makefile +++ b/lldb/test/API/lang/objc/forward-decl/Makefile @@ -1,8 +1,6 @@ DYLIB_NAME := Container DYLIB_OBJC_SOURCES := Container.m OBJC_SOURCES := main.m +LD_EXTRAS := -lobjc - - -LD_EXTRAS := -framework Foundation include Makefile.rules diff --git a/lldb/test/API/lang/objc/forward-decl/main.m b/lldb/test/API/lang/objc/forward-decl/main.m index 8e5256e..7b65248 100644 --- a/lldb/test/API/lang/objc/forward-decl/main.m +++ b/lldb/test/API/lang/objc/forward-decl/main.m @@ -1,5 +1,6 @@ -#import +#import #import "Container.h" +#import int main(int argc, const char * argv[]) { diff --git a/lldb/test/API/lang/objc/foundation/my-base.m b/lldb/test/API/lang/objc/foundation/my-base.m index 0c316b2..4147ac1 100644 --- a/lldb/test/API/lang/objc/foundation/my-base.m +++ b/lldb/test/API/lang/objc/foundation/my-base.m @@ -1,4 +1,4 @@ -#import +#import #import "my-base.h" @implementation MyBase #if __OBJC2__ diff --git a/lldb/test/API/lang/objc/hidden-ivars/InternalDefiner.h b/lldb/test/API/lang/objc/hidden-ivars/InternalDefiner.h index 59652d4..f5d8e01 100644 --- a/lldb/test/API/lang/objc/hidden-ivars/InternalDefiner.h +++ b/lldb/test/API/lang/objc/hidden-ivars/InternalDefiner.h @@ -1,4 +1,4 @@ -#import +#import #import @interface InternalDefiner : NSObject { diff --git a/lldb/test/API/lang/objc/ivar-IMP/Makefile b/lldb/test/API/lang/objc/ivar-IMP/Makefile index 5d920f4..91d4666 100644 --- a/lldb/test/API/lang/objc/ivar-IMP/Makefile +++ b/lldb/test/API/lang/objc/ivar-IMP/Makefile @@ -1,5 +1,5 @@ OBJC_SOURCES := myclass.m repro.m -LD_EXTRAS := -framework Foundation +LD_EXTRAS := -lobjc include Makefile.rules diff --git a/lldb/test/API/lang/objc/ivar-IMP/myclass.h b/lldb/test/API/lang/objc/ivar-IMP/myclass.h index da28d1e..2dfa3dd 100644 --- a/lldb/test/API/lang/objc/ivar-IMP/myclass.h +++ b/lldb/test/API/lang/objc/ivar-IMP/myclass.h @@ -1,4 +1,4 @@ -#import +#import @interface MyClass : NSObject {} diff --git a/lldb/test/API/lang/objc/ivar-IMP/myclass.m b/lldb/test/API/lang/objc/ivar-IMP/myclass.m index 85b2fcf..6515180 100644 --- a/lldb/test/API/lang/objc/ivar-IMP/myclass.m +++ b/lldb/test/API/lang/objc/ivar-IMP/myclass.m @@ -1,4 +1,4 @@ -#import +#import #import "myclass.h" @implementation MyClass diff --git a/lldb/test/API/lang/objc/ivar-IMP/repro.m b/lldb/test/API/lang/objc/ivar-IMP/repro.m index 14f911f..289ee5f 100644 --- a/lldb/test/API/lang/objc/ivar-IMP/repro.m +++ b/lldb/test/API/lang/objc/ivar-IMP/repro.m @@ -1,4 +1,4 @@ -#import +#import #import "myclass.h" int main() { diff --git a/lldb/test/API/lang/objc/modules-objc-property/main.m b/lldb/test/API/lang/objc/modules-objc-property/main.m index c0f58f4..54d69c0 100644 --- a/lldb/test/API/lang/objc/modules-objc-property/main.m +++ b/lldb/test/API/lang/objc/modules-objc-property/main.m @@ -1,4 +1,4 @@ -@import Foundation; +@import ObjectiveC; @import myModule; int main() { diff --git a/lldb/test/API/lang/objc/modules-objc-property/myModule.h b/lldb/test/API/lang/objc/modules-objc-property/myModule.h index 07b40cc..4377d30 100644 --- a/lldb/test/API/lang/objc/modules-objc-property/myModule.h +++ b/lldb/test/API/lang/objc/modules-objc-property/myModule.h @@ -1,7 +1,7 @@ #ifndef MYMODULE #define MYMODULE -@import Foundation; +@import ObjectiveC; @interface MyClass : NSObject - (int) propConflict; diff --git a/lldb/test/API/lang/objc/objc-ivar-offsets/Makefile b/lldb/test/API/lang/objc/objc-ivar-offsets/Makefile index 5408f41..83821a6 100644 --- a/lldb/test/API/lang/objc/objc-ivar-offsets/Makefile +++ b/lldb/test/API/lang/objc/objc-ivar-offsets/Makefile @@ -1,4 +1,4 @@ OBJC_SOURCES := objc-ivar-offsets.m main.m -LD_EXTRAS := -lobjc -framework Foundation +LD_EXTRAS := -lobjc include Makefile.rules diff --git a/lldb/test/API/lang/objc/objc-ivar-offsets/objc-ivar-offsets.h b/lldb/test/API/lang/objc/objc-ivar-offsets/objc-ivar-offsets.h index 99bbd42..6592c0f 100644 --- a/lldb/test/API/lang/objc/objc-ivar-offsets/objc-ivar-offsets.h +++ b/lldb/test/API/lang/objc/objc-ivar-offsets/objc-ivar-offsets.h @@ -1,4 +1,5 @@ -#import +#import +#import @interface BaseClass : NSObject { diff --git a/lldb/test/API/lang/objc/objc-super/Makefile b/lldb/test/API/lang/objc/objc-super/Makefile index e6db3de..6df044b 100644 --- a/lldb/test/API/lang/objc/objc-super/Makefile +++ b/lldb/test/API/lang/objc/objc-super/Makefile @@ -1,4 +1,4 @@ OBJC_SOURCES := class.m -LD_EXTRAS := -lobjc -framework Foundation +LD_EXTRAS := -lobjc include Makefile.rules diff --git a/lldb/test/API/lang/objc/objc-super/class.m b/lldb/test/API/lang/objc/objc-super/class.m index b55b649..a300087 100644 --- a/lldb/test/API/lang/objc/objc-super/class.m +++ b/lldb/test/API/lang/objc/objc-super/class.m @@ -1,4 +1,4 @@ -#import +#import @interface Foo : NSObject { } diff --git a/lldb/test/API/lang/objcxx/class-name-clash/myobject.mm b/lldb/test/API/lang/objcxx/class-name-clash/myobject.mm index 051c4e5..5c40746 100644 --- a/lldb/test/API/lang/objcxx/class-name-clash/myobject.mm +++ b/lldb/test/API/lang/objcxx/class-name-clash/myobject.mm @@ -1,4 +1,4 @@ -#import +#import @interface MyObject : NSObject @end diff --git a/lldb/test/API/python_api/class_members/main.mm b/lldb/test/API/python_api/class_members/main.mm index b84f4d3..723cb61 100644 --- a/lldb/test/API/python_api/class_members/main.mm +++ b/lldb/test/API/python_api/class_members/main.mm @@ -1,4 +1,4 @@ -#import +#import class Base { public: diff --git a/lldb/test/API/python_api/objc_type/Makefile b/lldb/test/API/python_api/objc_type/Makefile index 8b322ff..5f07431 100644 --- a/lldb/test/API/python_api/objc_type/Makefile +++ b/lldb/test/API/python_api/objc_type/Makefile @@ -1,8 +1,5 @@ OBJC_SOURCES := main.m - CFLAGS_EXTRAS := -w +LD_EXTRAS := -lobjc - - -LD_EXTRAS := -framework Foundation include Makefile.rules diff --git a/lldb/test/API/python_api/objc_type/main.m b/lldb/test/API/python_api/objc_type/main.m index 941442f..6075622 100644 --- a/lldb/test/API/python_api/objc_type/main.m +++ b/lldb/test/API/python_api/objc_type/main.m @@ -1,4 +1,4 @@ -#import +#import @interface Foo: NSObject {}