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:
@@ -3029,7 +3029,6 @@ public:
|
||||
SourceManager &SM = CI.getSourceManager();
|
||||
setSourceManager(&SM);
|
||||
PP.addPPCallbacks(std::unique_ptr<HipifyPPCallbacks>(this));
|
||||
PP.Retain();
|
||||
setPreprocessor(&PP);
|
||||
return true;
|
||||
}
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user