Skip to content

Commit

Permalink
gccxml 2008-04-08 (b32035bb)
Browse files Browse the repository at this point in the history
  • Loading branch information
GCC-XML authored and kwrobot committed Apr 8, 2008
1 parent 9073f9f commit 8d1b2c6
Show file tree
Hide file tree
Showing 25 changed files with 1,070 additions and 403 deletions.
8 changes: 8 additions & 0 deletions GCC/config_cmake/gcc_platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ target_gtfiles=
extra_objs="${host_extra_objs} ${extra_objs}"
extra_gcc_objs="${host_extra_gcc_objs} ${extra_gcc_objs}"

# The file host-ppc-darwin.o is built from rs6000/host-darwin.c in the
# gcc makefile system
fix_out_host_hook_obj()
{
echo "$1" | sed 's/host-ppc-darwin/rs6000\/host-darwin/'
}
out_host_hook_obj=`fix_out_host_hook_obj "${out_host_hook_obj}"`

# Report the information back to the CMake process.
cat > "${outfile}.in" <<EOF
SET(target ${host})
Expand Down
19 changes: 19 additions & 0 deletions GCC/gcc/cp/mangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,25 @@ write_template_arg_literal (const tree value)
switch (TREE_CODE (value))
{
case CONST_DECL:
/* BEGIN GCC-XML MODIFICATIONS (2008/02/14 15:26:25) */
/*
The mangling code chokes on this code:
template <int p, int n>
struct max_pow2_less {
enum { c = 2*n < p };
static const int value = c? (max_pow2_less< c*p, 2*c*n>::value) : n;
};
Here we check for the case that causes the error and hack around it.
*/
if (TREE_CODE (DECL_INITIAL (value)) != INTEGER_CST)
{
char hack[] = "_gccxml_bug_in_gcc_";
write_chars (hack, sizeof(hack)-1);
break;
}
/* END GCC-XML MODIFICATIONS (2008/02/14 15:26:25) */
write_integer_cst (DECL_INITIAL (value));
break;

Expand Down
22 changes: 12 additions & 10 deletions GCC/libcpp/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ struct _cpp_file
header. */
cpp_dir *dir;

/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* BEGIN GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
struct cpp_dir wrapper_dir; /* hack for supporting -iwrapper */
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* END GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */

/* As filled in by stat(2) for the file. */
struct stat st;
Expand Down Expand Up @@ -821,12 +821,14 @@ _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets,
if (!dir)
return false;

/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* BEGIN GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
/* pfile->buffer is NULL when processing an -include command-line flag. */
file = pfile->buffer == NULL ? pfile->main_file : pfile->buffer->file;

/* Search the wrapper path first in all cases except include_next. */
if (!(type == IT_INCLUDE_NEXT && file->dir) && pfile->wrapper_include)
/* Search the wrapper path first in all cases except include_next
and an absolute path. */
if (!(type == IT_INCLUDE_NEXT && file->dir) && pfile->wrapper_include &&
dir != &pfile->no_search_path)
{
struct cpp_dir *wrapper_dir;
pfile->wrapper_include_last->next = dir;
Expand All @@ -852,7 +854,7 @@ _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets,
{
file = _cpp_find_file (pfile, fname, dir, false, angle_brackets);
}
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* END GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */

/* Compensate for the increment in linemap_add. In the case of a
normal #include, we're currently at the start of the line
Expand Down Expand Up @@ -1196,14 +1198,14 @@ _cpp_get_file_stat (_cpp_file *file)
If BRACKET does not lie in the QUOTE chain, it is set to QUOTE. */
void
cpp_set_include_chains (cpp_reader *pfile, cpp_dir *quote, cpp_dir *bracket,
/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* BEGIN GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
cpp_dir *wrapper,
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* END GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
int quote_ignores_source_dir)
{
pfile->quote_include = quote;
pfile->bracket_include = quote;
/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* BEGIN GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
pfile->wrapper_include = wrapper;
pfile->wrapper_include_last = 0;
for (; wrapper; wrapper = wrapper->next)
Expand All @@ -1212,7 +1214,7 @@ cpp_set_include_chains (cpp_reader *pfile, cpp_dir *quote, cpp_dir *bracket,
wrapper->len = strlen (wrapper->name);
pfile->wrapper_include_last = wrapper;
}
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:45) */
/* END GCC-XML MODIFICATIONS (2008/02/07 15:15:10) */
pfile->quote_ignores_source_dir = quote_ignores_source_dir;

for (; quote; quote = quote->next)
Expand Down
5 changes: 5 additions & 0 deletions GCC_XML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,8 @@ CONFIGURE_FILE(${GCCXML_SOURCE_DIR}/GXFront/config_install.in
INSTALL(FILES ${GCCXML_BINARY_DIR}/GXFront/InstallOnly/gccxml_config
DESTINATION ${GCCXML_INSTALL_ROOT}${GCCXML_DATA_DIR}
${GCCXML_INSTALL_COMPONENT_RUNTIME_LIBRARY})

# Add some tests.
IF(GCCXML_ADD_TESTS)
SUBDIRS(Testing)
ENDIF(GCCXML_ADD_TESTS)
24 changes: 21 additions & 3 deletions GCC_XML/KWSys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ IF(NOT KWSYS_NAMESPACE)
SET(KWSYS_NAMESPACE "kwsys")
SET(KWSYS_STANDALONE 1)
ENDIF(NOT KWSYS_NAMESPACE)
IF(KWSYS_STANDALONE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
ENDIF(KWSYS_STANDALONE)

#-----------------------------------------------------------------------------
# The project name is that of the specified namespace.
Expand All @@ -137,9 +143,10 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_USE_IOStream 1)
SET(KWSYS_USE_DateStamp 1)
SET(KWSYS_USE_String 1)
# SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_CPU 1)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)

# Setup the large file support default.
IF(KWSYS_LFS_DISABLE)
SET(KWSYS_LFS_REQUESTED 0)
Expand Down Expand Up @@ -579,6 +586,15 @@ ENDFOREACH(header)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_cstddef.hxx.in
${KWSYS_HEADER_DIR}/cstddef
@ONLY IMMEDIATE)
IF(KWSYS_INSTALL_INCLUDE_DIR)
INSTALL(FILES ${KWSYS_HEADER_DIR}/cstddef
DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}
${KWSYS_INSTALL_INCLUDE_OPTIONS})
IF(KWSYS_HEADER_INSTALL_DIR)
INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}
FILES ${KWSYS_HEADER_DIR}/cstddef)
ENDIF(KWSYS_HEADER_INSTALL_DIR)
ENDIF(KWSYS_INSTALL_INCLUDE_DIR)

#-----------------------------------------------------------------------------
# Create streams header wrappers to give standard names by which they
Expand Down Expand Up @@ -642,7 +658,9 @@ FOREACH(cpp ${cppclasses})
ENDFOREACH(cpp)

# Add selected C components.
FOREACH(c Process Base64 FundamentalType MD5 Terminal System DateStamp String)
FOREACH(c
Process Base64 FundamentalType MD5 Terminal System DateStamp String CPU
)
IF(KWSYS_USE_${c})
# Use the corresponding header file.
SET(KWSYS_H_FILES ${KWSYS_H_FILES} ${c})
Expand Down
111 changes: 111 additions & 0 deletions GCC_XML/KWSys/CPU.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*=========================================================================

Program: KWSys - Kitware System Library
Module: CPU.h.in

Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.

=========================================================================*/
#ifndef @KWSYS_NAMESPACE@_CPU_h
#define @KWSYS_NAMESPACE@_CPU_h

#include <@KWSYS_NAMESPACE@/Configure.h>

/* Identify possible endian cases. The macro
@KWSYS_NAMESPACE@_CPU_ENDIAN_ID will be defined to one of these, or
0 if unknown. */
#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG 4321
#define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE 1234

/* Apple always defines one of these. */
#if defined(__LITTLE_ENDIAN__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__BIG_ENDIAN__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* Alpha */
#elif defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE

/* Intel x86 */
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__MWERKS__) && defined(__INTEL__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE

/* Intel x86-64 */
#elif defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(__amd64) || defined(__amd64__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE

/* Intel Architecture-64 (Itanium) */
#elif defined(__ia64) || defined(__ia64__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#elif defined(_IA64) || defined(__IA64__) || defined(_M_IA64)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE

/* PowerPC */
#elif defined(__powerpc) || defined(__powerpc__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
#elif defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* SPARC */
#elif defined(__sparc) || defined(__sparc__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* HP/PA RISC */
#elif defined(__hppa) || defined(__hppa__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* Motorola 68k */
#elif defined(__m68k__) || defined(M68000)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* MIPS */
#elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* RS/6000 */
#elif defined(__THW_RS600) || defined(_IBMR2) || defined(_POWER)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
#elif defined(_ARCH_PWR) || defined(_ARCH_PWR2)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* System/370 */
#elif defined(__370__) || defined(__THW_370__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* System/390 */
#elif defined(__s390__) || defined(__s390x__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* z/Architecture */
#elif defined(__SYSC_ZARCH__)
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG

/* Unknown CPU */
#else
# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID 0
# if !defined(@KWSYS_NAMESPACE@_CPU_UNKNOWN_OKAY)
# error "The target CPU architecture is not known."
# endif
#endif

/* If building a C or C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
# define KWSYS_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID
# define KWSYS_CPU_ENDIAN_ID_BIG @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG
# define KWSYS_CPU_ENDIAN_ID_LITTLE @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE
#endif

#endif
13 changes: 13 additions & 0 deletions GCC_XML/KWSys/IOStream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,17 @@ kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream& os, IOStreamULL value)

} // namespace KWSYS_NAMESPACE

#else

namespace KWSYS_NAMESPACE
{

// Create one public symbol in this object file to avoid warnings from
// archivers.
void IOStreamSymbolToAvoidWarning()
{
}

} // namespace KWSYS_NAMESPACE

#endif // KWSYS_IOS_NEED_OPERATORS_LL
4 changes: 2 additions & 2 deletions GCC_XML/KWSys/Process.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ kwsysEXPORT void kwsysProcess_Delete(kwsysProcess* cp);

/**
* Set the command line to be executed. Argument is an array of
* pointers to the command and each argument. Ths array must end with
* pointers to the command and each argument. The array must end with
* a NULL pointer. Any previous command lines are removed. Returns
* 1 for success and 0 otherwise.
*/
Expand All @@ -115,7 +115,7 @@ kwsysEXPORT int kwsysProcess_SetCommand(kwsysProcess* cp,

/**
* Add a command line to be executed. Argument is an array of
* pointers to the command and each argument. Ths array must end with
* pointers to the command and each argument. The array must end with
* a NULL pointer. If this is not the first command added, its
* standard input will be connected to the standard output of the
* previous command. Returns 1 for success and 0 otherwise.
Expand Down
2 changes: 1 addition & 1 deletion GCC_XML/KWSys/ProcessUNIX.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ static void kwsysProcessKill(pid_t process_id)
{
if(ppid == process_id)
{
/* Recursively kill this child aned its children. */
/* Recursively kill this child and its children. */
kwsysProcessKill(pid);
}
}
Expand Down
4 changes: 2 additions & 2 deletions GCC_XML/KWSys/String.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace @KWSYS_NAMESPACE@
/** \class String
* \brief Short-name version of the STL basic_string class template.
*
* The standard library "std::string" type is actually a typedef for
* "std::basic_string<..long argument list..>". This string class is
* The standard library "string" type is actually a typedef for
* "basic_string<..long argument list..>". This string class is
* simply a subclass of this type with the same interface so that the
* name is shorter in debugging symbols and error messages.
*/
Expand Down
Loading

0 comments on commit 8d1b2c6

Please sign in to comment.