[PATCH] D144878: __builtin_FILE_NAME()

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 10:44:37 PST 2023


shafik added inline comments.


================
Comment at: clang/lib/AST/Expr.cpp:2283
+  case SourceLocExpr::FileName: {
+    SmallString<256> Path;
+    // builtin_FILE_NAME() is a Clang-specific extension that expands to the
----------------
It looks like a copy of the code from `ExpandBuiltinMacro` since we are already calling `processPathForFileMacro` from that same file why not factor out this code? If we can avoid code duplication we should to prevent possible future refactors only updating one copy of the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144878



More information about the cfe-commits mailing list