[llvm-branch-commits] [Clang] Refactor allocation type inference logic (PR #163636)
Florian Mayer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Oct 16 09:28:58 PDT 2025
================
@@ -0,0 +1,204 @@
+//===--- InferAlloc.cpp - Allocation type inference -----------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements allocation-related type inference.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/InferAlloc.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
+#include "clang/AST/Expr.h"
+#include "clang/AST/Type.h"
+#include "clang/Basic/IdentifierTable.h"
+#include "llvm/ADT/SmallPtrSet.h"
+
+namespace clang {
+namespace {
----------------
fmayer wrote:
use `static` instead:
> Because of this, we have a simple guideline: make anonymous namespaces as small as possible, and only use them for class declarations. For example:
https://llvm.org/docs/CodingStandards.html#restrict-visibility
https://github.com/llvm/llvm-project/pull/163636
More information about the llvm-branch-commits
mailing list