[PATCH] D28757: [scudo] Eliminate the runtime dependency on libc++abi

Eric Fiselier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 02:07:47 PST 2017


EricWF added a comment.

Herald added me as a reviewer because `libc++` was in the title, but this looks OK to me.

If you want to continue stashing the results of `getCPUFeatures()` without requiring runtime guards I imagine something like this would work (At least in optimized builds):

  bool testCPUFeatures(CPUFeature Feat) {
    static CPUIDRegs FeaturesRegs = {}; // shouldn't generate a guard.
    static bool RegsInit = false; // also shouldn't generate a guard.
    if (!RegsInit) {
      FeatureRegs = getCPUFeatures();; // Not thread safe but initialization doesn't depend on libc++abi.
    }
    // ...
  }


Repository:
  rL LLVM

https://reviews.llvm.org/D28757





More information about the llvm-commits mailing list