Skip to content

Commit

Permalink
gccxml 2010-04-09 (1ca45528)
Browse files Browse the repository at this point in the history
  • Loading branch information
GCC-XML authored and kwrobot committed Apr 9, 2010
1 parent 31b7d77 commit 13c0fba
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 93 deletions.
28 changes: 6 additions & 22 deletions GCC_XML/GXFront/gxConfiguration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1593,29 +1593,13 @@ bool gxConfiguration::FindFlagsGCC()
INCLUDES = "-iwrapper\"" + supportPath + "/2.96\" " + INCLUDES;
}
}
else if(MAJOR_VERSION == 4 && MINOR_VERSION >= 4)
else if(MAJOR_VERSION >= 4)
{
INCLUDES = "-iwrapper\"" + supportPath + "/4.4\" " + INCLUDES;
SPECIAL = "-include \"gccxml_builtins.h\"";
}
else if(MAJOR_VERSION == 4 && MINOR_VERSION >= 3)
{
INCLUDES = "-iwrapper\"" + supportPath + "/4.3\" " + INCLUDES;
SPECIAL = "-include \"gccxml_builtins.h\"";
}
else if(MAJOR_VERSION == 4 && MINOR_VERSION >= 2)
{
INCLUDES = "-iwrapper\"" + supportPath + "/4.2\" " + INCLUDES;
SPECIAL = "-include \"gccxml_builtins.h\"";
}
else if(MAJOR_VERSION == 4 && MINOR_VERSION >= 1)
{
INCLUDES = "-iwrapper\"" + supportPath + "/4.1\" " + INCLUDES;
SPECIAL = "-include \"gccxml_builtins.h\"";
}
else if(MAJOR_VERSION == 4 && MINOR_VERSION == 0)
{
INCLUDES = "-iwrapper\"" + supportPath + "/4.0\" " + INCLUDES;
gxsys_ios::ostringstream includes;
includes << "-iwrapper\"" << supportPath << "/"
<< MAJOR_VERSION << "." << MINOR_VERSION << "\" "
<< INCLUDES;
INCLUDES = includes.str();
SPECIAL = "-include \"gccxml_builtins.h\"";
}
else if(MAJOR_VERSION == 3 && MINOR_VERSION >= 4)
Expand Down
2 changes: 1 addition & 1 deletion GCC_XML/KWSys/DynamicLoader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ const char* DynamicLoader::LastError()
// 5. Implementation for systems without dynamic libs
// __gnu_blrts__ is IBM BlueGene/L
// __LIBCATAMOUNT__ is defined on Catamount on Cray compute nodes
#if defined(__gnu_blrts__) || defined(__LIBCATAMOUNT__)
#if defined(__gnu_blrts__) || defined(__LIBCATAMOUNT__) || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
#include <string.h> // for strerror()
#define DYNAMICLOADER_DEFINED 1

Expand Down
3 changes: 2 additions & 1 deletion GCC_XML/KWSys/ProcessUNIX.c
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,8 @@ static pid_t kwsysProcessFork(kwsysProcess* cp,
Here we define the command to call on each platform and the
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__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__FreeBSD_kernel__)
# define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
# define KWSYSPE_PS_FORMAT "%d %d\n"
#elif defined(__hpux) || defined(__sun__) || defined(__sgi) || defined(_AIX) \
Expand Down
12 changes: 7 additions & 5 deletions GCC_XML/KWSys/SystemInformation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2395,22 +2395,24 @@ int SystemInformationImplementation::QueryMemory()
#elif _WIN32
#if _MSC_VER < 1300
MEMORYSTATUS ms;
unsigned long tv, tp, av, ap;
ms.dwLength = sizeof(ms);
GlobalMemoryStatus(&ms);
#define MEM_VAL(value) dw##value
#define MEM_VAL(value) dw##value
#else
MEMORYSTATUSEX ms;
DWORDLONG tv, tp, av, ap;
ms.dwLength = sizeof(ms);
if (0 == GlobalMemoryStatusEx(&ms))
{
return 0;
}
#define MEM_VAL(value) ull##value
#endif
unsigned long tv = ms.MEM_VAL(TotalVirtual);
unsigned long tp = ms.MEM_VAL(TotalPhys);
unsigned long av = ms.MEM_VAL(AvailVirtual);
unsigned long ap = ms.MEM_VAL(AvailPhys);
tv = ms.MEM_VAL(TotalVirtual);
tp = ms.MEM_VAL(TotalPhys);
av = ms.MEM_VAL(AvailVirtual);
ap = ms.MEM_VAL(AvailPhys);
this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10;
this->AvailableVirtualMemory = av>>10>>10;
Expand Down
81 changes: 20 additions & 61 deletions GCC_XML/KWSys/SystemTools.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3065,76 +3065,45 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
return relativePath;
}

// OK, some fun stuff to get the actual case of a given path.
// Basically, you just need to call ShortPath, then GetLongPathName,
// However, GetLongPathName is not implemented on windows NT and 95,
// so we have to simulate it on those versions
#ifdef _WIN32
int OldWindowsGetLongPath(kwsys_stl::string const& shortPath,
kwsys_stl::string& longPath )
static int GetCasePathName(const kwsys_stl::string & pathIn,
kwsys_stl::string & casePath)
{
kwsys_stl::string::size_type iFound = shortPath.rfind('/');
if (iFound > 1 && iFound != shortPath.npos)
kwsys_stl::string::size_type iFound = pathIn.rfind('/');
if (iFound > 1 && iFound != pathIn.npos)
{
// recurse to peel off components
//
if (OldWindowsGetLongPath(shortPath.substr(0, iFound), longPath) > 0)
if (GetCasePathName(pathIn.substr(0, iFound), casePath) > 0)
{
longPath += '/';
if (shortPath[1] != '/')
casePath += '/';
if (pathIn[1] != '/')
{
WIN32_FIND_DATA findData;

// append the long component name to the path
//
if (INVALID_HANDLE_VALUE != ::FindFirstFile
(shortPath.c_str(), &findData))
HANDLE hFind = ::FindFirstFile(pathIn.c_str(), &findData);
if (INVALID_HANDLE_VALUE != hFind)
{
longPath += findData.cFileName;
casePath += findData.cFileName;
::FindClose(hFind);
}
else
{
// if FindFirstFile fails, return the error code
//
longPath = "";
casePath = "";
return 0;
}
}
}
}
else
{
longPath = shortPath;
casePath = pathIn;
}
return (int)longPath.size();
}


int PortableGetLongPathName(const char* pathIn,
kwsys_stl::string & longPath)
{
HMODULE lh = LoadLibrary("Kernel32.dll");
if(lh)
{
FARPROC proc = GetProcAddress(lh, "GetLongPathNameA");
if(proc)
{
typedef DWORD (WINAPI * GetLongFunctionPtr) (LPCSTR,LPSTR,DWORD);
GetLongFunctionPtr func = (GetLongFunctionPtr)proc;
char buffer[MAX_PATH+1];
int len = (*func)(pathIn, buffer, MAX_PATH+1);
if(len == 0 || len > MAX_PATH+1)
{
FreeLibrary(lh);
return 0;
}
longPath = buffer;
FreeLibrary(lh);
return len;
}
FreeLibrary(lh);
}
return OldWindowsGetLongPath(pathIn, longPath);
return (int)casePath.size();
}
#endif

Expand All @@ -3153,29 +3122,19 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
{
return i->second;
}
kwsys_stl::string shortPath;
if(!SystemTools::GetShortPath(p, shortPath))
{
return p;
}
kwsys_stl::string longPath;
int len = PortableGetLongPathName(shortPath.c_str(), longPath);
kwsys_stl::string casePath;
int len = GetCasePathName(p, casePath);
if(len == 0 || len > MAX_PATH+1)
{
return p;
}
// Use original path if conversion back to a long path failed.
if(longPath == shortPath)
{
longPath = p;
}
// make sure drive letter is always upper case
if(longPath.size() > 1 && longPath[1] == ':')
if(casePath.size() > 1 && casePath[1] == ':')
{
longPath[0] = toupper(longPath[0]);
casePath[0] = toupper(casePath[0]);
}
(*SystemTools::LongPathMap)[p] = longPath;
return longPath;
(*SystemTools::LongPathMap)[p] = casePath;
return casePath;
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions GCC_XML/KWSys/kwsysDateStamp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2010)

# KWSys version date month component. Format is MM.
SET(KWSYS_DATE_STAMP_MONTH 01)
SET(KWSYS_DATE_STAMP_MONTH 04)

# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 30)
SET(KWSYS_DATE_STAMP_DAY 09)
2 changes: 1 addition & 1 deletion GCC_XML/KWSys/kwsysPlatformTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ MACRO(KWSYS_PLATFORM_INFO_TEST lang var description)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin)

# Compile the test binary.
IF(NOT DEFINED ${var}_COMPILED)
IF(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
MESSAGE(STATUS "${description}")
TRY_COMPILE(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
153 changes: 153 additions & 0 deletions GCC_XML/Support/GCC/4.5/gccxml_builtins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
#define __builtin_apply(x,y,z) ((void*)0)
#define __builtin_nan(x) (0.0)
#define __builtin_nanf(x) (0.0f)
#define __builtin_nanl(x) (0.0l)
#define __builtin_huge_val(x) (0.0)
#define __builtin_huge_valf(x) (0.0f)
#define __builtin_huge_vall(x) (0.0l)
#define __builtin_apply_args(x) ((void*)0)
#define __builtin_types_compatible_p(x,y) 0
#define __builtin_choose_expr(x,y,z) int
#define __builtin_constant_p(x) 0
void* __builtin_memchr(void const*, int, unsigned int);
void __builtin_return (void *RESULT);
void * __builtin_return_address (unsigned int LEVEL);
void * __builtin_frame_address (unsigned int LEVEL);
long __builtin_expect (long EXP, long C);
void __builtin_prefetch (const void *ADDR, ...);
double __builtin_inf (void);
float __builtin_inff (void);
long double __builtin_infl (void);
double __builtin_nans (const char *str);
float __builtin_nansf (const char *str);
long double __builtin_nansl (const char *str);
double __builtin_acos(double);
float __builtin_acosf(float);
long double __builtin_acosl(long double);
double __builtin_asin(double);
float __builtin_asinf(float);
long double __builtin_asinl(long double);
double __builtin_atan(double);
double __builtin_atan2(double, double);
float __builtin_atan2f(float, float);
long double __builtin_atan2l(long double, long double);
float __builtin_atanf(float);
long double __builtin_atanl(long double);
double __builtin_ceil(double);
float __builtin_ceilf(float);
long double __builtin_ceill(long double);
double __builtin_cos(double);
float __builtin_cosf(float);
double __builtin_cosh(double);
float __builtin_coshf(float);
long double __builtin_coshl(long double);
long double __builtin_cosl(long double);
double __builtin_exp(double);
float __builtin_expf(float);
long double __builtin_expl(long double);
double __builtin_fabs(double);
float __builtin_fabsf(float);
long double __builtin_fabsl(long double);
double __builtin_floor(double);
float __builtin_floorf(float);
long double __builtin_floorl(long double);
float __builtin_fmodf(float, float);
long double __builtin_fmodl(long double, long double);
double __builtin_frexp(double, int*);
float __builtin_frexpf(float, int*);
long double __builtin_frexpl(long double, int*);
double __builtin_ldexp(double, int);
float __builtin_ldexpf(float, int);
long double __builtin_ldexpl(long double, int);
double __builtin_log(double);
double __builtin_log10(double);
float __builtin_log10f(float);
long double __builtin_log10l(long double);
float __builtin_logf(float);
long double __builtin_logl(long double);
float __builtin_modff(float, float*);
long double __builtin_modfl(long double, long double*);
float __builtin_powf(float, float);
long double __builtin_powl(long double, long double);
double __builtin_powi(double, int);
float __builtin_powif(float, int);
long double __builtin_powil(long double, int);
double __builtin_sin(double);
float __builtin_sinf(float);
double __builtin_sinh(double);
float __builtin_sinhf(float);
long double __builtin_sinhl(long double);
long double __builtin_sinl(long double);
double __builtin_sqrt(double);
float __builtin_sqrtf(float);
long double __builtin_sqrtl(long double);
double __builtin_tan(double);
float __builtin_tanf(float);
double __builtin_tanh(double);
float __builtin_tanhf(float);
long double __builtin_tanhl(long double);
long double __builtin_tanl(long double);
float __builtin_cabsf(float __complex__);
double __builtin_cabs(double __complex__);
long double __builtin_cabsl(long double __complex__);
float __builtin_cargf(float __complex__);
double __builtin_carg(double __complex__);
long double __builtin_cargl(long double __complex__);
int __builtin_ctz(int);
int __builtin_ctzl(long);
int __builtin_ctzll(long long);
int __builtin_popcount(int);
int __builtin_popcountl(long);
int __builtin_popcountll(long long);
float __complex__ __builtin_ccosf(float __complex__);
double __complex__ __builtin_ccos(double __complex__);
long double __complex__ __builtin_ccosl(long double __complex__);
float __complex__ __builtin_ccoshf(float __complex__);
double __complex__ __builtin_ccosh(double __complex__);
long double __complex__ __builtin_ccoshl(long double __complex__);
float __complex__ __builtin_cexpf(float __complex__);
double __complex__ __builtin_cexp(double __complex__);
long double __complex__ __builtin_cexpl(long double __complex__);
float __complex__ __builtin_clogf(float __complex__);
double __complex__ __builtin_clog(double __complex__);
long double __complex__ __builtin_clogl(long double __complex__);
float __complex__ __builtin_csinf(float __complex__);
double __complex__ __builtin_csin(double __complex__);
long double __complex__ __builtin_csinl(long double __complex__);
float __complex__ __builtin_csinhf(float __complex__);
double __complex__ __builtin_csinh(double __complex__);
long double __complex__ __builtin_csinhl(long double __complex__);
float __complex__ __builtin_csqrtf(float __complex__);
double __complex__ __builtin_csqrt(double __complex__);
long double __complex__ __builtin_csqrtl(long double __complex__);
float __complex__ __builtin_ctanf(float __complex__);
double __complex__ __builtin_ctan(double __complex__);
long double __complex__ __builtin_ctanl(long double __complex__);
float __complex__ __builtin_ctanhf(float __complex__);
double __complex__ __builtin_ctanh(double __complex__);
long double __complex__ __builtin_ctanhl(long double __complex__);
float __complex__ __builtin_cpowf(float __complex__, float __complex__);
double __complex__ __builtin_cpow(double __complex__, double __complex__);
long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__);

/* The GCC 4.5 parser hard-codes handling of these, so they do not
have real signatures. */
bool __builtin_fpclassify(...);
bool __builtin_isfinite(...);
bool __builtin_isgreater(...);
bool __builtin_isgreaterequal(...);
bool __builtin_isinf(...);
bool __builtin_isinf_sign(...);
bool __builtin_isless(...);
bool __builtin_islessequal(...);
bool __builtin_islessgreater(...);
bool __builtin_isnan(...);
bool __builtin_isnormal(...);
bool __builtin_isunordered(...);
bool __builtin_va_arg_pack(...);

/* We fake some constant expressions from GCC 4.5 parser. */
#define __is_pod(x) false
#define __is_empty(x) false
#define __has_trivial_destructor(x) false
#define __has_trivial_constructor(x) false
2 changes: 2 additions & 0 deletions GCC_XML/VcInstall/vcInstall.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ int main(int argc, char* argv[])
{
// English SP1
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\InstalledProducts\\KB948484;",
// Team System English SP1
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\InstalledProducts\\KB947888;",
0
};
const char* vc9exRegistry =
Expand Down

0 comments on commit 13c0fba

Please sign in to comment.