[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 15 10:34:11 PST 2024


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/72892 at github.com>


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 12e425d0cf9bca072c7b2138e50acbc5f1cd818c a9cd6375411601d60ebd5132e3c76058518ecf89 -- clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/Descriptor.cpp clang/lib/AST/Interp/Descriptor.h clang/lib/AST/Interp/Interp.cpp clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/InterpFrame.cpp clang/lib/AST/Interp/Pointer.cpp clang/lib/AST/Interp/Pointer.h clang/lib/AST/Interp/Program.cpp clang/test/AST/Interp/cxx17.cpp clang/test/AST/Interp/cxx23.cpp clang/test/AST/Interp/literals.cpp clang/unittests/AST/Interp/Descriptor.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp
index 59ed1c92f4..e1417f3a17 100644
--- a/clang/lib/AST/Interp/Interp.cpp
+++ b/clang/lib/AST/Interp/Interp.cpp
@@ -336,7 +336,7 @@ bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
   if (Ptr.isInitialized())
     return true;
 
-  const auto  *VD = cast<VarDecl>(Ptr.getDeclDesc()->asValueDecl());
+  const auto *VD = cast<VarDecl>(Ptr.getDeclDesc()->asValueDecl());
   if ((S.getLangOpts().CPlusPlus && !VD->hasConstantInitialization() &&
        VD->mightBeUsableInConstantExpressions(S.getCtx())) ||
       ((S.getLangOpts().CPlusPlus || S.getLangOpts().OpenCL) &&

``````````

</details>


https://github.com/llvm/llvm-project/pull/72892


More information about the cfe-commits mailing list