Mercurial > hg > CbC > CbC_llvm
diff clang/lib/Basic/ProfileList.cpp @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
line wrap: on
line diff
--- a/clang/lib/Basic/ProfileList.cpp Wed Nov 09 17:47:54 2022 +0900 +++ b/clang/lib/Basic/ProfileList.cpp Fri Aug 18 09:04:13 2023 +0900 @@ -17,6 +17,7 @@ #include "llvm/Support/SpecialCaseList.h" #include "llvm/Support/raw_ostream.h" +#include <optional> using namespace clang; @@ -100,7 +101,7 @@ return Allow; } -llvm::Optional<ProfileList::ExclusionType> +std::optional<ProfileList::ExclusionType> ProfileList::inSection(StringRef Section, StringRef Prefix, StringRef Query) const { if (SCL->inSection(Section, Prefix, Query, "allow")) @@ -111,10 +112,10 @@ return Forbid; if (SCL->inSection(Section, Prefix, Query)) return Allow; - return None; + return std::nullopt; } -llvm::Optional<ProfileList::ExclusionType> +std::optional<ProfileList::ExclusionType> ProfileList::isFunctionExcluded(StringRef FunctionName, CodeGenOptions::ProfileInstrKind Kind) const { StringRef Section = getSectionName(Kind); @@ -125,16 +126,16 @@ return Forbid; if (SCL->inSection(Section, "fun", FunctionName)) return Allow; - return None; + return std::nullopt; } -llvm::Optional<ProfileList::ExclusionType> +std::optional<ProfileList::ExclusionType> ProfileList::isLocationExcluded(SourceLocation Loc, CodeGenOptions::ProfileInstrKind Kind) const { return isFileExcluded(SM.getFilename(SM.getFileLoc(Loc)), Kind); } -llvm::Optional<ProfileList::ExclusionType> +std::optional<ProfileList::ExclusionType> ProfileList::isFileExcluded(StringRef FileName, CodeGenOptions::ProfileInstrKind Kind) const { StringRef Section = getSectionName(Kind); @@ -145,5 +146,5 @@ return Forbid; if (SCL->inSection(Section, "src", FileName)) return Allow; - return None; + return std::nullopt; }