Remove unnecessary call to Retain() on a smart pointer

The Preprocessor smart pointer is held by the CompilerInstance,
and therefore its reference count cannot reach zero until the
CompilerInstance itself is destroyed.

If the CompilerInstance is destroyed, you have more to worry about
than just the preprocessor being deallocated!

Newer versions of the LLVM/Clang API migrated to using
std::shared_ptr, so there is no `Retain()` function (by that
name, anyway). Eliminating this redundant use is a neat and
backward-compatible way to become compatible with newer versions
of the LLVM/Clang API.
This commit is contained in:
Chris Kitching
2017-10-15 10:29:47 +01:00
parent 2975d00edc
commit 0953a7887d
-1
Vedi File
@@ -3029,7 +3029,6 @@ public:
SourceManager &SM = CI.getSourceManager();
setSourceManager(&SM);
PP.addPPCallbacks(std::unique_ptr<HipifyPPCallbacks>(this));
PP.Retain();
setPreprocessor(&PP);
return true;
}