|
31 | 31 | #include <cstddef> |
32 | 32 | #include <iterator> |
33 | 33 | #include <memory> |
| 34 | +#include <optional> |
34 | 35 | #include <string> |
35 | 36 |
|
36 | 37 | namespace llvm { |
@@ -167,7 +168,7 @@ class Target { |
167 | 168 | using TargetMachineCtorTy = TargetMachine |
168 | 169 | *(*)(const Target &T, const Triple &TT, StringRef CPU, StringRef Features, |
169 | 170 | const TargetOptions &Options, Optional<Reloc::Model> RM, |
170 | | - Optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT); |
| 171 | + std::optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT); |
171 | 172 | // If it weren't for layering issues (this header is in llvm/Support, but |
172 | 173 | // depends on MC?) this should take the Streamer by value rather than rvalue |
173 | 174 | // reference. |
@@ -481,7 +482,7 @@ class Target { |
481 | 482 | TargetMachine * |
482 | 483 | createTargetMachine(StringRef TT, StringRef CPU, StringRef Features, |
483 | 484 | const TargetOptions &Options, Optional<Reloc::Model> RM, |
484 | | - Optional<CodeModel::Model> CM = std::nullopt, |
| 485 | + std::optional<CodeModel::Model> CM = std::nullopt, |
485 | 486 | CodeGenOpt::Level OL = CodeGenOpt::Default, |
486 | 487 | bool JIT = false) const { |
487 | 488 | if (!TargetMachineCtorFn) |
@@ -1358,10 +1359,12 @@ template <class TargetMachineImpl> struct RegisterTargetMachine { |
1358 | 1359 | } |
1359 | 1360 |
|
1360 | 1361 | private: |
1361 | | - static TargetMachine * |
1362 | | - Allocator(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, |
1363 | | - const TargetOptions &Options, Optional<Reloc::Model> RM, |
1364 | | - Optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT) { |
| 1362 | + static TargetMachine *Allocator(const Target &T, const Triple &TT, |
| 1363 | + StringRef CPU, StringRef FS, |
| 1364 | + const TargetOptions &Options, |
| 1365 | + Optional<Reloc::Model> RM, |
| 1366 | + std::optional<CodeModel::Model> CM, |
| 1367 | + CodeGenOpt::Level OL, bool JIT) { |
1365 | 1368 | return new TargetMachineImpl(T, TT, CPU, FS, Options, RM, CM, OL, JIT); |
1366 | 1369 | } |
1367 | 1370 | }; |
|
0 commit comments