mirror of https://github.com/libAthena/athena.git
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…
Reference in New Issue