This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix pimpl idiom for IntrinsicProcTable.
ClosedPublic

Authored by Meinersbur on Oct 4 2020, 2:15 AM.

Details

Summary

The class IntrinsicProcTable uses the pimpl idiom and manages its own pointer-to-implementation. However, it violates the rule-of-five and does not implement a move-constructor or assignment-operator. Due to differences between compilers in implementation copy elision, these may or may not be used. Due to the missing user implementation for resource handling, using the results in runtime errors.

Fix my using std::unique_ptr instead of custom resource management.

Diff Detail

Event Timeline

Meinersbur created this revision.Oct 4 2020, 2:15 AM
Herald added a project: Restricted Project. · View Herald Transcript
Meinersbur requested review of this revision.Oct 4 2020, 2:15 AM
Meinersbur edited the summary of this revision. (Show Details)Oct 13 2020, 10:39 PM
Meinersbur edited the summary of this revision. (Show Details)

Add \#include <memory.h> to ensure std::unique_ptr is available in idioms.h

klausler accepted this revision.Oct 21 2020, 9:58 AM
klausler added inline comments.
flang/include/flang/Common/idioms.h
35

Please maintain alphabetical ordering of standard headers.

This revision is now accepted and ready to land.Oct 21 2020, 9:58 AM
  • Sort includes
This revision was automatically updated to reflect the committed changes.