Skip to content

Commit 49be160

Browse files
author
Zachary Turner
committed
Revert "Fix warnings found with clang-cl."
SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
1 parent 8f12ce0 commit 49be160

27 files changed

+60
-45
lines changed

lldb/include/lldb/API/SBCommunication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace lldb {
1818
class LLDB_API SBCommunication
1919
{
2020
public:
21-
enum : unsigned {
21+
enum {
2222
eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
2323
eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
2424
eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.

lldb/include/lldb/API/SBValue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace lldb {
2121

2222
class LLDB_API SBValue
2323
{
24+
friend class ValueLocker;
2425

2526
public:
2627
SBValue ();

lldb/include/lldb/Core/Communication.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ namespace lldb_private {
8585
class Communication : public Broadcaster
8686
{
8787
public:
88-
enum : unsigned {
89-
eBroadcastBitDisconnected = (1u << 0), ///< Sent when the communications connection is lost.
90-
eBroadcastBitReadThreadGotBytes = (1u << 1), ///< Sent by the read thread when bytes become available.
91-
eBroadcastBitReadThreadDidExit = (1u << 2), ///< Sent by the read thread when it exits to inform clients.
92-
eBroadcastBitReadThreadShouldExit = (1u << 3), ///< Sent by clients that need to cancel the read thread.
93-
eBroadcastBitPacketAvailable = (1u << 4), ///< Sent when data received makes a complete packet.
94-
kLoUserBroadcastBit = (1u << 16),///< Subclasses can used bits 31:16 for any needed events.
95-
kHiUserBroadcastBit = (1u << 31),
88+
enum {
89+
eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
90+
eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
91+
eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
92+
eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread.
93+
eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet.
94+
kLoUserBroadcastBit = (1 << 16),///< Subclasses can used bits 31:16 for any needed events.
95+
kHiUserBroadcastBit = (1 << 31),
9696
eAllEventBits = 0xffffffff
9797
};
9898

lldb/include/lldb/Host/OptionParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class OptionParser
4646
const char *optstring,
4747
const Option *longopts, int *longindex);
4848

49-
static const char* GetOptionArgument();
49+
static char* GetOptionArgument();
5050
static int GetOptionIndex();
5151
static int GetOptionErrorCause();
5252
static std::string GetShortOptionString(struct option *long_options);

lldb/include/lldb/Host/Socket.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ namespace lldb_private {
3434

3535
#if defined(_MSC_VER)
3636
typedef SOCKET NativeSocket;
37-
inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket != INVALID_SOCKET; }
3837
#else
3938
typedef int NativeSocket;
40-
inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket >= 0; }
4139
#endif
4240

4341
class Socket : public IOObject

lldb/include/lldb/Host/msvc/Config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#if _HAS_EXCEPTIONS == 0
3131
// Exceptions are disabled so this isn't defined, but concrt assumes it is.
32-
inline void *__uncaught_exception() { return nullptr; }
32+
static void *__uncaught_exception() { return nullptr; }
3333
#endif
3434

3535
#endif // #ifndef liblldb_Platform_Config_h_

lldb/include/lldb/Host/windows/getopt/GetOptInc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct option
2121
int getopt( int argc, char * const argv[], const char *optstring );
2222

2323
// from getopt.h
24-
extern const char * optarg;
24+
extern char * optarg;
2525
extern int optind;
2626
extern int opterr;
2727
extern int optopt;

lldb/include/lldb/Interpreter/ScriptInterpreterPython.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class ScriptInterpreterPython :
3434
{
3535
public:
3636

37+
friend class IOHandlerPythonInterpreter;
38+
3739
ScriptInterpreterPython (CommandInterpreter &interpreter);
3840

3941
~ScriptInterpreterPython ();

lldb/include/lldb/Symbol/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Type :
7171
eEncodingIsSyntheticUID
7272
} EncodingDataType;
7373

74-
typedef enum ResolveStateTag : unsigned
74+
typedef enum ResolveStateTag
7575
{
7676
eResolveStateUnresolved = 0,
7777
eResolveStateForward = 1,

lldb/include/lldb/Target/SectionLoadHistory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace lldb_private {
2323
class SectionLoadHistory
2424
{
2525
public:
26-
enum : unsigned {
26+
enum {
2727
// Pass eStopIDNow to any function that takes a stop ID to get
2828
// the current value.
2929
eStopIDNow = UINT32_MAX

lldb/include/lldb/lldb-enumerations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ namespace lldb {
652652
eBasicTypeOther
653653
} BasicType;
654654

655-
typedef enum TypeClass : unsigned
655+
typedef enum TypeClass
656656
{
657657
eTypeClassInvalid = (0u),
658658
eTypeClassArray = (1u << 0),

lldb/source/Host/common/OptionParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ OptionParser::Parse (int argc,
5454
return getopt_long_only(argc, argv, optstring, &opts[0], longindex);
5555
}
5656

57-
const char*
57+
char*
5858
OptionParser::GetOptionArgument()
5959
{
6060
return optarg;

lldb/source/Host/common/Socket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ int Socket::SetOption(int level, int option_name, int option_value)
699699
uint16_t Socket::GetLocalPortNumber(const NativeSocket& socket)
700700
{
701701
// We bound to port zero, so we need to figure out which port we actually bound to
702-
if (IS_VALID_SOCKET(socket))
702+
if (socket >= 0)
703703
{
704704
SocketAddress sock_addr;
705705
socklen_t sock_addr_len = sock_addr.GetMaxLength ();
@@ -730,7 +730,7 @@ std::string Socket::GetLocalIPAddress () const
730730

731731
uint16_t Socket::GetRemotePortNumber () const
732732
{
733-
if (IS_VALID_SOCKET(m_socket))
733+
if (m_socket >= 0)
734734
{
735735
SocketAddress sock_addr;
736736
socklen_t sock_addr_len = sock_addr.GetMaxLength ();
@@ -743,7 +743,7 @@ uint16_t Socket::GetRemotePortNumber () const
743743
std::string Socket::GetRemoteIPAddress () const
744744
{
745745
// We bound to port zero, so we need to figure out which port we actually bound to
746-
if (IS_VALID_SOCKET(m_socket))
746+
if (m_socket >= 0)
747747
{
748748
SocketAddress sock_addr;
749749
socklen_t sock_addr_len = sock_addr.GetMaxLength ();

lldb/source/Host/common/Terminal.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,20 @@ TerminalState::Save (int fd, bool save_process_group)
180180
bool
181181
TerminalState::Restore () const
182182
{
183-
#ifndef LLDB_DISABLE_POSIX
184183
if (IsValid())
185184
{
186185
const int fd = m_tty.GetFileDescriptor();
186+
#ifndef LLDB_DISABLE_POSIX
187187
if (TFlagsIsValid())
188188
fcntl (fd, F_SETFL, m_tflags);
189+
#endif
189190

190191
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
191192
if (TTYStateIsValid())
192193
tcsetattr (fd, TCSANOW, m_termios_ap.get());
193194
#endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
194195

196+
#ifndef LLDB_DISABLE_POSIX
195197
if (ProcessGroupIsValid())
196198
{
197199
// Save the original signal handler.
@@ -202,9 +204,9 @@ TerminalState::Restore () const
202204
// Restore the original signal handler.
203205
signal (SIGTTOU, saved_sigttou_callback);
204206
}
207+
#endif
205208
return true;
206209
}
207-
#endif
208210
return false;
209211
}
210212

lldb/source/Host/windows/ConnectionGenericFileWindows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ ConnectionGenericFile::Read(void *dst, size_t dst_len, uint32_t timeout_usec, ll
208208
TimeValue time_value;
209209
time_value.OffsetWithMicroSeconds(timeout_usec);
210210
DWORD milliseconds = time_value.milliseconds();
211-
DWORD wait_result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds);
211+
result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds);
212212
// All of the events are manual reset events, so make sure we reset them to non-signalled.
213-
switch (wait_result)
213+
switch (result)
214214
{
215215
case WAIT_OBJECT_0 + kBytesAvailableEvent:
216216
break;

lldb/source/Host/windows/EditLineWin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ el_set (EditLine *el, int code, ...)
247247

248248
// get the function pointer from the arg list
249249
void *func_vp = (void*)va_arg(vl, el_prompt_func);
250-
va_arg(vl, int);
250+
char escape = (char)va_arg(vl, int);
251251
// call to get the prompt as a string
252252
el_prompt_func func_fp = (el_prompt_func)func_vp;
253-
func_fp(el);
253+
const char *newPrompt = func_fp(el);
254254
}
255255
break;
256256

lldb/source/Host/windows/HostProcessWindows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ HostProcessWindows::MonitorThread(void *thread_arg)
120120
MonitorInfo *info = static_cast<MonitorInfo *>(thread_arg);
121121
if (info)
122122
{
123-
::WaitForSingleObject(info->process_handle, INFINITE);
123+
DWORD wait_result = ::WaitForSingleObject(info->process_handle, INFINITE);
124124
::GetExitCodeProcess(info->process_handle, &exit_code);
125125
info->callback(info->baton, ::GetProcessId(info->process_handle), true, 0, exit_code);
126126
::CloseHandle(info->process_handle);

lldb/source/Host/windows/ThisThread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ using namespace lldb_private;
2020

2121
namespace
2222
{
23+
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
24+
2325
#pragma pack(push, 8)
2426
struct THREADNAME_INFO
2527
{
@@ -36,9 +38,7 @@ ThisThread::SetName(llvm::StringRef name)
3638
{
3739
// Other compilers don't yet support SEH, so we can only set the thread if compiling with MSVC.
3840
// TODO(zturner): Once clang-cl supports SEH, relax this conditional.
39-
#if defined(_MSC_VER) && !defined(__clang__) /* clang-cl doesn't support SEH */
40-
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
41-
41+
#if defined(_MSC_VER)
4242
THREADNAME_INFO info;
4343
info.dwType = 0x1000;
4444
info.szName = name.data();

lldb/source/Host/windows/getopt/GetOptInc.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ int opterr = 1; /* if error message should be printed */
99
int optind = 1; /* index into parent argv vector */
1010
int optopt = '?'; /* character checked for validity */
1111
int optreset; /* reset getopt */
12-
const char *optarg; /* argument associated with option */
12+
char *optarg; /* argument associated with option */
1313

1414
#define PRINT_ERROR ((opterr) && (*options != ':'))
1515

@@ -31,12 +31,20 @@ static int parse_long_options(char * const *, const char *,
3131
static int gcd(int, int);
3232
static void permute_args(int, int, int, char * const *);
3333

34-
static const char *place = EMSG; /* option letter processing */
34+
static char *place = EMSG; /* option letter processing */
3535

3636
/* XXX: set optreset to 1 rather than these two */
3737
static int nonopt_start = -1; /* first non option argument (for permute) */
3838
static int nonopt_end = -1; /* first option after non options (for permute) */
3939

40+
/* Error messages */
41+
static const char recargchar[] = "option requires an argument -- %c";
42+
static const char recargstring[] = "option requires an argument -- %s";
43+
static const char ambig[] = "ambiguous option -- %.*s";
44+
static const char noarg[] = "option doesn't take an argument -- %.*s";
45+
static const char illoptchar[] = "unknown option -- %c";
46+
static const char illoptstring[] = "unknown option -- %s";
47+
4048
/*
4149
* Compute the greatest common divisor of a and b.
4250
*/
@@ -104,7 +112,7 @@ static int
104112
parse_long_options(char * const *nargv, const char *options,
105113
const struct option *long_options, int *idx, int short_too)
106114
{
107-
const char *current_argv, *has_equal;
115+
char *current_argv, *has_equal;
108116
size_t current_argv_len;
109117
int i, match;
110118

lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
269269

270270
#if HEX_ABI_DEBUG
271271
// print the original stack pointer
272-
printf( "sp : %04llx \n", sp );
272+
printf( "sp : %04lx \n", sp );
273273
#endif
274274

275275
// make sure number of parameters matches prototype
@@ -337,7 +337,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread,
337337
uint32_t data = 0;
338338
lldb::addr_t addr = sp + i * 4;
339339
proc->ReadMemory( addr, (void*)&data, sizeof( data ), error );
340-
printf( "\n0x%04llx 0x%08x ", addr, data );
340+
printf( "\n0x%04lx 0x%08x ", addr, data );
341341
if ( i == 0 ) printf( "<<-- sp" );
342342
}
343343
printf( "\n" );

lldb/source/Plugins/Process/Windows/DebuggerThread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ DebuggerThread::DebuggerThreadRoutine(const ProcessLaunchInfo &launch_info)
7979
// Grab a shared_ptr reference to this so that we know it won't get deleted until after the
8080
// thread routine has exited.
8181
std::shared_ptr<DebuggerThread> this_ref(shared_from_this());
82+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
8283

8384
Error error;
8485
ProcessLauncherWindows launcher;

lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace lldb_private
4040
class LocalDebugDelegate : public IDebugDelegate
4141
{
4242
public:
43-
explicit LocalDebugDelegate(lldb::ProcessSP process);
43+
explicit LocalDebugDelegate::LocalDebugDelegate(lldb::ProcessSP process);
4444

4545
virtual void OnExitProcess(uint32_t exit_code) override;
4646
virtual void OnDebuggerConnected(lldb::addr_t image_base) override;

lldb/source/Plugins/Process/Windows/ProcessWindows.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class ProcessWindowsData
5555
{
5656
public:
5757
ProcessWindowsData(const ProcessLaunchInfo &launch_info)
58-
: m_launch_info(launch_info)
59-
, m_initial_stop_event(nullptr)
58+
: m_initial_stop_event(nullptr)
59+
, m_launch_info(launch_info)
6060
, m_initial_stop_received(false)
6161
{
6262
m_initial_stop_event = ::CreateEvent(nullptr, TRUE, FALSE, nullptr);
@@ -334,6 +334,7 @@ ProcessWindows::RefreshStateAfterStop()
334334
BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc - 1));
335335
if (site && site->ValidForThisThread(stop_thread.get()))
336336
{
337+
lldb::break_id_t break_id = LLDB_INVALID_BREAK_ID;
337338
stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(*stop_thread, site->GetID());
338339
register_context->SetPC(pc - 1);
339340
}
@@ -392,6 +393,7 @@ void ProcessWindows::DidLaunch()
392393
{
393394
llvm::sys::ScopedLock lock(m_mutex);
394395

396+
StateType state = GetPrivateState();
395397
// The initial stop won't broadcast the state change event, so account for that here.
396398
if (m_session_data && GetPrivateState() == eStateStopped &&
397399
m_session_data->m_launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
@@ -555,6 +557,7 @@ ProcessWindows::OnDebugException(bool first_chance, const ExceptionRecord &recor
555557
}
556558

557559
ExceptionResult result = ExceptionResult::SendToApplication;
560+
lldb::StateType state = GetPrivateState();
558561
switch (record.GetExceptionCode())
559562
{
560563
case EXCEPTION_BREAKPOINT:

lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TargetThreadWindows::~TargetThreadWindows()
3838
void
3939
TargetThreadWindows::RefreshStateAfterStop()
4040
{
41-
::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle());
41+
DWORD old_suspend_count = ::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle());
4242

4343
GetRegisterContext()->InvalidateIfNeeded(false);
4444
}

lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ RegisterSet g_register_sets[] = {
9393
//------------------------------------------------------------------
9494
RegisterContextWindows_x86::RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx)
9595
: RegisterContext(thread, concrete_frame_idx)
96-
, m_context()
9796
, m_context_stale(true)
97+
, m_context()
9898
{
9999
}
100100

lldb/source/Target/Process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5010,14 +5010,14 @@ class IOHandlerProcessSTDIO :
50105010
if (OpenPipes())
50115011
{
50125012
const int read_fd = m_read_file.GetDescriptor();
5013+
const int pipe_read_fd = m_pipe.GetReadFileDescriptor();
50135014
TerminalState terminal_state;
50145015
terminal_state.Save (read_fd, false);
50155016
Terminal terminal(read_fd);
50165017
terminal.SetCanonical(false);
50175018
terminal.SetEcho(false);
50185019
// FD_ZERO, FD_SET are not supported on windows
50195020
#ifndef _WIN32
5020-
const int pipe_read_fd = m_pipe.GetReadFileDescriptor();
50215021
while (!GetIsDone())
50225022
{
50235023
fd_set read_fdset;

0 commit comments

Comments
 (0)