[Lldb-commits] [lldb] 2dc1d48 - [lldb] Use static instead of anonymous namesapce in CrashReason

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 13 04:57:57 PDT 2023


Author: David Spickett
Date: 2023-03-13T11:57:04Z
New Revision: 2dc1d48a454fd511e42468e427fde49780f352fc

URL: https://github.com/llvm/llvm-project/commit/2dc1d48a454fd511e42468e427fde49780f352fc
DIFF: https://github.com/llvm/llvm-project/commit/2dc1d48a454fd511e42468e427fde49780f352fc.diff

LOG: [lldb] Use static instead of anonymous namesapce in CrashReason

As preferred by the llvm guidelines.

Added: 
    

Modified: 
    lldb/source/Plugins/Process/POSIX/CrashReason.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/POSIX/CrashReason.cpp b/lldb/source/Plugins/Process/POSIX/CrashReason.cpp
index 30fabc071af6f..31ec03c64bdeb 100644
--- a/lldb/source/Plugins/Process/POSIX/CrashReason.cpp
+++ b/lldb/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -12,17 +12,15 @@
 
 #include <sstream>
 
-namespace {
-
-void AppendFaultAddr(std::string &str, lldb::addr_t addr) {
+static void AppendFaultAddr(std::string &str, lldb::addr_t addr) {
   std::stringstream ss;
   ss << " (fault address: 0x" << std::hex << addr << ")";
   str += ss.str();
 }
 
 #if defined(si_lower) && defined(si_upper)
-void AppendBounds(std::string &str, lldb::addr_t lower_bound,
-                  lldb::addr_t upper_bound, lldb::addr_t addr) {
+static void AppendBounds(std::string &str, lldb::addr_t lower_bound,
+                         lldb::addr_t upper_bound, lldb::addr_t addr) {
   llvm::raw_string_ostream stream(str);
   if ((unsigned long)addr < lower_bound)
     stream << ": lower bound violation ";
@@ -39,7 +37,7 @@ void AppendBounds(std::string &str, lldb::addr_t lower_bound,
 }
 #endif
 
-CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
+static CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   assert(info.si_signo == SIGSEGV);
 
   switch (info.si_code) {
@@ -75,7 +73,7 @@ CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
   return CrashReason::eInvalidCrashReason;
 }
 
-CrashReason GetCrashReasonForSIGILL(const siginfo_t &info) {
+static CrashReason GetCrashReasonForSIGILL(const siginfo_t &info) {
   assert(info.si_signo == SIGILL);
 
   switch (info.si_code) {
@@ -100,7 +98,7 @@ CrashReason GetCrashReasonForSIGILL(const siginfo_t &info) {
   return CrashReason::eInvalidCrashReason;
 }
 
-CrashReason GetCrashReasonForSIGFPE(const siginfo_t &info) {
+static CrashReason GetCrashReasonForSIGFPE(const siginfo_t &info) {
   assert(info.si_signo == SIGFPE);
 
   switch (info.si_code) {
@@ -125,7 +123,7 @@ CrashReason GetCrashReasonForSIGFPE(const siginfo_t &info) {
   return CrashReason::eInvalidCrashReason;
 }
 
-CrashReason GetCrashReasonForSIGBUS(const siginfo_t &info) {
+static CrashReason GetCrashReasonForSIGBUS(const siginfo_t &info) {
   assert(info.si_signo == SIGBUS);
 
   switch (info.si_code) {
@@ -139,7 +137,6 @@ CrashReason GetCrashReasonForSIGBUS(const siginfo_t &info) {
 
   return CrashReason::eInvalidCrashReason;
 }
-}
 
 std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) {
   std::string str;


        


More information about the lldb-commits mailing list