[PATCH] D46052: GNUstep Objective-C ABI version 2

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue May 22 01:36:19 PDT 2018


On Tue, May 22, 2018 at 10:31 AM, David Chisnall via Phabricator via
cfe-commits <cfe-commits at lists.llvm.org> wrote:
> theraven added inline comments.
>
>
> ================
> Comment at: lib/CodeGen/CGObjCGNU.cpp:1056
> +        char c = Str[i];
> +        if (isalpha(c) || isnumber(c))
> +          StringName += c;
> ----------------
> Ka-Ka wrote:
>> The isnumber() function was added to cctype.h by Apple. I don't think it can be used in llvm.
>>
>> According to
>> https://stackoverflow.com/questions/39204080/what-is-the-difference-between-isdigit-and-isnumber
>>
> Ah, isnumber is from 4.4BSD, I assumed it worked everywhere.  Changing it to isdigit is fine.

Looks like Björn just reverted it in r332957.

While changing isnumber -> isdigit, I suppose it might as well use isalnum().

Also, the test/CodeGenObjC/gnu-init.m test failed for me since
@.objc_source_file_name on the test file path. I relaxed it like this:

diff --git a/test/CodeGenObjC/gnu-init.m b/test/CodeGenObjC/gnu-init.m
index bf6544dba9..beb06bbe0d 100644
--- a/test/CodeGenObjC/gnu-init.m
+++ b/test/CodeGenObjC/gnu-init.m
@@ -60,7 +60,7 @@
 // CHECK-NEW-SAME: @.objc_init
 // CHECK-NEW-NEXT: ret void

-// CHECK-OLD: @4 = internal global { i64, i64, i8*, { i64, { i8*, i8*
}*, i16, i16, [4 x i8*] }* } { i64 9, i64 32, i8* getelementptr
inbounds ([103 x i8], [103 x i8]* @.objc_source_file_name, i64 0, i64
0), { i64, { i8*, i8* }*, i16, i16, [4 x i8*] }* @3 }, align 8
+// CHECK-OLD: @4 = internal global { i64, i64, i8*, { i64, { i8*, i8*
}*, i16, i16, [4 x i8*] }* } { i64 9, i64 32, i8* getelementptr
inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]*
@.objc_source_file_name, i64 0, i64 0), { i64, { i8*, i8* }*, i16,
i16, [4 x i8*] }* @3 }, align 8
 // CHECK-OLD: @llvm.global_ctors = appending global [1 x { i32, void
()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()*
@.objc_load_function, i8* null }]



>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D46052
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list