[llvm] r303477 - Fix breakage after r303461
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 18:28:52 PDT 2017
Author: matze
Date: Fri May 19 20:28:52 2017
New Revision: 303477
URL: http://llvm.org/viewvc/llvm-project?rev=303477&view=rev
Log:
Fix breakage after r303461
- Improve wchar_t size predicitions based on target triple.
- Be less strict in wchar_t size verifier.
Modified:
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=303477&r1=303476&r2=303477&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Fri May 19 20:28:52 2017
@@ -1521,7 +1521,11 @@ TargetLibraryInfoImpl &TargetLibraryAnal
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 {
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=303477&r1=303476&r2=303477&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Fri May 19 20:28:52 2017
@@ -1322,9 +1322,6 @@ Verifier::visitModuleFlag(const MDNode *
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");
}
}
More information about the llvm-commits
mailing list