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.


[ROCm/hip commit: 0953a7887d]
Tento commit je obsažen v:
Chris Kitching
2017-10-15 10:29:47 +01:00
rodič 316faf5fc7
revize 459b78e997
-1
Zobrazit soubor
@@ -3029,7 +3029,6 @@ public:
SourceManager &SM = CI.getSourceManager();
setSourceManager(&SM);
PP.addPPCallbacks(std::unique_ptr<HipifyPPCallbacks>(this));
PP.Retain();
setPreprocessor(&PP);
return true;
}