Skip to content

Commit

Permalink
gccxml 2010-07-09 (fb828c68)
Browse files Browse the repository at this point in the history
  • Loading branch information
GCC-XML authored and kwrobot committed Jul 9, 2010
1 parent 13c0fba commit 52a7604
Show file tree
Hide file tree
Showing 17 changed files with 1,938 additions and 164 deletions.
48 changes: 47 additions & 1 deletion GCC/gcc/cp/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ along with this program; if not, write to the

#include "toplev.h" /* ident_hash */

#define GCC_XML_C_VERSION "$Revision: 1.132 $"
#define GCC_XML_C_VERSION "$Revision: 1.134 $"

/*--------------------------------------------------------------------------*/
/* Data structures for the actual XML dump. */
Expand Down Expand Up @@ -3071,6 +3071,7 @@ xml_find_template_parm (tree t)
case CONST_DECL: return 1;
case VAR_DECL: return 1;
case FUNCTION_DECL: return 1;
case OVERLOAD: return 1;
case FIELD_DECL: return 1;

/* A template deferred scoped lookup. */
Expand Down Expand Up @@ -3112,6 +3113,7 @@ xml_find_template_parm (tree t)
}
case REFERENCE_TYPE: return xml_find_template_parm (TREE_TYPE (t));
case INDIRECT_REF: return xml_find_template_parm (TREE_TYPE (t));
case COMPONENT_REF: return xml_find_template_parm (TREE_TYPE (t));
case POINTER_TYPE: return xml_find_template_parm (TREE_TYPE (t));
case ARRAY_TYPE: return xml_find_template_parm (TREE_TYPE (t));
case OFFSET_TYPE:
Expand Down Expand Up @@ -3190,6 +3192,50 @@ xml_find_template_parm (tree t)
/* Other expressions. */
case TYPEOF_TYPE:
return xml_find_template_parm (TYPEOF_TYPE_EXPR (t));
case CALL_EXPR:
{
tree arg_expr;
tree func_expr = TREE_OPERAND (t, 0);
gcc_assert(func_expr);
if (xml_find_template_parm(func_expr))
{
return 1;
}
arg_expr = TREE_OPERAND (t, 1);
while (arg_expr)
{
if (xml_find_template_parm(arg_expr))
{
return 1;
}
arg_expr = TREE_CHAIN (arg_expr);
}
return 0;
}
case TEMPLATE_ID_EXPR:
{
tree argument_vec;
tree template_expr = TREE_OPERAND (t, 0);
gcc_assert(template_expr);
if (xml_find_template_parm(template_expr))
{
return 1;
}
argument_vec = TREE_OPERAND (t, 1);
if (argument_vec)
{
int i;
for (i = 0; i < TREE_VEC_LENGTH(argument_vec); ++i)
{
tree argument_expr = TREE_VEC_ELT(argument_vec, i);
if (xml_find_template_parm(argument_expr))
{
return 1;
}
}
}
return 0;
}

/* Other types that have no nested types. */
case INTEGER_CST: return 0;
Expand Down
47 changes: 32 additions & 15 deletions GCC_XML/KWSys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY)
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
ENDIF(COMMAND SET_PROPERTY)
# add option to disable memory cleanup at exit of putenv memory
IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
SET(KWSYS_DO_NOT_CLEAN_PUTENV 1)
ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
SET(KWSYS_DO_NOT_CLEAN_PUTENV 0)
ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)

# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
Expand Down Expand Up @@ -309,6 +303,14 @@ IF(NOT KWSYS_IN_SOURCE_BUILD)
${PROJECT_BINARY_DIR}/kwsysPrivate.h COPY_ONLY IMMEDIATE)
ENDIF(NOT KWSYS_IN_SOURCE_BUILD)

# Select plugin module file name convention.
IF(NOT KWSYS_DynamicLoader_PREFIX)
SET(KWSYS_DynamicLoader_PREFIX ${CMAKE_SHARED_MODULE_PREFIX})
ENDIF()
IF(NOT KWSYS_DynamicLoader_SUFFIX)
SET(KWSYS_DynamicLoader_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX})
ENDIF()

#-----------------------------------------------------------------------------
# We require ANSI support from the C compiler. Add any needed flags.
IF(CMAKE_ANSI_CFLAGS)
Expand Down Expand Up @@ -596,6 +598,23 @@ ELSE(KWSYS_BUILD_SHARED)
SET(KWSYS_LIBRARY_TYPE STATIC)
ENDIF(KWSYS_BUILD_SHARED)

#-----------------------------------------------------------------------------
# Configure some implementation details.

KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
"Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
"Checking whether C compiler has ssize_t in unistd.h" DIRECT)
SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
)

IF(KWSYS_DO_NOT_CLEAN_PUTENV)
# Disable cleanup of putenv memory for issues with GCOV.
SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1)
ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV)

#-----------------------------------------------------------------------------
# Choose a directory for the generated headers.
IF(NOT KWSYS_HEADER_ROOT)
Expand Down Expand Up @@ -774,15 +793,6 @@ IF(KWSYS_USE_Process)
ELSE(NOT UNIX)
# Use the UNIX implementation.
SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ProcessUNIX.c)

# Help ProcessUNIX.c compile properly on all platforms.
KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
"Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
"Checking whether C compiler has ssize_t in unistd.h" DIRECT)
SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c PROPERTIES
COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
)
ENDIF(NOT UNIX)
ENDIF(KWSYS_USE_Process)

Expand Down Expand Up @@ -1087,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7})
ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
ENDFOREACH(n)

# Some Apple compilers produce bad optimizations in this source.
Expand Down Expand Up @@ -1114,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE)

# Suppress known consistent failures on buggy systems.
IF(KWSYS_TEST_BOGUS_FAILURES)
SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
ENDIF()

ENDIF(BUILD_TESTING)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
4 changes: 4 additions & 0 deletions GCC_XML/KWSys/Configure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
# if defined(__INTEL_COMPILER)
# pragma warning (disable: 1572) /* floating-point equality test */
# endif
# if defined(__sgi) && !defined(__GNUC__)
# pragma set woff 3970 /* pointer to int conversion */
# pragma set woff 3968 /* 64 bit conversion */
# endif
#endif

/* Whether kwsys namespace is "kwsys". */
Expand Down
9 changes: 0 additions & 9 deletions GCC_XML/KWSys/Configure.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>

/* Disable cleanup of putenv memory for issues with GCOV */
#if @KWSYS_DO_NOT_CLEAN_PUTENV@
#define KWSYS_DO_NOT_CLEAN_PUTENV
#else
#undef KWSYS_DO_NOT_CLEAN_PUTENV
#endif



/* Whether ANSI C++ stream headers are to be used. */
#define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@

Expand Down
84 changes: 0 additions & 84 deletions GCC_XML/KWSys/DynamicLoader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const char* sy
return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
return ".sl";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
// TODO: Need implementation with errno/strerror
Expand Down Expand Up @@ -175,21 +162,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
// NSCreateObjectFileImageFromFile fail when dealing with dylib image
// it returns NSObjectFileImageInappropriateFile
//return ".dylib";
return ".so";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
Expand Down Expand Up @@ -284,22 +256,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
#endif
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
#ifdef __MINGW32__
return "lib";
#else
return "";
#endif
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
return ".dll";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
Expand Down Expand Up @@ -417,18 +373,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
return result.psym;
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
return ".so";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
Expand Down Expand Up @@ -475,18 +419,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
return 0;
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
return ".a";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
Expand Down Expand Up @@ -539,22 +471,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
return result.psym;
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
#ifdef __CYGWIN__
return ".dll";
#else
return ".so";
#endif
}

//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
Expand Down
8 changes: 4 additions & 4 deletions GCC_XML/KWSys/DynamicLoader.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public:
/** Find the address of the symbol in the given library. */
static SymbolPointer GetSymbolAddress(LibraryHandle, const char*);

/** Return the library prefix for the given architecture */
static const char* LibPrefix();
/** Return the default module prefix for the current platform. */
static const char* LibPrefix() { return "@KWSYS_DynamicLoader_PREFIX@"; }

/** Return the library extension for the given architecture. */
static const char* LibExtension();
/** Return the default module suffix for the current platform. */
static const char* LibExtension() { return "@KWSYS_DynamicLoader_SUFFIX@"; }

/** Return the last error produced from a calls made on this class. */
static const char* LastError();
Expand Down
13 changes: 12 additions & 1 deletion GCC_XML/KWSys/ProcessUNIX.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}

/* Make sure we have something to run. */
if(cp->NumberOfCommands < 1)
{
strcpy(cp->ErrorMessage, "No command");
cp->State = kwsysProcess_State_Error;
return;
}

/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{
Expand Down Expand Up @@ -2374,9 +2382,12 @@ static pid_t kwsysProcessFork(kwsysProcess* cp,
corresponding parsing format string. The parsing format should
have two integers to store: the pid and then the ppid. */
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__FreeBSD_kernel__)
|| defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
# define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
# define KWSYSPE_PS_FORMAT "%d %d\n"
#elif defined(__sun) && (defined(__SVR4) || defined(__svr4__)) /* Solaris */
# define KWSYSPE_PS_COMMAND "ps -e -o pid,ppid"
# define KWSYSPE_PS_FORMAT "%d %d\n"
#elif defined(__hpux) || defined(__sun__) || defined(__sgi) || defined(_AIX) \
|| defined(__sparc)
# define KWSYSPE_PS_COMMAND "ps -ef"
Expand Down
8 changes: 8 additions & 0 deletions GCC_XML/KWSys/ProcessWin32.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}

/* Make sure we have something to run. */
if(cp->NumberOfCommands < 1)
{
strcpy(cp->ErrorMessage, "No command");
cp->State = kwsysProcess_State_Error;
return;
}

/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{
Expand Down
6 changes: 6 additions & 0 deletions GCC_XML/KWSys/SharedForward.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT
# define KWSYS_SHARED_FORWARD_LDD_N 1
# define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH"

/* OpenBSD */
#elif defined(__OpenBSD__)
# define KWSYS_SHARED_FORWARD_LDD "ldd"
# define KWSYS_SHARED_FORWARD_LDD_N 1
# define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH"

/* OSX */
#elif defined(__APPLE__)
# define KWSYS_SHARED_FORWARD_LDD "otool", "-L"
Expand Down
Loading

0 comments on commit 52a7604

Please sign in to comment.