Skip to content

Commit 4183f08

Browse files
author
Jenkins
committed
merge main into amd-staging
Change-Id: I9d951a3b304a450a1c801bcce528591c3cd37ce4
2 parents 21166d1 + f1b2865 commit 4183f08

File tree

165 files changed

+12573
-20974
lines changed

Some content is hidden

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

165 files changed

+12573
-20974
lines changed

.github/workflows/approved-prs.yml

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

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,4 +821,7 @@ def warn_android_unversioned_fallback : Warning<
821821

822822
def err_drv_triple_version_invalid : Error<
823823
"version '%0' in target triple '%1' is invalid">;
824+
825+
def err_drv_installapi_unsupported : Error<
826+
"InstallAPI is not supported for '%0'">;
824827
}

clang/include/clang/Driver/Action.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Action {
5959
PreprocessJobClass,
6060
PrecompileJobClass,
6161
ExtractAPIJobClass,
62+
InstallAPIJobClass,
6263
AnalyzeJobClass,
6364
MigrateJobClass,
6465
CompileJobClass,
@@ -450,6 +451,17 @@ class ExtractAPIJobAction : public JobAction {
450451
void addHeaderInput(Action *Input) { getInputs().push_back(Input); }
451452
};
452453

454+
class InstallAPIJobAction : public JobAction {
455+
void anchor() override;
456+
457+
public:
458+
InstallAPIJobAction(Action *Input, types::ID OutputType);
459+
460+
static bool classof(const Action *A) {
461+
return A->getKind() == InstallAPIJobClass;
462+
}
463+
};
464+
453465
class AnalyzeJobAction : public JobAction {
454466
void anchor() override;
455467

clang/include/clang/Driver/Options.td

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ class AnalyzerOpts<string base>
309309
: KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {}
310310
class MigratorOpts<string base>
311311
: KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {}
312+
class InstallAPIOpts<string base>
313+
: KeyPathAndMacro<"InstallAPIOpts.", base, "INSTALLAPI_"> {}
312314

313315
// A boolean option which is opt-in in CC1. The positive option exists in CC1 and
314316
// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
@@ -1116,7 +1118,8 @@ def config_user_dir_EQ : Joined<["--"], "config-user-dir=">,
11161118
def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>,
11171119
Visibility<[ClangOption, CLOption]>;
11181120
def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
1119-
def current__version : JoinedOrSeparate<["-"], "current_version">;
1121+
def current__version : JoinedOrSeparate<["-"], "current_version">,
1122+
Visibility<[ClangOption, CC1Option]>;
11201123
def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
11211124
HelpText<"Add directory to the C++ SYSTEM include search path">,
11221125
Visibility<[ClangOption, CC1Option]>,
@@ -1531,6 +1534,9 @@ def static_libsan : Flag<["-"], "static-libsan">,
15311534
HelpText<"Statically link the sanitizer runtime (Not supported for ASan, TSan or UBSan on darwin)">;
15321535
def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
15331536
def fasm : Flag<["-"], "fasm">, Group<f_Group>;
1537+
def installapi : Flag<["-"], "installapi">,
1538+
Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
1539+
HelpText<"Create a text-based stub file by scanning header files">;
15341540

15351541
defm assume_unique_vtables : BoolFOption<"assume-unique-vtables",
15361542
CodeGenOpts<"AssumeUniqueVTables">, DefaultTrue,
@@ -4374,7 +4380,9 @@ def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>,
43744380
Visibility<[ClangOption, CC1Option]>,
43754381
HelpText<"Load and verify that a pre-compiled header file is not stale">;
43764382
def init : Separate<["-"], "init">;
4377-
def install__name : Separate<["-"], "install_name">;
4383+
def install__name : Separate<["-"], "install_name">,
4384+
Visibility<[ClangOption, CC1Option]>,
4385+
MarshallingInfoString<InstallAPIOpts<"InstallName">>;
43784386
def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>,
43794387
Visibility<[ClangOption, CC1Option]>,
43804388
HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;

clang/include/clang/Driver/Types.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ TYPE("lto-bc", LTO_BC, INVALID, "o", phases
9797
TYPE("ast", AST, INVALID, "ast", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
9898
TYPE("ifs", IFS, INVALID, "ifs", phases::IfsMerge)
9999
TYPE("ifs-cpp", IFS_CPP, INVALID, "ifs", phases::Compile, phases::IfsMerge)
100+
TYPE("tbd", TextAPI, INVALID, "tbd", phases::Precompile)
100101
TYPE("pcm", ModuleFile, INVALID, "pcm", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
101102
TYPE("header-unit", HeaderUnit, INVALID, "pcm", phases::Compile, phases::Backend, phases::Assemble, phases::Link)
102103
TYPE("plist", Plist, INVALID, "plist", phases::Compile, phases::Backend, phases::Assemble, phases::Link)

clang/include/clang/Frontend/CompilerInstance.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@ class CompilerInstance : public ModuleLoader {
294294
return Invocation->getFrontendOpts();
295295
}
296296

297+
InstallAPIOptions &getInstallAPIOpts() {
298+
return Invocation->getInstallAPIOpts();
299+
}
300+
const InstallAPIOptions &getInstallAPIOpts() const {
301+
return Invocation->getInstallAPIOpts();
302+
}
303+
297304
HeaderSearchOptions &getHeaderSearchOpts() {
298305
return Invocation->getHeaderSearchOpts();
299306
}

clang/include/clang/Frontend/CompilerInvocation.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
#include "clang/Basic/LangStandard.h"
1919
#include "clang/Frontend/DependencyOutputOptions.h"
2020
#include "clang/Frontend/FrontendOptions.h"
21+
#include "clang/Frontend/InstallAPIOptions.h"
2122
#include "clang/Frontend/MigratorOptions.h"
2223
#include "clang/Frontend/PreprocessorOutputOptions.h"
2324
#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
24-
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2525
#include "llvm/ADT/ArrayRef.h"
26+
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2627
#include <memory>
2728
#include <string>
2829

@@ -111,6 +112,9 @@ class CompilerInvocationBase {
111112
/// Options controlling preprocessed output.
112113
std::shared_ptr<PreprocessorOutputOptions> PreprocessorOutputOpts;
113114

115+
/// Options controlling InstallAPI operations and output.
116+
std::shared_ptr<InstallAPIOptions> InstallAPIOpts;
117+
114118
/// Dummy tag type whose instance can be passed into the constructor to
115119
/// prevent creation of the reference-counted option objects.
116120
struct EmptyConstructor {};
@@ -145,6 +149,7 @@ class CompilerInvocationBase {
145149
const PreprocessorOutputOptions &getPreprocessorOutputOpts() const {
146150
return *PreprocessorOutputOpts;
147151
}
152+
const InstallAPIOptions &getInstallAPIOpts() const { return *InstallAPIOpts; }
148153
/// @}
149154

150155
/// Command line generation.
@@ -237,6 +242,7 @@ class CompilerInvocation : public CompilerInvocationBase {
237242
using CompilerInvocationBase::getFrontendOpts;
238243
using CompilerInvocationBase::getDependencyOutputOpts;
239244
using CompilerInvocationBase::getPreprocessorOutputOpts;
245+
using CompilerInvocationBase::getInstallAPIOpts;
240246
/// @}
241247

242248
/// Mutable getters.
@@ -258,6 +264,7 @@ class CompilerInvocation : public CompilerInvocationBase {
258264
PreprocessorOutputOptions &getPreprocessorOutputOpts() {
259265
return *PreprocessorOutputOpts;
260266
}
267+
InstallAPIOptions &getInstallAPIOpts() { return *InstallAPIOpts; }
261268
/// @}
262269

263270
/// Base class internals.

clang/include/clang/Frontend/FrontendActions.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ class GenerateModuleAction : public ASTFrontendAction {
130130
bool shouldEraseOutputFiles() override;
131131
};
132132

133+
class InstallAPIAction : public ASTFrontendAction {
134+
protected:
135+
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
136+
StringRef InFile) override;
137+
138+
public:
139+
static std::unique_ptr<llvm::raw_pwrite_stream>
140+
CreateOutputFile(CompilerInstance &CI, StringRef InFile);
141+
};
142+
133143
class GenerateInterfaceStubsAction : public ASTFrontendAction {
134144
protected:
135145
std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,

clang/include/clang/Frontend/FrontendOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ enum ActionKind {
100100
/// Only execute frontend initialization.
101101
InitOnly,
102102

103+
// Create TextAPI stub.
104+
InstallAPI,
105+
103106
/// Dump information about a module file.
104107
ModuleFileInfo,
105108

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===--- InstallAPIOptions.h ------------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_CLANG_FRONTEND_INSTALLAPIOPTIONS_H
10+
#define LLVM_CLANG_FRONTEND_INSTALLAPIOPTIONS_H
11+
12+
#include "llvm/TextAPI/PackedVersion.h"
13+
14+
namespace clang {
15+
16+
/// InstallAPIOptions - Options for controlling InstallAPI verification and
17+
/// TextAPI output.
18+
class InstallAPIOptions {
19+
public:
20+
/// The install name which is apart of the library's ID.
21+
std::string InstallName;
22+
23+
/// The current version which is apart of the library's ID.
24+
llvm::MachO::PackedVersion CurrentVersion;
25+
};
26+
} // namespace clang
27+
28+
#endif

0 commit comments

Comments
 (0)