[Lldb-commits] [lldb] [DRAFT] Add support for inline DWARF source files. (PR #75880)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 18 17:05:29 PST 2023
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 5f423b7d1cb3474168d79827d2305b137be7160b 638bd4e7e939ef28bf23ae2cfd1723797040b0a5 -- lldb/test/API/functionalities/inline-sourcefile/main.c lldb/include/lldb/Utility/FileSpecList.h lldb/source/Core/ModuleList.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Utility/FileSpecList.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/include/lldb/Utility/FileSpecList.h b/lldb/include/lldb/Utility/FileSpecList.h
index 078fd7208e..8eda721b60 100644
--- a/lldb/include/lldb/Utility/FileSpecList.h
+++ b/lldb/include/lldb/Utility/FileSpecList.h
@@ -30,6 +30,7 @@ struct LazyFileSpec {
class FileSpecHolder {
FileSpec m_file_spec;
std::shared_ptr<LazyFileSpec> m_lazy;
+
public:
FileSpecHolder(const FileSpec &spec, std::shared_ptr<LazyFileSpec> lazy = {})
: m_file_spec(spec), m_lazy(lazy) {}
@@ -116,9 +117,7 @@ public:
m_files.emplace_back(FileSpec(std::forward<Args>(args)...));
}
- void Append(FileSpecHolder &&fsh) {
- m_files.push_back(std::move(fsh));
- }
+ void Append(FileSpecHolder &&fsh) { m_files.push_back(std::move(fsh)); }
/// Clears the file list.
void Clear();
diff --git a/lldb/source/Utility/FileSpecList.cpp b/lldb/source/Utility/FileSpecList.cpp
index 749fdcc643..33586c7752 100644
--- a/lldb/source/Utility/FileSpecList.cpp
+++ b/lldb/source/Utility/FileSpecList.cpp
@@ -68,9 +68,9 @@ size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec,
for (size_t idx = start_idx; idx < num_files; ++idx) {
auto f = m_files[idx].GetSpecOnly();
if (compare_filename_only) {
- if (ConstString::Equals(
- f.GetFilename(), file_spec.GetFilename(),
- file_spec.IsCaseSensitive() || f.IsCaseSensitive()))
+ if (ConstString::Equals(f.GetFilename(), file_spec.GetFilename(),
+ file_spec.IsCaseSensitive() ||
+ f.IsCaseSensitive()))
return idx;
} else {
if (FileSpec::Equal(f, file_spec, full))
diff --git a/lldb/test/API/functionalities/inline-sourcefile/main.c b/lldb/test/API/functionalities/inline-sourcefile/main.c
index 29a22d956a..c030d7773f 100644
--- a/lldb/test/API/functionalities/inline-sourcefile/main.c
+++ b/lldb/test/API/functionalities/inline-sourcefile/main.c
@@ -1,8 +1,7 @@
void f();
void stop() {}
-int main(int argc, char const *argv[])
-{
- f();
- return 0;
+int main(int argc, char const *argv[]) {
+ f();
+ return 0;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/75880
More information about the lldb-commits
mailing list