[PATCH] D61881: Deal with return-twice function such as vfork, setjmp when CET-IBT enabled

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 19:25:30 PDT 2019


MaskRay added inline comments.


================
Comment at: lib/Target/X86/X86IndirectBranchTracking.cpp:73
+bool X86IndirectBranchTrackingPass::addENDBR(MachineBasicBlock &MBB,
+                                          MachineBasicBlock::iterator I) const {
   assert(TII && "Target instruction info was not initialized");
----------------
xiangzhangllvm wrote:
> MaskRay wrote:
> > indent with clang-format.
> Hi! Fang rui, Nice to see you here!
> It will more than 80 chars if I aligned the "Machine..", Is it suitable to write like this: ?
> 
> ```
> bool
> X86IndirectBranchTrackingPass::addENDBR(MachineBasicBlock &MBB,
>                                         MachineBasicBlock::iterator I) const {
> ```
You may use clang-format (`git diff -U0 --no-color 'HEAD^' | ~/llvm/tools/clang/tools/clang-format/clang-format-diff.py -i -p1`). It reformats this block as:

```
bool X86IndirectBranchTrackingPass::addENDBR(
    MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const {
```


================
Comment at: lib/Target/X86/X86IndirectBranchTracking.cpp:79
+    if (EndbrOpcode != I->getOpcode()) {
+      I++;
+      BuildMI(MBB, I, MBB.findDebugLoc(I), TII->get(EndbrOpcode));
----------------
xiangzhangllvm wrote:
> MaskRay wrote:
> > `++I;`
> It seems same with ++I ? More performance ?
Its https://llvm.org/docs/CodingStandards.html#prefer-preincrement


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61881





More information about the llvm-commits mailing list