Skip to content

Commit 828bf13

Browse files
authored
[InstallAPI] Cleanup HeaderFile Interface & options handling, NFC (#82544)
1 parent be36812 commit 828bf13

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

clang/include/clang/InstallAPI/HeaderFile.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
namespace clang::installapi {
2323
enum class HeaderType {
24+
/// Unset or unknown type.
25+
Unknown,
2426
/// Represents declarations accessible to all clients.
2527
Public,
2628
/// Represents declarations accessible to a disclosed set of clients.
@@ -41,6 +43,7 @@ class HeaderFile {
4143
std::optional<clang::Language> Language;
4244

4345
public:
46+
HeaderFile() = delete;
4447
HeaderFile(StringRef FullPath, HeaderType Type,
4548
StringRef IncludeName = StringRef(),
4649
std::optional<clang::Language> Language = std::nullopt)

clang/tools/clang-installapi/Options.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@ namespace installapi {
2222

2323
bool Options::processDriverOptions(InputArgList &Args) {
2424
// Handle inputs.
25-
llvm::vfs::Status Stat;
26-
for (const auto &Path : Args.getAllArgValues(OPT_INPUT)) {
27-
if (FM->getNoncachedStatValue(Path, Stat) || !Stat.exists()) {
28-
Diags->Report(clang::diag::err_drv_no_such_file) << Path;
29-
return false;
30-
}
31-
DriverOpts.FileLists.push_back(std::move(Path));
32-
}
25+
llvm::append_range(DriverOpts.FileLists, Args.getAllArgValues(OPT_INPUT));
3326

3427
// Handle output.
3528
SmallString<PATH_MAX> OutputPath;
@@ -61,8 +54,9 @@ bool Options::processDriverOptions(InputArgList &Args) {
6154

6255
// Capture target triples first.
6356
if (ArgTarget) {
64-
for (auto *Arg : Args.filtered(OPT_target)) {
65-
llvm::Triple TargetTriple(Arg->getValue());
57+
for (const Arg *A : Args.filtered(OPT_target)) {
58+
A->claim();
59+
llvm::Triple TargetTriple(A->getValue());
6660
Target TAPITarget = Target(TargetTriple);
6761
if ((TAPITarget.Arch == AK_unknown) ||
6862
(TAPITarget.Platform == PLATFORM_UNKNOWN)) {

0 commit comments

Comments
 (0)