update clang-format to 11

This commit is contained in:
van Hauser
2020-11-30 22:08:26 +01:00
parent e769102491
commit f7d8643dc4
4 changed files with 17 additions and 20 deletions

View File

@ -29,7 +29,7 @@ CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN")
if CLANG_FORMAT_BIN is None: if CLANG_FORMAT_BIN is None:
o = 0 o = 0
try: try:
p = subprocess.Popen(["clang-format-10", "--version"], stdout=subprocess.PIPE) p = subprocess.Popen(["clang-format-11", "--version"], stdout=subprocess.PIPE)
o, _ = p.communicate() o, _ = p.communicate()
o = str(o, "utf-8") o = str(o, "utf-8")
o = re.sub(r".*ersion ", "", o) o = re.sub(r".*ersion ", "", o)
@ -37,7 +37,7 @@ if CLANG_FORMAT_BIN is None:
o = o[:o.find(".")] o = o[:o.find(".")]
o = int(o) o = int(o)
except: except:
print ("clang-format-10 is needed. Aborted.") print ("clang-format-11 is needed. Aborted.")
exit(1) exit(1)
#if o < 7: #if o < 7:
# if subprocess.call(['which', 'clang-format-7'], stdout=subprocess.PIPE) == 0: # if subprocess.call(['which', 'clang-format-7'], stdout=subprocess.PIPE) == 0:
@ -46,13 +46,13 @@ if CLANG_FORMAT_BIN is None:
# CLANG_FORMAT_BIN = 'clang-format-8' # CLANG_FORMAT_BIN = 'clang-format-8'
# elif subprocess.call(['which', 'clang-format-9'], stdout=subprocess.PIPE) == 0: # elif subprocess.call(['which', 'clang-format-9'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-9' # CLANG_FORMAT_BIN = 'clang-format-9'
# elif subprocess.call(['which', 'clang-format-10'], stdout=subprocess.PIPE) == 0: # elif subprocess.call(['which', 'clang-format-11'], stdout=subprocess.PIPE) == 0:
# CLANG_FORMAT_BIN = 'clang-format-10' # CLANG_FORMAT_BIN = 'clang-format-11'
# else: # else:
# print ("clang-format 7 or above is needed. Aborted.") # print ("clang-format 7 or above is needed. Aborted.")
# exit(1) # exit(1)
else: else:
CLANG_FORMAT_BIN = 'clang-format-10' CLANG_FORMAT_BIN = 'clang-format-11'
COLUMN_LIMIT = 80 COLUMN_LIMIT = 80
for line in fmt.split("\n"): for line in fmt.split("\n"):

View File

@ -1127,11 +1127,11 @@ void ModuleSanitizerCoverage::InjectTraceForCmp(
Value * A1 = ICMP->getOperand(1); Value * A1 = ICMP->getOperand(1);
if (!A0->getType()->isIntegerTy()) continue; if (!A0->getType()->isIntegerTy()) continue;
uint64_t TypeSize = DL->getTypeStoreSizeInBits(A0->getType()); uint64_t TypeSize = DL->getTypeStoreSizeInBits(A0->getType());
int CallbackIdx = int CallbackIdx = TypeSize == 8 ? 0
TypeSize == 8
? 0
: TypeSize == 16 ? 1 : TypeSize == 16 ? 1
: TypeSize == 32 ? 2 : TypeSize == 64 ? 3 : -1; : TypeSize == 32 ? 2
: TypeSize == 64 ? 3
: -1;
if (CallbackIdx < 0) continue; if (CallbackIdx < 0) continue;
// __sanitizer_cov_trace_cmp((type_size << 32) | predicate, A0, A1); // __sanitizer_cov_trace_cmp((type_size << 32) | predicate, A0, A1);
auto CallbackFunc = SanCovTraceCmpFunction[CallbackIdx]; auto CallbackFunc = SanCovTraceCmpFunction[CallbackIdx];

View File

@ -601,11 +601,8 @@ size_t SplitComparesTransform::splitFPCompares(Module &M) {
if (op_size != op1->getType()->getPrimitiveSizeInBits()) { continue; } if (op_size != op1->getType()->getPrimitiveSizeInBits()) { continue; }
const unsigned int sizeInBits = op0->getType()->getPrimitiveSizeInBits(); const unsigned int sizeInBits = op0->getType()->getPrimitiveSizeInBits();
const unsigned int precision = const unsigned int precision = sizeInBits == 32 ? 24
sizeInBits == 32 : sizeInBits == 64 ? 53
? 24
: sizeInBits == 64
? 53
: sizeInBits == 128 ? 113 : sizeInBits == 128 ? 113
: sizeInBits == 16 ? 11 : sizeInBits == 16 ? 11
/* sizeInBits == 80 */ /* sizeInBits == 80 */