Skip to content

Commit d27f845

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6 [skip ci]
2 parents 44a9a0b + 13daa1e commit d27f845

File tree

13 files changed

+123
-131
lines changed

13 files changed

+123
-131
lines changed

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Checks: >
1616
performance-*,
1717
-performance-enum-size,
1818
-performance-no-int-to-ptr,
19-
-performance-type-promotion-in-math-fn,
2019
-performance-unnecessary-value-param,
2120
readability-*,
2221
-readability-avoid-nested-conditional-operator,

clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ void StructPackAlignCheck::check(const MatchFinder::MatchResult &Result) {
7676
CharUnits CurrSize = Result.Context->getASTRecordLayout(Struct).getSize();
7777
CharUnits MinByteSize =
7878
CharUnits::fromQuantity(std::max<clang::CharUnits::QuantityType>(
79-
ceil(static_cast<float>(TotalBitSize) / CharSize), 1));
79+
std::ceil(static_cast<float>(TotalBitSize) / CharSize), 1));
8080
CharUnits MaxAlign = CharUnits::fromQuantity(
81-
ceil((float)Struct->getMaxAlignment() / CharSize));
81+
std::ceil((float)Struct->getMaxAlignment() / CharSize));
8282
CharUnits CurrAlign =
8383
Result.Context->getASTRecordLayout(Struct).getAlignment();
8484
CharUnits NewAlign = computeRecommendedAlignment(MinByteSize);

clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,20 @@ bool UnrollLoopsCheck::hasLargeNumIterations(const Stmt *Statement,
208208
return true;
209209
switch (Op->getOpcode()) {
210210
case (BO_AddAssign):
211-
Iterations = ceil(float(EndValue - InitValue) / ConstantValue);
211+
Iterations = std::ceil(float(EndValue - InitValue) / ConstantValue);
212212
break;
213213
case (BO_SubAssign):
214-
Iterations = ceil(float(InitValue - EndValue) / ConstantValue);
214+
Iterations = std::ceil(float(InitValue - EndValue) / ConstantValue);
215215
break;
216216
case (BO_MulAssign):
217-
Iterations = 1 + (log((double)EndValue) - log((double)InitValue)) /
218-
log((double)ConstantValue);
217+
Iterations =
218+
1 + (std::log((double)EndValue) - std::log((double)InitValue)) /
219+
std::log((double)ConstantValue);
219220
break;
220221
case (BO_DivAssign):
221-
Iterations = 1 + (log((double)InitValue) - log((double)EndValue)) /
222-
log((double)ConstantValue);
222+
Iterations =
223+
1 + (std::log((double)InitValue) - std::log((double)EndValue)) /
224+
std::log((double)ConstantValue);
223225
break;
224226
default:
225227
// All other operators are not handled; assume large bounds.

clang/lib/AST/ByteCode/ByteCodeEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ void ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl,
2424
Function *Func) {
2525
assert(FuncDecl);
2626
assert(Func);
27+
assert(FuncDecl->isThisDeclarationADefinition());
2728

2829
// Manually created functions that haven't been assigned proper
2930
// parameters yet.
3031
if (!FuncDecl->param_empty() && !FuncDecl->param_begin())
3132
return;
3233

33-
if (!FuncDecl->isDefined())
34-
return;
35-
3634
// Set up lambda captures.
3735
if (const auto *MD = dyn_cast<CXXMethodDecl>(FuncDecl);
3836
MD && isLambdaCallOperator(MD)) {
@@ -87,7 +85,7 @@ void ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl,
8785
}
8886

8987
// Set the function's code.
90-
Func->setCode(NextLocalOffset, std::move(Code), std::move(SrcMap),
88+
Func->setCode(FuncDecl, NextLocalOffset, std::move(Code), std::move(SrcMap),
9189
std::move(Scopes), FuncDecl->hasBody());
9290
Func->setIsFullyCompiled(true);
9391
}

clang/lib/AST/ByteCode/Function.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ class Function final {
236236
bool HasRVO, bool IsLambdaStaticInvoker);
237237

238238
/// Sets the code of a function.
239-
void setCode(unsigned NewFrameSize, llvm::SmallVector<std::byte> &&NewCode,
240-
SourceMap &&NewSrcMap, llvm::SmallVector<Scope, 2> &&NewScopes,
241-
bool NewHasBody) {
239+
void setCode(FunctionDeclTy Source, unsigned NewFrameSize,
240+
llvm::SmallVector<std::byte> &&NewCode, SourceMap &&NewSrcMap,
241+
llvm::SmallVector<Scope, 2> &&NewScopes, bool NewHasBody) {
242+
this->Source = Source;
242243
FrameSize = NewFrameSize;
243244
Code = std::move(NewCode);
244245
SrcMap = std::move(NewSrcMap);

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,9 +1493,12 @@ bool CheckDestructor(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
14931493
}
14941494

14951495
static void compileFunction(InterpState &S, const Function *Func) {
1496+
const FunctionDecl *Definition = Func->getDecl()->getDefinition();
1497+
if (!Definition)
1498+
return;
1499+
14961500
Compiler<ByteCodeEmitter>(S.getContext(), S.P)
1497-
.compileFunc(Func->getDecl()->getMostRecentDecl(),
1498-
const_cast<Function *>(Func));
1501+
.compileFunc(Definition, const_cast<Function *>(Func));
14991502
}
15001503

15011504
bool CallVar(InterpState &S, CodePtr OpPC, const Function *Func,

clang/test/Modules/lambda-merge.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -fmodules -std=c++17 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
2+
// RUN: %clang_cc1 -fmodules -std=c++17 -emit-llvm %s -o - -triple x86_64-linux-gnu -fexperimental-new-constant-interpreter | FileCheck %s
23

34
#pragma clang module build A
45
module A {}

lldb/tools/lldb-dap/package.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
"anyOf": [
410410
{
411411
"type": "object",
412-
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. E.g. `{ \"FOO\": \"1\" }`",
412+
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. For example `{ \"FOO\": \"1\" }`",
413413
"patternProperties": {
414414
".*": {
415415
"type": "string"
@@ -419,10 +419,10 @@
419419
},
420420
{
421421
"type": "array",
422-
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. E.g. `[\"FOO=1\", \"BAR\"]`",
422+
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. For example `[\"FOO=1\", \"BAR\"]`",
423423
"items": {
424424
"type": "string",
425-
"pattern": "^((\\w+=.*)|^\\w+)$"
425+
"pattern": "^\\w+(=.*)?$"
426426
},
427427
"default": []
428428
}
@@ -672,6 +672,29 @@
672672
},
673673
"markdownDescription": "The list of additional arguments used to launch the debug adapter executable. Overrides any user or workspace settings."
674674
},
675+
"debugAdapterEnv": {
676+
"anyOf": [
677+
{
678+
"type": "object",
679+
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. For example `{ \"FOO\": \"1\" }`",
680+
"patternProperties": {
681+
".*": {
682+
"type": "string"
683+
}
684+
},
685+
"default": {}
686+
},
687+
{
688+
"type": "array",
689+
"markdownDescription": "Additional environment variables to set when launching the debug adapter executable. For example `[\"FOO=1\", \"BAR\"]`",
690+
"items": {
691+
"type": "string",
692+
"pattern": "^\\w+(=.*)?$"
693+
},
694+
"default": []
695+
}
696+
]
697+
},
675698
"program": {
676699
"type": "string",
677700
"description": "Path to the program to attach to."

lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function validateDAPEnv(debugConfigEnv: any): boolean {
9292
Array.isArray(debugConfigEnv) &&
9393
debugConfigEnv.findIndex(
9494
(entry) =>
95-
typeof entry !== "string" || !/^((\\w+=.*)|^\\w+)$/.test(entry),
95+
typeof entry !== "string" || !/^\w+(=.*)?$/.test(entry),
9696
) !== -1
9797
) {
9898
return false;

llvm/include/llvm/ADT/IndexedMap.h

Lines changed: 45 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,67 +20,56 @@
2020
#ifndef LLVM_ADT_INDEXEDMAP_H
2121
#define LLVM_ADT_INDEXEDMAP_H
2222

23-
#include "llvm/ADT/SmallVector.h"
2423
#include "llvm/ADT/STLExtras.h"
24+
#include "llvm/ADT/SmallVector.h"
2525
#include "llvm/ADT/identity.h"
2626
#include <cassert>
2727

2828
namespace llvm {
2929

30-
template <typename T, typename ToIndexT = identity<unsigned>>
31-
class IndexedMap {
32-
using IndexT = typename ToIndexT::argument_type;
33-
// Prefer SmallVector with zero inline storage over std::vector. IndexedMaps
34-
// can grow very large and SmallVector grows more efficiently as long as T
35-
// is trivially copyable.
36-
using StorageT = SmallVector<T, 0>;
37-
38-
StorageT storage_;
39-
T nullVal_;
40-
ToIndexT toIndex_;
41-
42-
public:
43-
IndexedMap() : nullVal_(T()) {}
44-
45-
explicit IndexedMap(const T& val) : nullVal_(val) {}
46-
47-
typename StorageT::reference operator[](IndexT n) {
48-
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
49-
return storage_[toIndex_(n)];
50-
}
51-
52-
typename StorageT::const_reference operator[](IndexT n) const {
53-
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
54-
return storage_[toIndex_(n)];
55-
}
56-
57-
void reserve(typename StorageT::size_type s) {
58-
storage_.reserve(s);
59-
}
60-
61-
void resize(typename StorageT::size_type s) {
62-
storage_.resize(s, nullVal_);
63-
}
64-
65-
void clear() {
66-
storage_.clear();
67-
}
68-
69-
void grow(IndexT n) {
70-
unsigned NewSize = toIndex_(n) + 1;
71-
if (NewSize > storage_.size())
72-
resize(NewSize);
73-
}
74-
75-
bool inBounds(IndexT n) const {
76-
return toIndex_(n) < storage_.size();
77-
}
78-
79-
typename StorageT::size_type size() const {
80-
return storage_.size();
81-
}
82-
};
83-
84-
} // end namespace llvm
30+
template <typename T, typename ToIndexT = identity<unsigned>> class IndexedMap {
31+
using IndexT = typename ToIndexT::argument_type;
32+
// Prefer SmallVector with zero inline storage over std::vector. IndexedMaps
33+
// can grow very large and SmallVector grows more efficiently as long as T
34+
// is trivially copyable.
35+
using StorageT = SmallVector<T, 0>;
36+
37+
StorageT storage_;
38+
T nullVal_;
39+
ToIndexT toIndex_;
40+
41+
public:
42+
IndexedMap() : nullVal_(T()) {}
43+
44+
explicit IndexedMap(const T &val) : nullVal_(val) {}
45+
46+
typename StorageT::reference operator[](IndexT n) {
47+
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
48+
return storage_[toIndex_(n)];
49+
}
50+
51+
typename StorageT::const_reference operator[](IndexT n) const {
52+
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
53+
return storage_[toIndex_(n)];
54+
}
55+
56+
void reserve(typename StorageT::size_type s) { storage_.reserve(s); }
57+
58+
void resize(typename StorageT::size_type s) { storage_.resize(s, nullVal_); }
59+
60+
void clear() { storage_.clear(); }
61+
62+
void grow(IndexT n) {
63+
unsigned NewSize = toIndex_(n) + 1;
64+
if (NewSize > storage_.size())
65+
resize(NewSize);
66+
}
67+
68+
bool inBounds(IndexT n) const { return toIndex_(n) < storage_.size(); }
69+
70+
typename StorageT::size_type size() const { return storage_.size(); }
71+
};
72+
73+
} // namespace llvm
8574

8675
#endif // LLVM_ADT_INDEXEDMAP_H

0 commit comments

Comments
 (0)