Skip to content

Commit 1a265dc

Browse files
authored
Merge branch 'main' into assume-filename-with-clang-format-ignore
2 parents 506a4a4 + 173907b commit 1a265dc

File tree

27 files changed

+159
-61
lines changed

27 files changed

+159
-61
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,13 @@ class CXXTypeidExpr : public Expr {
876876

877877
/// Best-effort check if the expression operand refers to a most derived
878878
/// object. This is not a strong guarantee.
879-
bool isMostDerived(ASTContext &Context) const;
879+
bool isMostDerived(const ASTContext &Context) const;
880880

881881
bool isTypeOperand() const { return Operand.is<TypeSourceInfo *>(); }
882882

883883
/// Retrieves the type operand of this typeid() expression after
884884
/// various required adjustments (removing reference types, cv-qualifiers).
885-
QualType getTypeOperand(ASTContext &Context) const;
885+
QualType getTypeOperand(const ASTContext &Context) const;
886886

887887
/// Retrieve source information for the type operand.
888888
TypeSourceInfo *getTypeOperandSourceInfo() const {

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,10 @@ static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
13311331
const InterpFrame *Frame,
13321332
const Function *Func,
13331333
const CallExpr *Call) {
1334+
if (!Call->getArg(0)->getType()->isIntegerType() ||
1335+
!Call->getArg(1)->getType()->isIntegerType())
1336+
return false;
1337+
13341338
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13351339
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13361340

@@ -1352,6 +1356,10 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
13521356
const InterpFrame *Frame,
13531357
const Function *Func,
13541358
const CallExpr *Call) {
1359+
if (!Call->getArg(0)->getType()->isIntegerType() ||
1360+
!Call->getArg(1)->getType()->isIntegerType())
1361+
return false;
1362+
13551363
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
13561364
PrimType MaskT = *S.Ctx.classify(Call->getArg(1));
13571365

clang/lib/AST/ExprCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool CXXTypeidExpr::isPotentiallyEvaluated() const {
147147
return false;
148148
}
149149

150-
bool CXXTypeidExpr::isMostDerived(ASTContext &Context) const {
150+
bool CXXTypeidExpr::isMostDerived(const ASTContext &Context) const {
151151
assert(!isTypeOperand() && "Cannot call isMostDerived for typeid(type)");
152152
const Expr *E = getExprOperand()->IgnoreParenNoopCasts(Context);
153153
if (const auto *DRE = dyn_cast<DeclRefExpr>(E)) {
@@ -159,7 +159,7 @@ bool CXXTypeidExpr::isMostDerived(ASTContext &Context) const {
159159
return false;
160160
}
161161

162-
QualType CXXTypeidExpr::getTypeOperand(ASTContext &Context) const {
162+
QualType CXXTypeidExpr::getTypeOperand(const ASTContext &Context) const {
163163
assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)");
164164
Qualifiers Quals;
165165
return Context.getUnqualifiedArrayType(

clang/lib/Tooling/Inclusions/HeaderIncludes.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,9 @@ HeaderIncludes::HeaderIncludes(StringRef FileName, StringRef Code,
335335
// \p Offset: the start of the line following this include directive.
336336
void HeaderIncludes::addExistingInclude(Include IncludeToAdd,
337337
unsigned NextLineOffset) {
338-
auto Iter =
339-
ExistingIncludes.try_emplace(trimInclude(IncludeToAdd.Name)).first;
340-
Iter->second.push_back(std::move(IncludeToAdd));
341-
auto &CurInclude = Iter->second.back();
338+
auto &Incs = ExistingIncludes[trimInclude(IncludeToAdd.Name)];
339+
Incs.push_back(std::move(IncludeToAdd));
340+
auto &CurInclude = Incs.back();
342341
// The header name with quotes or angle brackets.
343342
// Only record the offset of current #include if we can insert after it.
344343
if (CurInclude.R.getOffset() <= MaxInsertOffset) {

compiler-rt/test/asan/TestCases/Windows/delay_dbghelp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// static build, there won't be any clang_rt DLLs.
1010
// RUN: not grep cl""ang_rt %t || \
1111
// RUN: grep cl""ang_rt %t | xargs which | \
12-
// RUN: xargs llvm-readobj --coff-imports | not grep dbghelp.dll %t
12+
// RUN: xargs llvm-readobj --coff-imports | not grep dbghelp.dll
1313

1414
extern "C" int puts(const char *);
1515

libc/src/string/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ add_entrypoint_object(
138138
DEPENDS
139139
.strcpy
140140
.string_utils
141+
libc.include.llvm-libc-types.size_t
141142
)
142143

143144
add_entrypoint_object(
@@ -240,6 +241,7 @@ add_entrypoint_object(
240241
.string_utils
241242
libc.include.stdlib
242243
libc.src.errno.errno
244+
libc.include.llvm-libc-types.size_t
243245
)
244246

245247
add_entrypoint_object(
@@ -270,7 +272,7 @@ add_entrypoint_object(
270272
strlcat.h
271273
DEPENDS
272274
.string_utils
273-
libc.include.string
275+
libc.include.llvm-libc-types.size_t
274276
)
275277

276278
add_entrypoint_object(
@@ -281,7 +283,7 @@ add_entrypoint_object(
281283
strlcpy.h
282284
DEPENDS
283285
.string_utils
284-
libc.include.string
286+
libc.include.llvm-libc-types.size_t
285287
)
286288

287289
add_entrypoint_object(
@@ -292,7 +294,7 @@ add_entrypoint_object(
292294
strlen.h
293295
DEPENDS
294296
.string_utils
295-
libc.include.string
297+
libc.include.llvm-libc-types.size_t
296298
)
297299

298300
add_entrypoint_object(
@@ -304,6 +306,7 @@ add_entrypoint_object(
304306
DEPENDS
305307
.strncpy
306308
.string_utils
309+
libc.include.llvm-libc-types.size_t
307310
)
308311

309312
add_entrypoint_object(
@@ -346,6 +349,7 @@ add_entrypoint_object(
346349
.string_utils
347350
libc.include.stdlib
348351
libc.src.__support.CPP.new
352+
libc.include.llvm-libc-types.size_t
349353
)
350354

351355
add_entrypoint_object(

libc/src/string/strcat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_STRING_STRCAT_H
1010
#define LLVM_LIBC_SRC_STRING_STRCAT_H
1111

12+
#include "include/llvm-libc-types/size_t.h"
1213
#include "src/__support/macros/config.h"
13-
#include <string.h>
1414

1515
namespace LIBC_NAMESPACE_DECL {
1616

libc/src/string/strcpy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_STRING_STRCPY_H
1010
#define LLVM_LIBC_SRC_STRING_STRCPY_H
1111

12+
#include "include/llvm-libc-types/size_t.h"
1213
#include "src/__support/macros/config.h"
13-
#include <string.h>
1414

1515
namespace LIBC_NAMESPACE_DECL {
1616

libc/src/string/strdup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_STRING_STRDUP_H
1010
#define LLVM_LIBC_SRC_STRING_STRDUP_H
1111

12+
#include "include/llvm-libc-types/size_t.h"
1213
#include "src/__support/macros/config.h"
13-
#include <string.h>
1414

1515
namespace LIBC_NAMESPACE_DECL {
1616

libc/src/string/strlcat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_STRING_STRLCAT_H
1010
#define LLVM_LIBC_SRC_STRING_STRLCAT_H
1111

12+
#include "include/llvm-libc-types/size_t.h"
1213
#include "src/__support/macros/config.h"
13-
#include <string.h>
1414

1515
namespace LIBC_NAMESPACE_DECL {
1616

0 commit comments

Comments
 (0)