Skip to content

Commit 00b49e1

Browse files
tclin914vitalybuka
authored andcommitted
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
2 parents 6cc2abc + b45225f commit 00b49e1

File tree

119 files changed

+3420
-3067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3420
-3067
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,14 @@ def err_drv_print_header_env_var : Error<
396396
"environment variable CC_PRINT_HEADERS_%select{FORMAT|FILTERING}0 has invalid value %1">;
397397
def err_drv_print_header_env_var_combination : Error<
398398
"unsupported combination: CC_PRINT_HEADERS_FORMAT=%0 and CC_PRINT_HEADERS_FILTERING=%1">;
399-
def err_drv_print_header_env_var_combination_cc1 : Error<
399+
def err_drv_print_header_env_var_invalid_format : Error<
400+
"environment variable CC_PRINT_HEADERS_FORMAT=%0 requires a compatible value for CC_PRINT_HEADERS_FILTERING">;
401+
def err_drv_print_header_cc1_invalid_combination : Error<
400402
"unsupported combination: -header-include-format=%0 and -header-include-filtering=%1">;
403+
def err_drv_print_header_cc1_invalid_filtering : Error<
404+
"-header-include-filtering=%0 requires a compatible value for -header-include-format">;
405+
def err_drv_print_header_cc1_invalid_format : Error<
406+
"-header-include-format=%0 requires a compatible value for -header-include-filtering">;
401407

402408
def warn_O4_is_O3 : Warning<"-O4 is equivalent to -O3">, InGroup<Deprecated>;
403409
def warn_drv_optimization_value : Warning<"optimization level '%0' is not supported; using '%1%2' instead">,

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,17 +2018,8 @@ CGDebugInfo::getOrCreateMethodType(const CXXMethodDecl *Method,
20182018
return getOrCreateInstanceMethodType(ThisType, Func, Unit);
20192019
}
20202020

2021-
llvm::DISubroutineType *CGDebugInfo::getOrCreateMethodTypeForDestructor(
2022-
const CXXMethodDecl *Method, llvm::DIFile *Unit, QualType FNType) {
2023-
const FunctionProtoType *Func = FNType->getAs<FunctionProtoType>();
2024-
// skip the first param since it is also this
2025-
return getOrCreateInstanceMethodType(Method->getThisType(), Func, Unit, true);
2026-
}
2027-
2028-
llvm::DISubroutineType *
2029-
CGDebugInfo::getOrCreateInstanceMethodType(QualType ThisPtr,
2030-
const FunctionProtoType *Func,
2031-
llvm::DIFile *Unit, bool SkipFirst) {
2021+
llvm::DISubroutineType *CGDebugInfo::getOrCreateInstanceMethodType(
2022+
QualType ThisPtr, const FunctionProtoType *Func, llvm::DIFile *Unit) {
20322023
FunctionProtoType::ExtProtoInfo EPI = Func->getExtProtoInfo();
20332024
Qualifiers &Qc = EPI.TypeQuals;
20342025
Qc.removeConst();
@@ -2068,7 +2059,7 @@ CGDebugInfo::getOrCreateInstanceMethodType(QualType ThisPtr,
20682059
}
20692060

20702061
// Copy rest of the arguments.
2071-
for (unsigned i = (SkipFirst ? 2 : 1), e = Args.size(); i != e; ++i)
2062+
for (unsigned i = 1, e = Args.size(); i != e; ++i)
20722063
Elts.push_back(Args[i]);
20732064

20742065
// Attach FlagObjectPointer to the explicit "this" parameter.
@@ -4381,12 +4372,6 @@ llvm::DISubroutineType *CGDebugInfo::getOrCreateFunctionType(const Decl *D,
43814372
// subprogram DIE will miss DW_AT_decl_file and DW_AT_decl_line fields.
43824373
return DBuilder.createSubroutineType(DBuilder.getOrCreateTypeArray({}));
43834374

4384-
if (const auto *Method = dyn_cast<CXXDestructorDecl>(D)) {
4385-
// Read method type from 'FnType' because 'D.getType()' does not cover
4386-
// implicit arguments for destructors.
4387-
return getOrCreateMethodTypeForDestructor(Method, F, FnType);
4388-
}
4389-
43904375
if (const auto *Method = dyn_cast<CXXMethodDecl>(D))
43914376
return getOrCreateMethodType(Method, F);
43924377

clang/lib/CodeGen/CGDebugInfo.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,9 @@ class CGDebugInfo {
249249
/// to get a method type which includes \c this pointer.
250250
llvm::DISubroutineType *getOrCreateMethodType(const CXXMethodDecl *Method,
251251
llvm::DIFile *F);
252-
253-
llvm::DISubroutineType *
254-
getOrCreateMethodTypeForDestructor(const CXXMethodDecl *Method,
255-
llvm::DIFile *F, QualType FNType);
256-
257252
llvm::DISubroutineType *
258253
getOrCreateInstanceMethodType(QualType ThisPtr, const FunctionProtoType *Func,
259-
llvm::DIFile *Unit, bool SkipFirst = false);
254+
llvm::DIFile *Unit);
260255
llvm::DISubroutineType *
261256
getOrCreateFunctionType(const Decl *D, QualType FnType, llvm::DIFile *F);
262257
/// \return debug info descriptor for vtable.

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,13 +2435,25 @@ static bool ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
24352435

24362436
// Check for invalid combinations of header-include-format
24372437
// and header-include-filtering.
2438-
if ((Opts.HeaderIncludeFormat == HIFMT_Textual &&
2439-
Opts.HeaderIncludeFiltering != HIFIL_None) ||
2440-
(Opts.HeaderIncludeFormat == HIFMT_JSON &&
2441-
Opts.HeaderIncludeFiltering != HIFIL_Only_Direct_System))
2442-
Diags.Report(diag::err_drv_print_header_env_var_combination_cc1)
2443-
<< Args.getLastArg(OPT_header_include_format_EQ)->getValue()
2444-
<< Args.getLastArg(OPT_header_include_filtering_EQ)->getValue();
2438+
if (Opts.HeaderIncludeFormat == HIFMT_Textual &&
2439+
Opts.HeaderIncludeFiltering != HIFIL_None) {
2440+
if (Args.hasArg(OPT_header_include_format_EQ))
2441+
Diags.Report(diag::err_drv_print_header_cc1_invalid_combination)
2442+
<< headerIncludeFormatKindToString(Opts.HeaderIncludeFormat)
2443+
<< headerIncludeFilteringKindToString(Opts.HeaderIncludeFiltering);
2444+
else
2445+
Diags.Report(diag::err_drv_print_header_cc1_invalid_filtering)
2446+
<< headerIncludeFilteringKindToString(Opts.HeaderIncludeFiltering);
2447+
} else if (Opts.HeaderIncludeFormat == HIFMT_JSON &&
2448+
Opts.HeaderIncludeFiltering == HIFIL_None) {
2449+
if (Args.hasArg(OPT_header_include_filtering_EQ))
2450+
Diags.Report(diag::err_drv_print_header_cc1_invalid_combination)
2451+
<< headerIncludeFormatKindToString(Opts.HeaderIncludeFormat)
2452+
<< headerIncludeFilteringKindToString(Opts.HeaderIncludeFiltering);
2453+
else
2454+
Diags.Report(diag::err_drv_print_header_cc1_invalid_format)
2455+
<< headerIncludeFormatKindToString(Opts.HeaderIncludeFormat);
2456+
}
24452457

24462458
return Diags.getNumErrors() == NumErrorsBefore;
24472459
}

clang/test/CodeGenCXX/debug-info-dtor-implicit-args.cpp

Lines changed: 0 additions & 24 deletions
This file was deleted.

clang/test/Preprocessor/print-header-json.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
// RUN: %clang_cc1 -E -header-include-format=json -header-include-filtering=only-direct-system -header-include-file %t.txt -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s
22
// RUN: cat %t.txt | FileCheck %s --check-prefix=SUPPORTED
3+
34
// RUN: not %clang_cc1 -E -header-include-format=textual -header-include-filtering=only-direct-system -header-include-file %t.txt -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED0
45
// RUN: not %clang_cc1 -E -header-include-format=json -header-include-filtering=none -header-include-file %t.txt -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED1
5-
// RUN: rm %t.txt
6-
// RUN: env CC_PRINT_HEADERS_FORMAT=json CC_PRINT_HEADERS_FILTERING=only-direct-system CC_PRINT_HEADERS_FILE=%t.txt %clang -fsyntax-only -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null
76
// RUN: env CC_PRINT_HEADERS_FORMAT=textual CC_PRINT_HEADERS_FILTERING=only-direct-system CC_PRINT_HEADERS_FILE=%t.txt not %clang -fsyntax-only -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED2
87
// RUN: env CC_PRINT_HEADERS_FORMAT=json CC_PRINT_HEADERS_FILTERING=none CC_PRINT_HEADERS_FILE=%t.txt not %clang -fsyntax-only -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED3
8+
// RUN: env CC_PRINT_HEADERS_FORMAT=json CC_PRINT_HEADERS_FILE=%t.txt not %clang -fsyntax-only -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED4
9+
// RUN: not %clang_cc1 -E -header-include-filtering=only-direct-system -header-include-file %t.txt -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED5
10+
// RUN: not %clang_cc1 -E -header-include-format=json -header-include-file %t.txt -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED6
11+
12+
// RUN: rm %t.txt
13+
// RUN: env CC_PRINT_HEADERS_FORMAT=json CC_PRINT_HEADERS_FILTERING=only-direct-system CC_PRINT_HEADERS_FILE=%t.txt %clang -fsyntax-only -I %S/Inputs/print-header-json -isystem %S/Inputs/print-header-json/system %s -o /dev/null
914
// RUN: cat %t.txt | FileCheck %s --check-prefix=SUPPORTED
1015

1116
#include "system0.h"
@@ -18,3 +23,6 @@
1823
// UNSUPPORTED1: error: unsupported combination: -header-include-format=json and -header-include-filtering=none
1924
// UNSUPPORTED2: error: unsupported combination: CC_PRINT_HEADERS_FORMAT=textual and CC_PRINT_HEADERS_FILTERING=only-direct-system
2025
// UNSUPPORTED3: error: unsupported combination: CC_PRINT_HEADERS_FORMAT=json and CC_PRINT_HEADERS_FILTERING=none
26+
// UNSUPPORTED4: error: environment variable CC_PRINT_HEADERS_FORMAT=json requires a compatible value for CC_PRINT_HEADERS_FILTERING
27+
// UNSUPPORTED5: error: -header-include-filtering=only-direct-system requires a compatible value for -header-include-format
28+
// UNSUPPORTED6: error: -header-include-format=json requires a compatible value for -header-include-filtering

clang/tools/driver/driver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ static bool SetBackdoorDriverOutputsFromEnvVars(Driver &TheDriver) {
156156
}
157157

158158
const char *FilteringStr = ::getenv("CC_PRINT_HEADERS_FILTERING");
159+
if (!FilteringStr) {
160+
TheDriver.Diag(clang::diag::err_drv_print_header_env_var_invalid_format)
161+
<< EnvVar;
162+
return false;
163+
}
159164
HeaderIncludeFilteringKind Filtering;
160165
if (!stringToHeaderIncludeFiltering(FilteringStr, Filtering)) {
161166
TheDriver.Diag(clang::diag::err_drv_print_header_env_var)

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,6 @@ if(LLVM_LIBC_FULL_BUILD)
10491049
# setjmp.h entrypoints
10501050
libc.src.setjmp.longjmp
10511051
libc.src.setjmp.setjmp
1052-
libc.src.setjmp.siglongjmp
1053-
libc.src.setjmp.sigsetjmp
10541052

10551053
# stdio.h entrypoints
10561054
libc.src.stdio.clearerr

libc/hdr/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,5 @@ add_proxy_header_library(
223223
libc.include.wchar
224224
)
225225

226-
# offsetof is a macro inside compiler resource header stddef.h
227-
add_proxy_header_library(
228-
offsetof_macros
229-
HDRS
230-
offsetof_macros.h
231-
FULL_BUILD_DEPENDS
232-
libc.include.llvm-libc-macros.offsetof_macro
233-
)
234-
235226
add_subdirectory(types)
236227
add_subdirectory(func)

libc/hdr/offsetof_macros.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)