[PATCH] D77877: [llvm][NFC] Inliner.cpp: ensure InlineHistory ID is always initialized;

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 16:42:14 PDT 2020


mtrofin marked 3 inline comments as done.
mtrofin added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:1041
+      CallBase *CS = P.first;
+      const int InlineHistoryID = P.second;
       Function &Callee = *CS->getCalledFunction();
----------------
dblaikie wrote:
> FWIW LLVM doesn't usually use top-level const like that - because it's so rare it can be mistaken for an accidental missing const /reference/
> 
> (but the change above does clarify a thing I was clearly misunderstanding in my head - I'd kept thinking for some reason that inlineHistoryIncludes might be able to modify InlineHistoryID somehow - so that InlineHistoryID's state was important in how it came out of that first " if (!IsTriviallyDead) {" - which I had completely wrong & removes the last slight hiccup I had around that variable - but I don't think marking it "const" is necessary to clarify that, I get that I was wrong now :) )
Ah, ok - I'll yank out the const on the next pass here. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77877/new/

https://reviews.llvm.org/D77877





More information about the llvm-commits mailing list