Skip to content

Commit e493b01

Browse files
committed
rebase
Created using spr 1.3.6
2 parents 82c1131 + d27f845 commit e493b01

File tree

14 files changed

+126
-133
lines changed

14 files changed

+126
-133
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/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,8 +3044,9 @@ void CodeGenModule::createFunctionTypeMetadataForIcall(const FunctionDecl *FD,
30443044
QualType FnType = FD->getType();
30453045
llvm::Metadata *MD = CreateMetadataIdentifierForType(FnType);
30463046
F->addTypeMetadata(0, MD);
3047-
FnType = GeneralizeFunctionType(getContext(), FnType);
3048-
F->addTypeMetadata(0, CreateMetadataIdentifierGeneralized(FnType));
3047+
3048+
QualType GenPtrFnType = GeneralizeFunctionType(getContext(), FD->getType());
3049+
F->addTypeMetadata(0, CreateMetadataIdentifierGeneralized(GenPtrFnType));
30493050

30503051
// Emit a hash-based bit set entry for cross-DSO calls.
30513052
if (CodeGenOpts.SanitizeCfiCrossDso)

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;

0 commit comments

Comments
 (0)