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 origin/main HEAD --extensions c,cpp,h -- 
clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPDirectives.cpp 
clang/lib/Lex/PPMacroExpansion.cpp clang/test/Preprocessor/embed_dependencies.c 
clang/unittests/Lex/PPDependencyDirectivesTest.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 50611e4c0..8d4c9c49f 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -4124,7 +4124,7 @@ void Preprocessor::HandleEmbedDirective(SourceLocation 
HashLoc,
     return;
 
   OptionalFileEntryRef MaybeFileRef =
-      this->LookupEmbedFile(Filename, isAngled, /*OpenFile=*/ true);
+      this->LookupEmbedFile(Filename, isAngled, /*OpenFile=*/true);
   if (!MaybeFileRef) {
     // could not find file
     if (Callbacks && Callbacks->EmbedFileNotFound(Filename)) {
diff --git a/clang/unittests/Lex/PPDependencyDirectivesTest.cpp 
b/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
index 0e12e4765..6beb66d1a 100644
--- a/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
+++ b/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
@@ -182,30 +182,27 @@ TEST_F(PPDependencyDirectivesTest, MacroGuard) {
   EXPECT_EQ(IncludedFilesSlash, ExpectedIncludes);
 }
 
-
 TEST_F(PPDependencyDirectivesTest, Embed) {
   auto VFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
   VFS->setCurrentWorkingDirectory("/source");
-  VFS->addFile("/source/inputs/jk.txt", 0, 
llvm::MemoryBuffer::getMemBuffer("jk"));
-  VFS->addFile(
-      "/source/inputs/single_byte.txt", 0,
-      llvm::MemoryBuffer::getMemBuffer("a"));
-  VFS->addFile(
-      "/source/inputs/single_byte1.txt", 0,
-      llvm::MemoryBuffer::getMemBuffer("b"));
+  VFS->addFile("/source/inputs/jk.txt", 0,
+               llvm::MemoryBuffer::getMemBuffer("jk"));
+  VFS->addFile("/source/inputs/single_byte.txt", 0,
+               llvm::MemoryBuffer::getMemBuffer("a"));
+  VFS->addFile("/source/inputs/single_byte1.txt", 0,
+               llvm::MemoryBuffer::getMemBuffer("b"));
   VFS->addFile(
       "/source/inc/head.h", 0,
       llvm::MemoryBuffer::getMemBuffer("#embed \"inputs/single_byte.txt\"\n"
                                        "extern int foo;\n"));
-  VFS->addFile("main.c", 0,
-               llvm::MemoryBuffer::getMemBuffer(
-                   "#include \"inc/head.h\"\n"
-                   "#if __has_embed(\"inputs/jk.txt\")\n"
-                   "const char arr[] =\n"
-                   "#embed \"inputs/single_byte1.txt\"\n"
-                   ";\n"
-                   "#endif\n"
-                   ));
+  VFS->addFile(
+      "main.c", 0,
+      llvm::MemoryBuffer::getMemBuffer("#include \"inc/head.h\"\n"
+                                       "#if __has_embed(\"inputs/jk.txt\")\n"
+                                       "const char arr[] =\n"
+                                       "#embed \"inputs/single_byte1.txt\"\n"
+                                       ";\n"
+                                       "#endif\n"));
   FileMgr.setVirtualFileSystem(VFS);
 
   OptionalFileEntryRef FE;
@@ -227,7 +224,6 @@ TEST_F(PPDependencyDirectivesTest, Embed) {
   PP.EnterMainSourceFile();
   PP.LexTokensUntilEOF();
 
-
   SmallVector<StringRef> ExpectedEmbeds{
       "inputs/single_byte.txt",
       "inputs/jk.txt",

``````````

</details>


https://github.com/llvm/llvm-project/pull/178001
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to