CFSTR and NSConstantString

Hello the list,

We'd like to be able to support CFSTR() with GNUstep emitting NSConstantString instances. There are three ways that I can do this:

1) Make CodeGenModule::GetAddrOfConstantCFString() check if the gnu runtime is being used and call the CGObjCRuntime function to emit the string if it is.

2) Add a new builtin, __builtin___NSStringMakeConstantString(), which behaves exactly like __builtin___CFStringMakeConstantString() but emits a new ObjC constant string, rather than a new CF string (although, with the Mac runtimes, they will be the same thing anyway).

3) Add a new option, like -fcfstrings-as-nsstrings which makes CF strings into NSStrings.

My preference is on the first option, although largely because it's the least effort for me. Does anyone have any preferences or objections?

David

-- Sent from my IBM 1620

Hi,

In LiteralSupport.cpp we explicitly disallow ui64 suffix in msft extensions (as in #define ULLONG_MAX 0xffffffffffffffffui64).
This constant is defined by visual studio's "limits.h".

- Thanks, Fariborz

Where is it explicitly disallowed?

-Chris

Hi,

In LiteralSupport.cpp we explicitly disallow ui64 suffix in msft
extensions (as in #define ULLONG_MAX 0xffffffffffffffffui64).
This constant is defined by visual studio's "limits.h".

Where is it explicitly disallowed?

in: lib/Lex/LiteralSupport.cpp

      case 'u':
     case 'U':
       if (isFPConstant) break; // Error for floating constant.
       if (isUnsigned) break; // Cannot be repeated.
       isUnsigned = true;
       continue; // Success.

...

case 'i':
       if (PP.getLangOptions().Microsoft) {
         if (isFPConstant || isUnsigned || isLong || isLongLong) break;

Hello the list,

We'd like to be able to support CFSTR() with GNUstep emitting NSConstantString instances. There are three ways that I can do this:

1) Make CodeGenModule::GetAddrOfConstantCFString() check if the gnu runtime is being used and call the CGObjCRuntime function to emit the string if it is.

2) Add a new builtin, __builtin___NSStringMakeConstantString(), which behaves exactly like __builtin___CFStringMakeConstantString() but emits a new ObjC constant string, rather than a new CF string (although, with the Mac runtimes, they will be the same thing anyway).

3) Add a new option, like -fcfstrings-as-nsstrings which makes CF strings into NSStrings.

My preference is on the first option, although largely because it's the least effort for me. Does anyone have any preferences or objections?

Since 2) has established a precedence, we should probably go with that.

- fariborz

Ah, just looks like an oversight,

-Chris

Oh ,sorry, this looks an oversight from my part when I restructured that code.
Nuno