- Improve wchar_t size predicitions based on target triple.
- Be less strict in wchar_t size verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303477
91177308-0d34-0410-b5e6-
96231b3b80d8
unsigned TargetLibraryInfoImpl::getTargetWCharSize(const Triple &T) {
// See also clang/lib/Basic/Targets.cpp.
- return T.isPS4() || T.isOSWindows() || T.getArch() == Triple::xcore ? 2 : 4;
+ if (T.isPS4() || T.isOSWindows() || T.isArch16Bit())
+ return 2;
+ if (T.getArch() == Triple::xcore)
+ return 1;
+ return 4;
}
unsigned TargetLibraryInfoImpl::getWCharSize(const Module &M) const {
ConstantInt *Value
= mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(2));
Assert(Value, "wchar_size metadata requires constant integer argument");
- uint64_t WCharSize = Value->getZExtValue();
- Assert(WCharSize == 0 || WCharSize == 2 || WCharSize == 4,
- "wchar_size should be 0, 2 or 4");
}
}