Page MenuHomePhabricator

[docs] Use make_unique in FrontendAction example
ClosedPublic

Authored by nicolas17 on Dec 13 2020, 1:42 PM.

Details

Summary

The code example for "RecursiveASTVisitor based ASTFrontendActions"
was using unique_ptr<X>(new X) when creating the AST consumer; change
it to use make_unique instead. The main function of the same example
already used make_unique.

Diff Detail

Event Timeline

nicolas17 requested review of this revision.Dec 13 2020, 1:42 PM
nicolas17 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2020, 1:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
thakis accepted this revision.Apr 6 2021, 11:46 AM
This revision is now accepted and ready to land.Apr 6 2021, 11:46 AM

I don't have commit access, please push this for me.

@thakis - just FYI, Phab doesn't send mail to the mailing list when a patch is approved without any text. Please include some text when approving patches to make sure there's a record on the mailing list. (@MaskRay has a browser script or the like to automate this - I forget if it's posted somewhere to link to... maybe in the llvm phab docs)

@thakis - just FYI, Phab doesn't send mail to the mailing list when a patch is approved without any text. Please include some text when approving patches to make sure there's a record on the mailing list. (@MaskRay has a browser script or the like to automate this - I forget if it's posted somewhere to link to... maybe in the llvm phab docs)

Only use in trivial approvals :)

// ==UserScript==
// @name         reviews.llvm.org: add comment "LGTM" when accepting
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://reviews.llvm.org/*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  const select = document.querySelector('.aphront-form-input > select')
  if (select)
    select.onchange = function() {
      const accept = select.querySelector('option[value=accept]')
      if (accept && accept.disabled) {
        const comment = document.querySelector('.remarkup-assist-textarea')
        if (comment && comment.value.length == 0) {
          const words = ['LGTM.', 'Thanks!', 'Looks great!']
          comment.value = words[~~(Math.random()*words.length)]+' '
          comment.focus()
        }
      }
    }
})();
This revision was landed with ongoing or failed builds.Apr 20 2021, 10:48 AM
This revision was automatically updated to reflect the committed changes.