This is an archive of the discontinued LLVM Phabricator instance.

Make an RAII initializer for COM on Windows
ClosedPublic

Authored by zturner on Apr 24 2015, 2:38 PM.

Details

Summary

Patch should be fairly self-explanatory. Implementation is empty on non-Windows platforms, and on Windows platforms simply calls CoInitializeEx and CoUninitialize.

Diff Detail

Event Timeline

zturner updated this revision to Diff 24416.Apr 24 2015, 2:38 PM
zturner retitled this revision from to Make an RAII initializer for COM on Windows.
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added reviewers: aaron.ballman, compnerd.
zturner added a subscriber: Unknown Object (MLST).

Might be nice to have 'RAII' in the class name.

Might be nice to have 'RAII' in the class name.

Do we do that for any other types of these classes? For example, there's llvm_shutdown_obj, scoped_ptr? I don't feel too strongly either way, but if this is a desirable naming convention then we shoudl think about formalizing it.

Might be nice to have 'RAII' in the class name.

Do we do that for any other types of these classes? For example, there's llvm_shutdown_obj, scoped_ptr? I don't feel too strongly either way, but if this is a desirable naming convention then we shoudl think about formalizing it.

Sure: NewQueueRAII, TemplateParameterDepthRAII, ContextRAII, FPContractStateRAII, CompoundScopeRAII, CXXThisScopeRAII, ArgumentPackSubstitutionIndexRAII, etc.

This revision was automatically updated to reflect the committed changes.