[Lldb-commits] [PATCH] D157538: [lldb][NFCI] Remove use of ifdef __cpluplus where unneeded

2023-08-10 Thread Alex Langford via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd21ec35dcf3c: [lldb][NFCI] Remove use of ifdef __cpluplus 
where unneeded (authored by bulbazord).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157538/new/

https://reviews.llvm.org/D157538

Files:
  lldb/include/lldb/Core/Mangled.h
  lldb/include/lldb/Host/Editline.h
  lldb/include/lldb/Host/Terminal.h
  lldb/include/lldb/Host/posix/PipePosix.h
  lldb/include/lldb/Utility/DataBuffer.h
  lldb/include/lldb/Utility/DataEncoder.h
  lldb/include/lldb/lldb-forward.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/include/lldb/lldb-private-types.h
  lldb/include/lldb/lldb-private.h
  lldb/source/Host/macosx/cfcpp/CFCReleaser.h
  lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
  lldb/tools/debugserver/source/DNBLog.h
  lldb/tools/debugserver/source/DNBRegisterInfo.h
  lldb/tools/debugserver/source/MacOSX/CFUtils.h

Index: lldb/tools/debugserver/source/MacOSX/CFUtils.h
===
--- lldb/tools/debugserver/source/MacOSX/CFUtils.h
+++ lldb/tools/debugserver/source/MacOSX/CFUtils.h
@@ -15,8 +15,6 @@
 
 #include 
 
-#ifdef __cplusplus
-
 // Templatized CF helper class that can own any CF pointer and will
 // call CFRelease() on any valid pointer it owns unless that pointer is
 // explicitly released using the release() member function.
@@ -71,5 +69,4 @@
   element_type _ptr;
 };
 
-#endif // #ifdef __cplusplus
 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_CFUTILS_H
Index: lldb/tools/debugserver/source/DNBRegisterInfo.h
===
--- lldb/tools/debugserver/source/DNBRegisterInfo.h
+++ lldb/tools/debugserver/source/DNBRegisterInfo.h
@@ -18,12 +18,10 @@
 #include 
 
 struct DNBRegisterValueClass : public DNBRegisterValue {
-#ifdef __cplusplus
   DNBRegisterValueClass(const DNBRegisterInfo *regInfo = NULL);
   void Clear();
   void Dump(const char *pre, const char *post) const;
   bool IsValid() const;
-#endif
 };
 
 #endif
Index: lldb/tools/debugserver/source/DNBLog.h
===
--- lldb/tools/debugserver/source/DNBLog.h
+++ lldb/tools/debugserver/source/DNBLog.h
@@ -17,9 +17,7 @@
 #include 
 #include 
 
-#ifdef __cplusplus
 extern "C" {
-#endif
 
 // Flags that get filled in automatically before calling the log callback
 // function
@@ -144,9 +142,6 @@
 #define DNBLogCloseLogFile() ((void)0)
 
 #endif // #else defined(DNBLOG_ENABLED)
-
-#ifdef __cplusplus
 }
-#endif
 
 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBLOG_H
Index: lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
===
--- lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
+++ lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
@@ -31,9 +31,7 @@
 static dispatch_once_t pred;
 dispatch_once(, ^{
   responsibility_spawnattrs_setdisclaim_ptr =
-#ifdef __cplusplus
   reinterpret_cast<__typeof__(_spawnattrs_setdisclaim)>
-#endif
   (dlsym(RTLD_DEFAULT, "responsibility_spawnattrs_setdisclaim"));
 });
 if (responsibility_spawnattrs_setdisclaim_ptr)
Index: lldb/source/Host/macosx/cfcpp/CFCReleaser.h
===
--- lldb/source/Host/macosx/cfcpp/CFCReleaser.h
+++ lldb/source/Host/macosx/cfcpp/CFCReleaser.h
@@ -11,8 +11,6 @@
 
 #include 
 
-#ifdef __cplusplus
-
 #include 
 
 // Templatized CF helper class that can own any CF pointer and will
@@ -105,5 +103,4 @@
   T _ptr;
 };
 
-#endif // #ifdef __cplusplus
 #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCRELEASER_H
Index: lldb/include/lldb/lldb-private.h
===
--- lldb/include/lldb/lldb-private.h
+++ lldb/include/lldb/lldb-private.h
@@ -9,13 +9,9 @@
 #ifndef LLDB_LLDB_PRIVATE_H
 #define LLDB_LLDB_PRIVATE_H
 
-#if defined(__cplusplus)
-
 #include "lldb/lldb-private-enumerations.h"
 #include "lldb/lldb-private-interfaces.h"
 #include "lldb/lldb-private-types.h"
 #include "lldb/lldb-public.h"
 
-#endif // defined(__cplusplus)
-
 #endif // LLDB_LLDB_PRIVATE_H
Index: lldb/include/lldb/lldb-private-types.h
===
--- lldb/include/lldb/lldb-private-types.h
+++ lldb/include/lldb/lldb-private-types.h
@@ -9,8 +9,6 @@
 #ifndef LLDB_LLDB_PRIVATE_TYPES_H
 #define LLDB_LLDB_PRIVATE_TYPES_H
 
-#if defined(__cplusplus)
-
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
@@ -125,6 +123,4 @@
 void *baton, const char **argv, lldb_private::CommandReturnObject );
 } // namespace lldb_private
 
-#endif // #if defined(__cplusplus)
-
 #endif // LLDB_LLDB_PRIVATE_TYPES_H
Index: lldb/include/lldb/lldb-private-interfaces.h
===
--- 

[Lldb-commits] [PATCH] D157538: [lldb][NFCI] Remove use of ifdef __cpluplus where unneeded

2023-08-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157538/new/

https://reviews.llvm.org/D157538

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D157538: [lldb][NFCI] Remove use of ifdef __cpluplus where unneeded

2023-08-09 Thread Alex Langford via Phabricator via lldb-commits
bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, jasonmolenda, jingham.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Just about every file in the lldb project is built with C++ enabled.
Unless I've missed something, these macro guards don't really accomplish
very much.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157538

Files:
  lldb/include/lldb/Core/Mangled.h
  lldb/include/lldb/Host/Editline.h
  lldb/include/lldb/Host/Terminal.h
  lldb/include/lldb/Host/posix/PipePosix.h
  lldb/include/lldb/Utility/DataBuffer.h
  lldb/include/lldb/Utility/DataEncoder.h
  lldb/include/lldb/lldb-forward.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/include/lldb/lldb-private-types.h
  lldb/include/lldb/lldb-private.h
  lldb/source/Host/macosx/cfcpp/CFCReleaser.h
  lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
  lldb/tools/debugserver/source/DNBLog.h
  lldb/tools/debugserver/source/DNBRegisterInfo.h
  lldb/tools/debugserver/source/MacOSX/CFUtils.h

Index: lldb/tools/debugserver/source/MacOSX/CFUtils.h
===
--- lldb/tools/debugserver/source/MacOSX/CFUtils.h
+++ lldb/tools/debugserver/source/MacOSX/CFUtils.h
@@ -15,8 +15,6 @@
 
 #include 
 
-#ifdef __cplusplus
-
 // Templatized CF helper class that can own any CF pointer and will
 // call CFRelease() on any valid pointer it owns unless that pointer is
 // explicitly released using the release() member function.
@@ -71,5 +69,4 @@
   element_type _ptr;
 };
 
-#endif // #ifdef __cplusplus
 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_CFUTILS_H
Index: lldb/tools/debugserver/source/DNBRegisterInfo.h
===
--- lldb/tools/debugserver/source/DNBRegisterInfo.h
+++ lldb/tools/debugserver/source/DNBRegisterInfo.h
@@ -18,12 +18,10 @@
 #include 
 
 struct DNBRegisterValueClass : public DNBRegisterValue {
-#ifdef __cplusplus
   DNBRegisterValueClass(const DNBRegisterInfo *regInfo = NULL);
   void Clear();
   void Dump(const char *pre, const char *post) const;
   bool IsValid() const;
-#endif
 };
 
 #endif
Index: lldb/tools/debugserver/source/DNBLog.h
===
--- lldb/tools/debugserver/source/DNBLog.h
+++ lldb/tools/debugserver/source/DNBLog.h
@@ -17,9 +17,7 @@
 #include 
 #include 
 
-#ifdef __cplusplus
 extern "C" {
-#endif
 
 // Flags that get filled in automatically before calling the log callback
 // function
@@ -144,9 +142,6 @@
 #define DNBLogCloseLogFile() ((void)0)
 
 #endif // #else defined(DNBLOG_ENABLED)
-
-#ifdef __cplusplus
 }
-#endif
 
 #endif // LLDB_TOOLS_DEBUGSERVER_SOURCE_DNBLOG_H
Index: lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
===
--- lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
+++ lldb/source/Host/macosx/objcxx/PosixSpawnResponsible.h
@@ -31,9 +31,7 @@
 static dispatch_once_t pred;
 dispatch_once(, ^{
   responsibility_spawnattrs_setdisclaim_ptr =
-#ifdef __cplusplus
   reinterpret_cast<__typeof__(_spawnattrs_setdisclaim)>
-#endif
   (dlsym(RTLD_DEFAULT, "responsibility_spawnattrs_setdisclaim"));
 });
 if (responsibility_spawnattrs_setdisclaim_ptr)
Index: lldb/source/Host/macosx/cfcpp/CFCReleaser.h
===
--- lldb/source/Host/macosx/cfcpp/CFCReleaser.h
+++ lldb/source/Host/macosx/cfcpp/CFCReleaser.h
@@ -11,8 +11,6 @@
 
 #include 
 
-#ifdef __cplusplus
-
 #include 
 
 // Templatized CF helper class that can own any CF pointer and will
@@ -105,5 +103,4 @@
   T _ptr;
 };
 
-#endif // #ifdef __cplusplus
 #endif // LLDB_SOURCE_HOST_MACOSX_CFCPP_CFCRELEASER_H
Index: lldb/include/lldb/lldb-private.h
===
--- lldb/include/lldb/lldb-private.h
+++ lldb/include/lldb/lldb-private.h
@@ -9,13 +9,9 @@
 #ifndef LLDB_LLDB_PRIVATE_H
 #define LLDB_LLDB_PRIVATE_H
 
-#if defined(__cplusplus)
-
 #include "lldb/lldb-private-enumerations.h"
 #include "lldb/lldb-private-interfaces.h"
 #include "lldb/lldb-private-types.h"
 #include "lldb/lldb-public.h"
 
-#endif // defined(__cplusplus)
-
 #endif // LLDB_LLDB_PRIVATE_H
Index: lldb/include/lldb/lldb-private-types.h
===
--- lldb/include/lldb/lldb-private-types.h
+++ lldb/include/lldb/lldb-private-types.h
@@ -9,8 +9,6 @@
 #ifndef LLDB_LLDB_PRIVATE_TYPES_H
 #define LLDB_LLDB_PRIVATE_TYPES_H
 
-#if defined(__cplusplus)
-
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
@@ -125,6 +123,4 @@
 void *baton, const char **argv, lldb_private::CommandReturnObject );
 } // namespace lldb_private
 
-#endif // #if defined(__cplusplus)
-
 #endif // LLDB_LLDB_PRIVATE_TYPES_H
Index: