[cfe-commits] r68363 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/CodeGen/CodeGenModule.cpp test/CodeGen/darwin-string-literals.c

Eli Friedman eli.friedman at gmail.com
Thu Apr 2 20:46:21 PDT 2009


On Thu, Apr 2, 2009 at 5:57 PM, Daniel Dunbar <daniel at zuster.org> wrote:
> +  /// getUnicodeStringSymbolPrefix - Get the default symbol prefix to
> +  /// use for string literals.
> +  virtual const char *getUnicodeStringSymbolPrefix() const {
> +    return ".str";
> +  }

Shouldn't this be called "getUnicodeCFStringSymbolPrefix"?

Also, I'm kind of curious, why does this matter?  It's an internal
symbol, nothing should be able to see it...

> +  /// getUnicodeStringSymbolPrefix - Get the default symbol prefix to
> +  /// use for string literals.

Comment is wrong.

> +  virtual const char *getUnicodeStringSymbolPrefix() const {
> +    return "__utf16_string_";
> +  }

Should this be prefixed with \01 for consistency?

> +  if (isUTF16) {
> +    unsigned Align = getContext().getTypeAlign(getContext().ShortTy)/8;
> +    GV->setAlignment(Align);
> +  }

Would it be more natural to make UTF-16 strings arrays of i16's
instead of manually messing with the alignment?

-Eli




More information about the cfe-commits mailing list