mirror of
https://github.com/libAthena/athena.git
synced 2025-07-04 04:05:58 +00:00
Use llvm's optional
This commit is contained in:
parent
ee012692ba
commit
03f9314a2a
@ -1167,7 +1167,7 @@ class ATDNAAction : public clang::ASTFrontendAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR >= 9
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
std::optional<clang::DependencyFileGenerator> TheDependencyFileGenerator;
|
llvm::Optional<clang::DependencyFileGenerator> TheDependencyFileGenerator;
|
||||||
#else
|
#else
|
||||||
std::unique_ptr<clang::DependencyFileGenerator> TheDependencyFileGenerator;
|
std::unique_ptr<clang::DependencyFileGenerator> TheDependencyFileGenerator;
|
||||||
#endif
|
#endif
|
||||||
@ -1180,8 +1180,10 @@ public:
|
|||||||
DepOpts.OutputFile = DepFileOut.getValue();
|
DepOpts.OutputFile = DepFileOut.getValue();
|
||||||
DepOpts.Targets = DepFileTargets;
|
DepOpts.Targets = DepFileTargets;
|
||||||
#if LLVM_VERSION_MAJOR >= 9
|
#if LLVM_VERSION_MAJOR >= 9
|
||||||
if (!DepOpts.OutputFile.empty())
|
if (!DepOpts.OutputFile.empty()) {
|
||||||
TheDependencyFileGenerator.emplace(DepOpts).attachToPreprocessor(compiler.getPreprocessor());
|
TheDependencyFileGenerator.emplace(DepOpts);
|
||||||
|
TheDependencyFileGenerator->attachToPreprocessor(compiler.getPreprocessor());
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (!DepOpts.OutputFile.empty())
|
if (!DepOpts.OutputFile.empty())
|
||||||
TheDependencyFileGenerator.reset(
|
TheDependencyFileGenerator.reset(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user