wchar_t width is now expressed in terms of bits for uniformity.
llvm-svn: 39391
This commit is contained in:
parent
2f5add6272
commit
d5a828b6bb
|
@ -378,7 +378,7 @@ class LinuxTargetInfo : public DarwinTargetInfo {
|
||||||
public:
|
public:
|
||||||
LinuxTargetInfo() {
|
LinuxTargetInfo() {
|
||||||
// Note: I have no idea if this is right, just for testing.
|
// Note: I have no idea if this is right, just for testing.
|
||||||
WCharWidth = 2;
|
WCharWidth = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getTargetDefines(std::vector<std::string> &Defines) const {
|
virtual void getTargetDefines(std::vector<std::string> &Defines) const {
|
||||||
|
|
|
@ -118,7 +118,7 @@ public:
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getWCharWidth - Return the size of wchar_t in bytes.
|
/// getWCharWidth - Return the size of wchar_t in bits.
|
||||||
///
|
///
|
||||||
unsigned getWCharWidth(SourceLocation Loc) {
|
unsigned getWCharWidth(SourceLocation Loc) {
|
||||||
if (!WCharWidth) ComputeWCharWidth(Loc);
|
if (!WCharWidth) ComputeWCharWidth(Loc);
|
||||||
|
@ -151,9 +151,9 @@ private:
|
||||||
/// not appropriate for the target.
|
/// not appropriate for the target.
|
||||||
class TargetInfoImpl {
|
class TargetInfoImpl {
|
||||||
protected:
|
protected:
|
||||||
unsigned WCharWidth; /// sizeof(wchar_t) in bytes. Default value is 4.
|
unsigned WCharWidth; /// sizeof(wchar_t) in bits. Default value is 32.
|
||||||
public:
|
public:
|
||||||
TargetInfoImpl() : WCharWidth(4) {}
|
TargetInfoImpl() : WCharWidth(32) {}
|
||||||
virtual ~TargetInfoImpl() {}
|
virtual ~TargetInfoImpl() {}
|
||||||
|
|
||||||
/// getTargetDefines - Return a list of the target-specific #define values set
|
/// getTargetDefines - Return a list of the target-specific #define values set
|
||||||
|
@ -161,7 +161,7 @@ public:
|
||||||
/// which results in '#define X 1' or "X=Y" which results in "#define X Y"
|
/// which results in '#define X 1' or "X=Y" which results in "#define X Y"
|
||||||
virtual void getTargetDefines(std::vector<std::string> &Defines) const = 0;
|
virtual void getTargetDefines(std::vector<std::string> &Defines) const = 0;
|
||||||
|
|
||||||
/// getWCharWidth - Return the size of wchar_t in bytes.
|
/// getWCharWidth - Return the size of wchar_t in bits.
|
||||||
///
|
///
|
||||||
unsigned getWCharWidth() const { return WCharWidth; }
|
unsigned getWCharWidth() const { return WCharWidth; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue