Skip to content

Commit 76b167e

Browse files
authored
Merge branch 'main' into users/makslevental/checked-gettors
2 parents bcc8bca + 7ff6973 commit 76b167e

35 files changed

+318
-204
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,10 +1542,8 @@ static llvm::TargetRegionEntryInfo getEntryInfoFromPresumedLoc(
15421542
SourceManager &SM = CGM.getContext().getSourceManager();
15431543
PresumedLoc PLoc = SM.getPresumedLoc(BeginLoc);
15441544

1545-
llvm::sys::fs::UniqueID ID;
1546-
if (llvm::sys::fs::getUniqueID(PLoc.getFilename(), ID)) {
1545+
if (CGM.getFileSystem()->exists(PLoc.getFilename()))
15471546
PLoc = SM.getPresumedLoc(BeginLoc, /*UseLineDirectives=*/false);
1548-
}
15491547

15501548
return std::pair<std::string, uint64_t>(PLoc.getFilename(), PLoc.getLine());
15511549
};

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8172,12 +8172,17 @@ void CodeGenModule::printPostfixForExternalizedDecl(llvm::raw_ostream &OS,
81728172

81738173
// Get the UniqueID for the file containing the decl.
81748174
llvm::sys::fs::UniqueID ID;
8175-
if (llvm::sys::fs::getUniqueID(PLoc.getFilename(), ID)) {
8175+
auto Status = FS->status(PLoc.getFilename());
8176+
if (!Status) {
81768177
PLoc = SM.getPresumedLoc(D->getLocation(), /*UseLineDirectives=*/false);
81778178
assert(PLoc.isValid() && "Source location is expected to be valid.");
8178-
if (auto EC = llvm::sys::fs::getUniqueID(PLoc.getFilename(), ID))
8179-
SM.getDiagnostics().Report(diag::err_cannot_open_file)
8180-
<< PLoc.getFilename() << EC.message();
8179+
Status = FS->status(PLoc.getFilename());
8180+
}
8181+
if (!Status) {
8182+
SM.getDiagnostics().Report(diag::err_cannot_open_file)
8183+
<< PLoc.getFilename() << Status.getError().message();
8184+
} else {
8185+
ID = Status->getUniqueID();
81818186
}
81828187
OS << llvm::format("%x", ID.getFile()) << llvm::format("%x", ID.getDevice())
81838188
<< "_" << llvm::utohexstr(Result.low(), /*LowerCase=*/true, /*Width=*/8);

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,8 @@ OptionalFileEntryRef DirectoryLookup::DoFrameworkLookup(
672672
if (getDirCharacteristic() == SrcMgr::C_User) {
673673
SmallString<1024> SystemFrameworkMarker(FrameworkName);
674674
SystemFrameworkMarker += ".system_framework";
675-
if (llvm::sys::fs::exists(SystemFrameworkMarker)) {
675+
if (FileMgr.getOptionalFileRef(SystemFrameworkMarker))
676676
CacheEntry.IsUserSpecifiedSystemFramework = true;
677-
}
678677
}
679678
}
680679

clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void ModelInjector::onBodySynthesis(const NamedDecl *D) {
6565
else
6666
fileName = llvm::StringRef(D->getName().str() + ".model");
6767

68-
if (!llvm::sys::fs::exists(fileName.str())) {
68+
if (!CI.getVirtualFileSystem().exists(fileName)) {
6969
Bodies[D->getName()] = nullptr;
7070
return;
7171
}

compiler-rt/lib/fuzzer/FuzzerCorpus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct InputInfo {
3535
size_t Tmp = 0; // Used by ValidateFeatureSet.
3636
// Stats.
3737
size_t NumExecutedMutations = 0;
38-
size_t NumSuccessfullMutations = 0;
38+
size_t NumSuccessfulMutations = 0;
3939
bool NeverReduce = false;
4040
bool MayDeleteFile = false;
4141
bool Reduced = false;
@@ -328,7 +328,7 @@ class InputCorpus {
328328
const auto &II = *Inputs[i];
329329
Printf(" [% 3zd %s] sz: % 5zd runs: % 5zd succ: % 5zd focus: %d\n", i,
330330
Sha1ToString(II.Sha1).c_str(), II.U.size(),
331-
II.NumExecutedMutations, II.NumSuccessfullMutations,
331+
II.NumExecutedMutations, II.NumSuccessfulMutations,
332332
II.HasFocusFunction);
333333
}
334334
}

compiler-rt/lib/fuzzer/FuzzerDriver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ int AnalyzeDictionary(Fuzzer *F, const std::vector<Unit> &Dict,
609609
return 0;
610610
}
611611

612-
std::vector<std::string> ParseSeedInuts(const char *seed_inputs) {
612+
std::vector<std::string> ParseSeedInputs(const char *seed_inputs) {
613613
// Parse -seed_inputs=file1,file2,... or -seed_inputs=@seed_inputs_file
614614
std::vector<std::string> Files;
615615
if (!seed_inputs) return Files;
@@ -919,7 +919,7 @@ int FuzzerDriver(int *argc, char ***argv, UserCallback Callback) {
919919
exit(0);
920920
}
921921

922-
auto CorporaFiles = ReadCorpora(*Inputs, ParseSeedInuts(Flags.seed_inputs));
922+
auto CorporaFiles = ReadCorpora(*Inputs, ParseSeedInputs(Flags.seed_inputs));
923923
F->Loop(CorporaFiles);
924924

925925
if (Flags.verbosity)

compiler-rt/lib/fuzzer/FuzzerExtFunctionsWindows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ using namespace fuzzer;
3535
#define WIN_SYM_PREFIX
3636
#endif
3737

38-
// Declare external functions as having alternativenames, so that we can
38+
// Declare external functions as having alternative names, so that we can
3939
// determine if they are not defined.
4040
#define EXTERNAL_FUNC(Name, Default) \
4141
__pragma(comment(linker, "/alternatename:" WIN_SYM_PREFIX STRINGIFY( \

compiler-rt/lib/fuzzer/FuzzerLoop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ void Fuzzer::PrintStatusForNewUnit(const Unit &U, const char *Text) {
666666
}
667667

668668
void Fuzzer::ReportNewCoverage(InputInfo *II, const Unit &U) {
669-
II->NumSuccessfullMutations++;
669+
II->NumSuccessfulMutations++;
670670
MD.RecordSuccessfulMutationSequence();
671671
PrintStatusForNewUnit(U, II->Reduced ? "REDUCE" : "NEW ");
672672
WriteToOutputCorpus(U);

compiler-rt/lib/fuzzer/FuzzerMutate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ size_t MutationDispatcher::Mutate_CustomCrossOver(uint8_t *Data, size_t Size,
101101

102102
if (!NewSize)
103103
return 0;
104-
assert(NewSize <= MaxSize && "CustomCrossOver returned overisized unit");
104+
assert(NewSize <= MaxSize && "CustomCrossOver returned oversized unit");
105105
memcpy(Data, U.data(), NewSize);
106106
return NewSize;
107107
}
@@ -463,7 +463,7 @@ size_t MutationDispatcher::Mutate_CrossOver(uint8_t *Data, size_t Size,
463463
default: assert(0);
464464
}
465465
assert(NewSize > 0 && "CrossOver returned empty unit");
466-
assert(NewSize <= MaxSize && "CrossOver returned overisized unit");
466+
assert(NewSize <= MaxSize && "CrossOver returned oversized unit");
467467
return NewSize;
468468
}
469469

libcxx/utils/libcxx/test/format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def parseScript(test, preamble):
9292
# errors, which doesn't make sense for clang-verify tests because we may want to check
9393
# for specific warning diagnostics.
9494
_checkBaseSubstitutions(substitutions)
95+
substitutions.append(("%T", tmpDir))
9596
substitutions.append(
9697
("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe")
9798
)

0 commit comments

Comments
 (0)