[llvm-branch-commits] [cfe-branch] r128046 - in /cfe/branches/release_29: ./ include/clang/Basic/BuiltinsX86.def lib/Basic/Targets.cpp lib/Frontend/InitHeaderSearch.cpp lib/Headers/mm_malloc.h test/Sema/builtins-decl.c test/SemaCXX/warn-unreachable.cpp
Bill Wendling
isanbard at gmail.com
Mon Mar 21 17:24:04 PDT 2011
Author: void
Date: Mon Mar 21 19:24:04 2011
New Revision: 128046
URL: http://llvm.org/viewvc/llvm-project?rev=128046&view=rev
Log:
- r127238 mingw-w64 should define __MINGW32__, too.
- r127329 declarations of __builtin_ia32_crc32**()
- r127652 Tweak InitHeaderSearch.cpp for mingw-w64-gcc
- r127654 _mm_malloc tweak
- r127655 Tweak __declspec and __attribute__ for mingw
--- Merging r127238 into '.':
U lib/Basic/Targets.cpp
--- Merging r127329 into '.':
A test/Sema/builtins-decl.c
U include/clang/Basic/BuiltinsX86.def
--- Merging r127652 into '.':
U lib/Frontend/InitHeaderSearch.cpp
--- Merging r127654 into '.':
U lib/Headers/mm_malloc.h
--- Merging r127655 into '.':
G lib/Basic/Targets.cpp
Added:
cfe/branches/release_29/test/Sema/builtins-decl.c
- copied unchanged from r127329, cfe/trunk/test/Sema/builtins-decl.c
Modified:
cfe/branches/release_29/ (props changed)
cfe/branches/release_29/include/clang/Basic/BuiltinsX86.def
cfe/branches/release_29/lib/Basic/Targets.cpp
cfe/branches/release_29/lib/Frontend/InitHeaderSearch.cpp
cfe/branches/release_29/lib/Headers/mm_malloc.h
cfe/branches/release_29/test/SemaCXX/warn-unreachable.cpp (props changed)
Propchange: cfe/branches/release_29/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 21 19:24:04 2011
@@ -1,2 +1,3 @@
-/cfe/trunk:127283,127308,127326,127373,127405,127460,127507,127512,127541,127543,127563,127580,127582-127583,127622-127623,127736-127738,127806,127811,127971,127980
+/cfe/trunk:127238,127283,127308,127326,127329,127373,127405,127460,127507,127512,127541,127543,127563,127580,127582-127583,127622-127623,127652,127654-127655,127736-127738,127806,127811,127971,127980
/cfe/trunk/test/SemaTemplate:126920
+/llvm/trunk:127238,127329,127652,127654-127655
Modified: cfe/branches/release_29/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_29/include/clang/Basic/BuiltinsX86.def?rev=128046&r1=128045&r2=128046&view=diff
==============================================================================
--- cfe/branches/release_29/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/branches/release_29/include/clang/Basic/BuiltinsX86.def Mon Mar 21 19:24:04 2011
@@ -342,10 +342,10 @@
BUILTIN(__builtin_ia32_pcmpgtq, "V2LLiV2LLiV2LLi", "")
-BUILTIN(__builtin_ia32_crc32qi, "iic", "")
-BUILTIN(__builtin_ia32_crc32hi, "iis", "")
-BUILTIN(__builtin_ia32_crc32si, "iii", "")
-BUILTIN(__builtin_ia32_crc32di, "LLiLLiLLi", "")
+BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "")
+BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "")
+BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "")
+BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "")
// AES
BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "")
Modified: cfe/branches/release_29/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_29/lib/Basic/Targets.cpp?rev=128046&r1=128045&r2=128046&view=diff
==============================================================================
--- cfe/branches/release_29/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_29/lib/Basic/Targets.cpp Mon Mar 21 19:24:04 2011
@@ -1481,7 +1481,15 @@
Builder.defineMacro("_X86_");
Builder.defineMacro("__MSVCRT__");
Builder.defineMacro("__MINGW32__");
- Builder.defineMacro("__declspec", "__declspec");
+
+ // mingw32-gcc provides __declspec(a) as alias of __attribute__((a)).
+ // In contrast, clang-cc1 provides __declspec(a) with -fms-extensions.
+ if (Opts.Microsoft)
+ // Provide "as-is" __declspec.
+ Builder.defineMacro("__declspec", "__declspec");
+ else
+ // Provide alias of __attribute__ like mingw32-gcc.
+ Builder.defineMacro("__declspec(a)", "__attribute__((a))");
}
};
} // end anonymous namespace
@@ -1629,8 +1637,17 @@
WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder);
DefineStd(Builder, "WIN64", Opts);
Builder.defineMacro("__MSVCRT__");
+ Builder.defineMacro("__MINGW32__");
Builder.defineMacro("__MINGW64__");
- Builder.defineMacro("__declspec", "__declspec");
+
+ // mingw32-gcc provides __declspec(a) as alias of __attribute__((a)).
+ // In contrast, clang-cc1 provides __declspec(a) with -fms-extensions.
+ if (Opts.Microsoft)
+ // Provide "as-is" __declspec.
+ Builder.defineMacro("__declspec", "__declspec");
+ else
+ // Provide alias of __attribute__ like mingw32-gcc.
+ Builder.defineMacro("__declspec(a)", "__attribute__((a))");
}
};
} // end anonymous namespace
Modified: cfe/branches/release_29/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_29/lib/Frontend/InitHeaderSearch.cpp?rev=128046&r1=128045&r2=128046&view=diff
==============================================================================
--- cfe/branches/release_29/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/branches/release_29/lib/Frontend/InitHeaderSearch.cpp Mon Mar 21 19:24:04 2011
@@ -76,6 +76,10 @@
llvm::StringRef Arch,
llvm::StringRef Version);
+ /// AddMinGW64CXXPaths - Add the necessary paths to support
+ /// libstdc++ of x86_64-w64-mingw32 aka mingw-w64.
+ void AddMinGW64CXXPaths(llvm::StringRef Base);
+
/// AddDelimitedPaths - Add a list of paths delimited by the system PATH
/// separator. The processing follows that of the CPATH variable for gcc.
void AddDelimitedPaths(llvm::StringRef String);
@@ -207,6 +211,15 @@
CXXSystem, true, false, false);
}
+void InitHeaderSearch::AddMinGW64CXXPaths(llvm::StringRef Base) {
+ AddPath(Base,
+ CXXSystem, true, false, false);
+ AddPath(Base + "/x86_64-w64-mingw32",
+ CXXSystem, true, false, false);
+ AddPath(Base + "/backward",
+ CXXSystem, true, false, false);
+}
+
// FIXME: This probably should goto to some platform utils place.
#ifdef _MSC_VER
@@ -534,6 +547,10 @@
AddPath("/usr/include/w32api", System, true, false, false);
break;
case llvm::Triple::MinGW32:
+ // FIXME: We should be aware of i686-w64-mingw32.
+ if (triple.getArch() == llvm::Triple::x86_64)
+ AddPath("c:/mingw/x86_64-w64-mingw32/include",
+ System, true, false, false);
AddPath("/mingw/include", System, true, false, false);
AddPath("c:/mingw/include", System, true, false, false);
break;
@@ -571,18 +588,13 @@
AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "3.4.4");
break;
case llvm::Triple::MinGW32:
- // mingw-w64-20110207
- AddPath("c:/MinGW/include/c++/4.5.3", CXXSystem, true, false, false);
- AddPath("c:/MinGW/include/c++/4.5.3/x86_64-w64-mingw32", CXXSystem, true,
- false, false);
- AddPath("c:/MinGW/include/c++/4.5.3/backward", CXXSystem, true, false,
- false);
- // mingw-w64-20101129
- AddPath("c:/MinGW/include/c++/4.5.2", CXXSystem, true, false, false);
- AddPath("c:/MinGW/include/c++/4.5.2/x86_64-w64-mingw32", CXXSystem, true,
- false, false);
- AddPath("c:/MinGW/include/c++/4.5.2/backward", CXXSystem, true, false,
- false);
+ // FIXME: We should be aware of i686-w64-mingw32.
+ if (triple.getArch() == llvm::Triple::x86_64) {
+ // mingw-w64-20110207
+ AddMinGW64CXXPaths("c:/mingw/x86_64-w64-mingw32/include/c++/4.5.3");
+ // mingw-w64-20101129
+ AddMinGW64CXXPaths("c:/mingw/x86_64-w64-mingw32/include/c++/4.5.2");
+ }
// Try gcc 4.5.2 (MSYS)
AddMinGWCPlusPlusIncludePaths("/mingw/lib/gcc", "mingw32", "4.5.2");
// Try gcc 4.5.0
Modified: cfe/branches/release_29/lib/Headers/mm_malloc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_29/lib/Headers/mm_malloc.h?rev=128046&r1=128045&r2=128046&view=diff
==============================================================================
--- cfe/branches/release_29/lib/Headers/mm_malloc.h (original)
+++ cfe/branches/release_29/lib/Headers/mm_malloc.h Mon Mar 21 19:24:04 2011
@@ -40,6 +40,7 @@
#endif
#endif
+#if !(defined(_WIN32) && defined(_mm_malloc))
static __inline__ void *__attribute__((__always_inline__, __nodebug__,
__malloc__))
_mm_malloc(size_t size, size_t align)
@@ -67,5 +68,6 @@
{
free(p);
}
+#endif
#endif /* __MM_MALLOC_H */
Propchange: cfe/branches/release_29/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 21 19:24:04 2011
@@ -1 +1 @@
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,127283,127308,127326,127373,127405,127460,127507,127512,127541,127543,127563,127580,127582-127583,127622-127623,127736-127738,127806,127811,127971,127980
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,127238,127283,127308,127326,127329,127373,127405,127460,127507,127512,127541,127543,127563,127580,127582-127583,127622-127623,127652,127654-127655,127736-127738,127806,127811,127971,127980
More information about the llvm-branch-commits
mailing list