[Basic] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
This commit is contained in:
parent
34e0d0579a
commit
eeee3fee37
|
@ -272,7 +272,7 @@ public:
|
|||
|
||||
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &
|
||||
operator=(std::nullopt_t) {
|
||||
Optional<DirectoryEntryRef>::operator=(None);
|
||||
Optional<DirectoryEntryRef>::operator=(std::nullopt);
|
||||
return *this;
|
||||
}
|
||||
OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &operator=(DirectoryEntryRef Ref) {
|
||||
|
|
|
@ -315,7 +315,7 @@ public:
|
|||
: Optional<FileEntryRef>(MaybeRef) {}
|
||||
|
||||
OptionalFileEntryRefDegradesToFileEntryPtr &operator=(std::nullopt_t) {
|
||||
Optional<FileEntryRef>::operator=(None);
|
||||
Optional<FileEntryRef>::operator=(std::nullopt);
|
||||
return *this;
|
||||
}
|
||||
OptionalFileEntryRefDegradesToFileEntryPtr &operator=(FileEntryRef Ref) {
|
||||
|
|
|
@ -179,8 +179,9 @@ public:
|
|||
mutable unsigned IsBufferInvalid : 1;
|
||||
|
||||
ContentCache()
|
||||
: OrigEntry(None), ContentsEntry(nullptr), BufferOverridden(false),
|
||||
IsFileVolatile(false), IsTransient(false), IsBufferInvalid(false) {}
|
||||
: OrigEntry(std::nullopt), ContentsEntry(nullptr),
|
||||
BufferOverridden(false), IsFileVolatile(false), IsTransient(false),
|
||||
IsBufferInvalid(false) {}
|
||||
|
||||
ContentCache(FileEntryRef Ent) : ContentCache(Ent, Ent) {}
|
||||
|
||||
|
@ -236,7 +237,7 @@ public:
|
|||
llvm::Optional<llvm::MemoryBufferRef> getBufferIfLoaded() const {
|
||||
if (Buffer)
|
||||
return Buffer->getMemBufferRef();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Return a StringRef to the source buffer data, only if it has already
|
||||
|
@ -244,7 +245,7 @@ public:
|
|||
llvm::Optional<StringRef> getBufferDataIfLoaded() const {
|
||||
if (Buffer)
|
||||
return Buffer->getBuffer();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Set the buffer.
|
||||
|
@ -1025,7 +1026,7 @@ public:
|
|||
if (auto *Entry = getSLocEntryForFile(FID))
|
||||
return Entry->getFile().getContentCache().getBufferOrNone(
|
||||
Diag, getFileManager(), Loc);
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Return the buffer for the specified FileID.
|
||||
|
@ -1050,7 +1051,7 @@ public:
|
|||
Optional<FileEntryRef> getFileEntryRefForID(FileID FID) const {
|
||||
if (auto *Entry = getSLocEntryForFile(FID))
|
||||
return Entry->getFile().getContentCache().OrigEntry;
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Returns the filename for the provided FileID, unless it's a built-in
|
||||
|
|
|
@ -956,7 +956,7 @@ public:
|
|||
/// Returns target-specific min and max values VScale_Range.
|
||||
virtual Optional<std::pair<unsigned, unsigned>>
|
||||
getVScaleRange(const LangOptions &LangOpts) const {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
/// The __builtin_clz* and __builtin_ctz* built-in
|
||||
/// functions are specified to have undefined results for zero inputs, but
|
||||
|
@ -1181,7 +1181,7 @@ public:
|
|||
/// Replace some escaped characters with another string based on
|
||||
/// target-specific rules
|
||||
virtual llvm::Optional<std::string> handleAsmEscapedChar(char C) const {
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Returns a string of target-specific clobbers, in LLVM format.
|
||||
|
@ -1199,7 +1199,9 @@ public:
|
|||
}
|
||||
|
||||
/// Returns the target ID if supported.
|
||||
virtual llvm::Optional<std::string> getTargetID() const { return llvm::None; }
|
||||
virtual llvm::Optional<std::string> getTargetID() const {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const char *getDataLayoutString() const {
|
||||
assert(!DataLayoutString.empty() && "Uninitialized DataLayout!");
|
||||
|
@ -1434,7 +1436,9 @@ public:
|
|||
|
||||
// Get the cache line size of a given cpu. This method switches over
|
||||
// the given cpu and returns "None" if the CPU is not found.
|
||||
virtual Optional<unsigned> getCPUCacheLineSize() const { return None; }
|
||||
virtual Optional<unsigned> getCPUCacheLineSize() const {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Returns maximal number of args passed in registers.
|
||||
unsigned getRegParmMax() const {
|
||||
|
@ -1651,7 +1655,7 @@ public:
|
|||
/// \returns Otherwise return None and no conversion will be emitted in the
|
||||
/// DWARF.
|
||||
virtual Optional<unsigned> getDWARFAddressSpace(unsigned AddressSpace) const {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// \returns The version of the SDK which was used during the compilation if
|
||||
|
@ -1704,7 +1708,7 @@ protected:
|
|||
virtual ArrayRef<const char *> getGCCRegNames() const = 0;
|
||||
virtual ArrayRef<GCCRegAlias> getGCCRegAliases() const = 0;
|
||||
virtual ArrayRef<AddlRegName> getGCCAddlRegNames() const {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -30,7 +30,7 @@ Optional<VersionTuple> DarwinSDKInfo::RelatedTargetVersionMapping::map(
|
|||
if (Key.getMinor())
|
||||
return map(VersionTuple(Key.getMajor()), MinimumValue, MaximumValue);
|
||||
// If this a major only key, return None for a missing entry.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Optional<DarwinSDKInfo::RelatedTargetVersionMapping>
|
||||
|
@ -45,7 +45,7 @@ DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON(
|
|||
llvm::VersionTuple KeyVersion;
|
||||
llvm::VersionTuple ValueVersion;
|
||||
if (KeyVersion.tryParse(KV.getFirst()) || ValueVersion.tryParse(*Val))
|
||||
return None;
|
||||
return std::nullopt;
|
||||
Mapping[KeyVersion.normalize()] = ValueVersion;
|
||||
if (KeyVersion < Min)
|
||||
Min = KeyVersion;
|
||||
|
@ -56,7 +56,7 @@ DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON(
|
|||
}
|
||||
}
|
||||
if (Mapping.empty())
|
||||
return None;
|
||||
return std::nullopt;
|
||||
return RelatedTargetVersionMapping(
|
||||
Min, Max, MinValue, MaximumDeploymentTarget, std::move(Mapping));
|
||||
}
|
||||
|
@ -65,10 +65,10 @@ static Optional<VersionTuple> getVersionKey(const llvm::json::Object &Obj,
|
|||
StringRef Key) {
|
||||
auto Value = Obj.getString(Key);
|
||||
if (!Value)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
VersionTuple Version;
|
||||
if (Version.tryParse(*Value))
|
||||
return None;
|
||||
return std::nullopt;
|
||||
return Version;
|
||||
}
|
||||
|
||||
|
@ -76,11 +76,11 @@ Optional<DarwinSDKInfo>
|
|||
DarwinSDKInfo::parseDarwinSDKSettingsJSON(const llvm::json::Object *Obj) {
|
||||
auto Version = getVersionKey(*Obj, "Version");
|
||||
if (!Version)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
auto MaximumDeploymentVersion =
|
||||
getVersionKey(*Obj, "MaximumDeploymentTarget");
|
||||
if (!MaximumDeploymentVersion)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
llvm::DenseMap<OSEnvPair::StorageType, Optional<RelatedTargetVersionMapping>>
|
||||
VersionMappings;
|
||||
if (const auto *VM = Obj->getObject("VersionMap")) {
|
||||
|
@ -107,7 +107,7 @@ DarwinSDKInfo::parseDarwinSDKSettingsJSON(const llvm::json::Object *Obj) {
|
|||
auto VersionMap = RelatedTargetVersionMapping::parseJSON(
|
||||
*Mapping, *MaximumDeploymentVersion);
|
||||
if (!VersionMap)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
VersionMappings[OSEnvPair::macOStoMacCatalystPair().Value] =
|
||||
std::move(VersionMap);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ DarwinSDKInfo::parseDarwinSDKSettingsJSON(const llvm::json::Object *Obj) {
|
|||
auto VersionMap = RelatedTargetVersionMapping::parseJSON(
|
||||
*Mapping, *MaximumDeploymentVersion);
|
||||
if (!VersionMap)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
VersionMappings[OSEnvPair::macCatalystToMacOSPair().Value] =
|
||||
std::move(VersionMap);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ clang::parseDarwinSDKInfo(llvm::vfs::FileSystem &VFS, StringRef SDKRootPath) {
|
|||
VFS.getBufferForFile(Filepath);
|
||||
if (!File) {
|
||||
// If the file couldn't be read, assume it just doesn't exist.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
Expected<llvm::json::Value> Result =
|
||||
llvm::json::parse(File.get()->getBuffer());
|
||||
|
|
|
@ -639,14 +639,14 @@ DiagnosticIDs::getGroupForWarningOption(StringRef Name) {
|
|||
const auto *Found = llvm::partition_point(
|
||||
OptionTable, [=](const WarningOption &O) { return O.getName() < Name; });
|
||||
if (Found == std::end(OptionTable) || Found->getName() != Name)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
return static_cast<diag::Group>(Found - OptionTable);
|
||||
}
|
||||
|
||||
llvm::Optional<diag::Group> DiagnosticIDs::getGroupForDiag(unsigned DiagID) {
|
||||
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
|
||||
return static_cast<diag::Group>(Info->getOptionGroupIndex());
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// getWarningOptionForDiag - Return the lowest-level warning option that
|
||||
|
|
|
@ -474,7 +474,7 @@ llvm::Optional<FileEntryRef> FileManager::getBypassFile(FileEntryRef VF) {
|
|||
// Stat of the file and return nullptr if it doesn't exist.
|
||||
llvm::vfs::Status Status;
|
||||
if (getStatValue(VF.getName(), Status, /*isFile=*/true, /*F=*/nullptr))
|
||||
return None;
|
||||
return std::nullopt;
|
||||
|
||||
if (!SeenBypassFileEntries)
|
||||
SeenBypassFileEntries = std::make_unique<
|
||||
|
|
|
@ -111,7 +111,7 @@ ProfileList::inSection(StringRef Section, StringRef Prefix,
|
|||
return Forbid;
|
||||
if (SCL->inSection(Section, Prefix, Query))
|
||||
return Allow;
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
llvm::Optional<ProfileList::ExclusionType>
|
||||
|
@ -125,7 +125,7 @@ ProfileList::isFunctionExcluded(StringRef FunctionName,
|
|||
return Forbid;
|
||||
if (SCL->inSection(Section, "fun", FunctionName))
|
||||
return Allow;
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
llvm::Optional<ProfileList::ExclusionType>
|
||||
|
@ -145,5 +145,5 @@ ProfileList::isFileExcluded(StringRef FileName,
|
|||
return Forbid;
|
||||
if (SCL->inSection(Section, "src", FileName))
|
||||
return Allow;
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
|
|
@ -105,11 +105,11 @@ ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM,
|
|||
// Lazily create the Buffer for ContentCaches that wrap files. If we already
|
||||
// computed it, just return what we have.
|
||||
if (IsBufferInvalid)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
if (Buffer)
|
||||
return Buffer->getMemBufferRef();
|
||||
if (!ContentsEntry)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
|
||||
// Start with the assumption that the buffer is invalid to simplify early
|
||||
// return paths.
|
||||
|
@ -131,7 +131,7 @@ ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM,
|
|||
Diag.Report(Loc, diag::err_cannot_open_file)
|
||||
<< ContentsEntry->getName() << BufferOrError.getError().message();
|
||||
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Buffer = std::move(*BufferOrError);
|
||||
|
@ -153,7 +153,7 @@ ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM,
|
|||
Diag.Report(Loc, diag::err_file_too_large)
|
||||
<< ContentsEntry->getName();
|
||||
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Unless this is a named pipe (in which case we can handle a mismatch),
|
||||
|
@ -168,7 +168,7 @@ ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM,
|
|||
Diag.Report(Loc, diag::err_file_modified)
|
||||
<< ContentsEntry->getName();
|
||||
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// If the buffer is valid, check to see if it has a UTF Byte Order Mark
|
||||
|
@ -180,7 +180,7 @@ ContentCache::getBufferOrNone(DiagnosticsEngine &Diag, FileManager &FM,
|
|||
if (InvalidBOM) {
|
||||
Diag.Report(Loc, diag::err_unsupported_bom)
|
||||
<< InvalidBOM << ContentsEntry->getName();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Buffer has been validated.
|
||||
|
@ -720,7 +720,7 @@ SourceManager::bypassFileContentsOverride(FileEntryRef File) {
|
|||
|
||||
// If the file can't be found in the FS, give up.
|
||||
if (!BypassFile)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
|
||||
(void)getOrCreateContentCache(*BypassFile);
|
||||
return BypassFile;
|
||||
|
@ -735,7 +735,7 @@ SourceManager::getNonBuiltinFilenameForID(FileID FID) const {
|
|||
if (const SrcMgr::SLocEntry *Entry = getSLocEntryForFile(FID))
|
||||
if (Entry->getFile().getContentCache().OrigEntry)
|
||||
return Entry->getFile().getName();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
|
||||
|
@ -749,7 +749,7 @@ llvm::Optional<StringRef>
|
|||
SourceManager::getBufferDataIfLoaded(FileID FID) const {
|
||||
if (const SrcMgr::SLocEntry *Entry = getSLocEntryForFile(FID))
|
||||
return Entry->getFile().getContentCache().getBufferDataIfLoaded();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
llvm::Optional<StringRef> SourceManager::getBufferDataOrNone(FileID FID) const {
|
||||
|
@ -757,7 +757,7 @@ llvm::Optional<StringRef> SourceManager::getBufferDataOrNone(FileID FID) const {
|
|||
if (auto B = Entry->getFile().getContentCache().getBufferOrNone(
|
||||
Diag, getFileManager(), SourceLocation()))
|
||||
return B->getBuffer();
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -2230,7 +2230,7 @@ LLVM_DUMP_METHOD void SourceManager::dump() const {
|
|||
DumpSLocEntry(ID, LoadedSLocEntryTable[Index], NextStart);
|
||||
NextStart = LoadedSLocEntryTable[Index].getOffset();
|
||||
} else {
|
||||
NextStart = None;
|
||||
NextStart = std::nullopt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID,
|
|||
auto Split = TargetID.split(':');
|
||||
Processor = Split.first;
|
||||
if (Processor.empty())
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
auto Features = Split.second;
|
||||
if (Features.empty())
|
||||
|
@ -88,12 +88,12 @@ parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID,
|
|||
auto Sign = Splits.first.back();
|
||||
auto Feature = Splits.first.drop_back();
|
||||
if (Sign != '+' && Sign != '-')
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
bool IsOn = Sign == '+';
|
||||
auto Loc = FeatureMap->find(Feature);
|
||||
// Each feature can only show up at most once in target ID.
|
||||
if (Loc != FeatureMap->end())
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
(*FeatureMap)[Feature] = IsOn;
|
||||
Features = Splits.second;
|
||||
}
|
||||
|
@ -107,11 +107,11 @@ parseTargetID(const llvm::Triple &T, llvm::StringRef TargetID,
|
|||
parseTargetIDWithFormatCheckingOnly(TargetID, FeatureMap);
|
||||
|
||||
if (!OptionalProcessor)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
llvm::StringRef Processor = getCanonicalProcessorName(T, *OptionalProcessor);
|
||||
if (Processor.empty())
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
llvm::SmallSet<llvm::StringRef, 4> AllFeatures;
|
||||
for (auto &&F : getAllPossibleTargetIDFeatures(T, Processor))
|
||||
|
@ -119,7 +119,7 @@ parseTargetID(const llvm::Triple &T, llvm::StringRef TargetID,
|
|||
|
||||
for (auto &&F : *FeatureMap)
|
||||
if (!AllFeatures.count(F.first()))
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
return Processor;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ getConflictTargetIDCombination(const std::set<llvm::StringRef> &TargetIDs) {
|
|||
return std::make_pair(Loc->second.TargetID, ID);
|
||||
}
|
||||
}
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool isCompatibleTargetID(llvm::StringRef Provided, llvm::StringRef Requested) {
|
||||
|
|
|
@ -506,7 +506,7 @@ AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const {
|
|||
if (hasFeature("sve"))
|
||||
return std::pair<unsigned, unsigned>(1, 16);
|
||||
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
ArrayRef<const char *> getGCCRegNames() const override;
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Accepted register names: (n, m is unsigned integer, n < m)
|
||||
|
@ -402,7 +402,7 @@ public:
|
|||
} else if (AddressSpace == Local) {
|
||||
return DWARF_Local;
|
||||
} else {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -452,7 +452,7 @@ public:
|
|||
|
||||
Optional<std::string> getTargetID() const override {
|
||||
if (!isAMDGCN(getTriple()))
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
// When -target-cpu is not set, we assume generic code that it is valid
|
||||
// for all GPU and use an empty string as target ID to represent that.
|
||||
if (GPUKind == llvm::AMDGPU::GK_NONE)
|
||||
|
|
|
@ -40,7 +40,9 @@ public:
|
|||
void getTargetDefines(const LangOptions &Opts,
|
||||
MacroBuilder &Builder) const override;
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
return TargetInfo::VoidPtrBuiltinVaList;
|
||||
|
@ -58,7 +60,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
|
|
|
@ -61,7 +61,9 @@ public:
|
|||
void getTargetDefines(const LangOptions &Opts,
|
||||
MacroBuilder &Builder) const override;
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
return TargetInfo::VoidPtrBuiltinVaList;
|
||||
|
@ -78,7 +80,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override {
|
||||
|
|
|
@ -68,7 +68,9 @@ public:
|
|||
}
|
||||
|
||||
bool isValidGCCRegisterName(StringRef Name) const override { return true; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &Info) const override {
|
||||
|
@ -85,7 +87,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool allowDebugInfoForExternalRef() const override { return true; }
|
||||
|
|
|
@ -70,11 +70,15 @@ public:
|
|||
return Feature == "directx";
|
||||
}
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const char *getClobbers() const override { return ""; }
|
||||
|
||||
ArrayRef<const char *> getGCCRegNames() const override { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const override {
|
||||
|
@ -82,7 +86,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
|
|
|
@ -78,7 +78,9 @@ public:
|
|||
return TargetInfo::VoidPtrBuiltinVaList;
|
||||
}
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const override {
|
||||
|
|
|
@ -43,10 +43,12 @@ public:
|
|||
|
||||
const char *getClobbers() const override { return ""; }
|
||||
|
||||
ArrayRef<const char *> getGCCRegNames() const override { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
|
|
|
@ -117,7 +117,7 @@ void M68kTargetInfo::getTargetDefines(const LangOptions &Opts,
|
|||
|
||||
ArrayRef<Builtin::Info> M68kTargetInfo::getTargetBuiltins() const {
|
||||
// FIXME: Implement.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool M68kTargetInfo::hasFeature(StringRef Feature) const {
|
||||
|
@ -136,7 +136,7 @@ ArrayRef<const char *> M68kTargetInfo::getGCCRegNames() const {
|
|||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> M68kTargetInfo::getGCCRegAliases() const {
|
||||
// No aliases.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool M68kTargetInfo::validateAsmConstraint(
|
||||
|
@ -209,7 +209,7 @@ M68kTargetInfo::handleAsmEscapedChar(char EscChar) const {
|
|||
C = 'd';
|
||||
break;
|
||||
default:
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return std::string(1, C);
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
// FIXME: Implement.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool allowsLargerPreferedTypeAlignment() const override { return false; }
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
// No aliases.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
|
@ -162,7 +162,7 @@ public:
|
|||
getDWARFAddressSpace(unsigned AddressSpace) const override {
|
||||
if (AddressSpace >= std::size(NVPTXDWARFAddrSpaceMap) ||
|
||||
NVPTXDWARFAddrSpaceMap[AddressSpace] < 0)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
return NVPTXDWARFAddrSpaceMap[AddressSpace];
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,12 @@
|
|||
using namespace clang;
|
||||
using namespace clang::targets;
|
||||
|
||||
ArrayRef<const char *> PNaClTargetInfo::getGCCRegNames() const { return None; }
|
||||
ArrayRef<const char *> PNaClTargetInfo::getGCCRegNames() const {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> PNaClTargetInfo::getGCCRegAliases() const {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void PNaClTargetInfo::getArchDefines(const LangOptions &Opts,
|
||||
|
|
|
@ -52,7 +52,9 @@ public:
|
|||
return Feature == "pnacl";
|
||||
}
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
return TargetInfo::PNaClABIBuiltinVaList;
|
||||
|
|
|
@ -264,7 +264,7 @@ RISCVTargetInfo::getVScaleRange(const LangOptions &LangOpts) const {
|
|||
MaxVLen / llvm::RISCV::RVVBitsPerBlock);
|
||||
}
|
||||
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Return true if has this feature, need to sync with handleTargetFeatures.
|
||||
|
@ -276,7 +276,7 @@ bool RISCVTargetInfo::hasFeature(StringRef Feature) const {
|
|||
.Case("riscv64", Is64Bit)
|
||||
.Case("32bit", !Is64Bit)
|
||||
.Case("64bit", Is64Bit)
|
||||
.Default(None);
|
||||
.Default(std::nullopt);
|
||||
if (Result)
|
||||
return Result.value();
|
||||
|
||||
|
|
|
@ -104,11 +104,15 @@ public:
|
|||
// memcpy as per section 3 of the SPIR spec.
|
||||
bool useFP16ConversionIntrinsics() const override { return false; }
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const char *getClobbers() const override { return ""; }
|
||||
|
||||
ArrayRef<const char *> getGCCRegNames() const override { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const override {
|
||||
|
@ -116,7 +120,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
// FIXME: Implement!
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
BuiltinVaListKind getBuiltinVaListKind() const override {
|
||||
return TargetInfo::VoidPtrBuiltinVaList;
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
// No aliases.
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
|
||||
|
|
|
@ -92,7 +92,9 @@ public:
|
|||
|
||||
bool hasFeature(StringRef Feature) const override { return Feature == "tce"; }
|
||||
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
|
||||
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const char *getClobbers() const override { return ""; }
|
||||
|
||||
|
@ -100,7 +102,9 @@ public:
|
|||
return TargetInfo::VoidPtrBuiltinVaList;
|
||||
}
|
||||
|
||||
ArrayRef<const char *> getGCCRegNames() const override { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const override {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
TargetInfo::ConstraintInfo &info) const override {
|
||||
|
@ -108,7 +112,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -96,10 +96,10 @@ private:
|
|||
return VoidPtrBuiltinVaList;
|
||||
}
|
||||
|
||||
ArrayRef<const char *> getGCCRegNames() const final { return None; }
|
||||
ArrayRef<const char *> getGCCRegNames() const final { return std::nullopt; }
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
|
|
|
@ -1453,7 +1453,7 @@ Optional<unsigned> X86TargetInfo::getCPUCacheLineSize() const {
|
|||
// The following currently have unknown cache line sizes (but they are probably all 64):
|
||||
// Core
|
||||
case CK_None:
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
llvm_unreachable("Unknown CPU kind");
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ public:
|
|||
ArrayRef<const char *> getGCCRegNames() const override;
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
}
|
||||
|
||||
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
bool validateAsmConstraint(const char *&Name,
|
||||
|
|
Loading…
Reference in New Issue