diff options
Diffstat (limited to 'gcc/rust/util/rust-hir-map.cc')
-rw-r--r-- | gcc/rust/util/rust-hir-map.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc index 05b26d6..8b09d9d 100644 --- a/gcc/rust/util/rust-hir-map.cc +++ b/gcc/rust/util/rust-hir-map.cc @@ -110,14 +110,11 @@ Mappings::Mappings () Mappings::~Mappings () { delete builtinMarker; } -Mappings * +Mappings & Mappings::get () { - static std::unique_ptr<Mappings> instance; - if (!instance) - instance = std::unique_ptr<Mappings> (new Mappings ()); - - return instance.get (); + static Mappings instance{}; + return instance; } CrateNum |