Charusso added a comment.

In D69731#1730784 <https://reviews.llvm.org/D69731#1730784>, @NoQ wrote:

> I'm not sure though - because we somehow survived without this for like 10 
> years. Eg. `BugReporterVisitors.cpp`: [...]
>  I'd love to see some actual use before committing.


"Teaser":

  const Preprocessor &PP = C.getPreprocessor();
  Optional<bool> WantSafeFunctions;
    
  if (PP.isMacroDefined("__STDC_LIB_EXT1__")) {
    MacroDefinition MD = PP.getMacroDefinition("__STDC_WANT_LIB_EXT1__");
    if (const MacroInfo *MI = MD.getMacroInfo()) {
      const Token &T = MI->tokens().back();
      StringRef ValueStr = StringRef(T.getLiteralData(), T.getLength());
      llvm::APInt IntValue;
      ValueStr.getAsInteger(10, IntValue);
      WantSafeFunctions = IntValue.getZExtValue();
    }
  }


Repository:
  rC Clang

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

https://reviews.llvm.org/D69731



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to