From 36a9d3777ec58c3dc3425408d1866041b73fe6936032c8961e7107ad8b3b8e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Tue, 1 Nov 2011 11:05:08 +0000 Subject: [PATCH 1/2] - Update r143456 from llvm-3.0 branch * llvm/clang 3.0rc2 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=85 --- llvm-2.9.99.svn20111025.tar.bz2 | 3 -- llvm-2.9.99.svn20111101.tar.bz2 | 3 ++ llvm-pr9614-part1.patch | 96 --------------------------------- llvm-pr9614-part2.patch | 24 --------- llvm.changes | 6 +++ llvm.spec | 10 +--- 6 files changed, 10 insertions(+), 132 deletions(-) delete mode 100644 llvm-2.9.99.svn20111025.tar.bz2 create mode 100644 llvm-2.9.99.svn20111101.tar.bz2 delete mode 100644 llvm-pr9614-part1.patch delete mode 100644 llvm-pr9614-part2.patch diff --git a/llvm-2.9.99.svn20111025.tar.bz2 b/llvm-2.9.99.svn20111025.tar.bz2 deleted file mode 100644 index 889da4f..0000000 --- a/llvm-2.9.99.svn20111025.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:76dd6a41deaa9e18b14c7b65424d2e84f479879714be91f57c03230d746b2cc1 -size 13937253 diff --git a/llvm-2.9.99.svn20111101.tar.bz2 b/llvm-2.9.99.svn20111101.tar.bz2 new file mode 100644 index 0000000..742d482 --- /dev/null +++ b/llvm-2.9.99.svn20111101.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc767c1daee0cb599040e843d788b20db88b295ce178e4f66c2d63a79f2fa53a +size 24839751 diff --git a/llvm-pr9614-part1.patch b/llvm-pr9614-part1.patch deleted file mode 100644 index dddbde8..0000000 --- a/llvm-pr9614-part1.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- cfe/trunk/lib/CodeGen/CodeGenModule.cpp 2011/10/26 20:33:43 143048 -+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp 2011/10/26 20:41:06 143049 -@@ -29,6 +29,7 @@ - #include "clang/AST/DeclTemplate.h" - #include "clang/AST/Mangle.h" - #include "clang/AST/RecordLayout.h" -+#include "clang/AST/RecursiveASTVisitor.h" - #include "clang/Basic/Diagnostic.h" - #include "clang/Basic/SourceManager.h" - #include "clang/Basic/TargetInfo.h" -@@ -858,6 +859,62 @@ - } - } - -+namespace { -+ struct FunctionIsDirectlyRecursive : -+ public RecursiveASTVisitor { -+ const StringRef Name; -+ bool Result; -+ FunctionIsDirectlyRecursive(const FunctionDecl *F) : -+ Name(F->getName()), Result(false) { -+ } -+ typedef RecursiveASTVisitor Base; -+ -+ bool TraverseCallExpr(CallExpr *E) { -+ const Decl *D = E->getCalleeDecl(); -+ if (!D) -+ return true; -+ AsmLabelAttr *Attr = D->getAttr(); -+ if (!Attr) -+ return true; -+ if (Name == Attr->getLabel()) { -+ Result = true; -+ return false; -+ } -+ return true; -+ } -+ }; -+} -+ -+// isTriviallyRecursiveViaAsm - Check if this function calls another -+// decl that, because of the asm attribute, ends up pointing to itself. -+bool -+CodeGenModule::isTriviallyRecursiveViaAsm(const FunctionDecl *F) { -+ if (getCXXABI().getMangleContext().shouldMangleDeclName(F)) -+ return false; -+ -+ FunctionIsDirectlyRecursive Walker(F); -+ Walker.TraverseFunctionDecl(const_cast(F)); -+ return Walker.Result; -+} -+ -+bool -+CodeGenModule::shouldEmitFunction(const FunctionDecl *F) { -+ if (getFunctionLinkage(F) != llvm::Function::AvailableExternallyLinkage) -+ return true; -+ if (F->hasAttr()) -+ return true; -+ if (CodeGenOpts.OptimizationLevel == 0) -+ return false; -+ // PR9614. Avoid cases where the source code is lying to us. An available -+ // externally function should have an equivalent function somewhere else, -+ // but a function that calls itself is clearly not equivalent to the real -+ // implementation. -+ // This happens in glibc's btowc and in some configure checks. -+ if (isTriviallyRecursiveViaAsm(F)) -+ return false; -+ return true; -+} -+ - void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { - const ValueDecl *D = cast(GD.getDecl()); - -@@ -868,10 +925,7 @@ - if (const FunctionDecl *Function = dyn_cast(D)) { - // At -O0, don't generate IR for functions with available_externally - // linkage. -- if (CodeGenOpts.OptimizationLevel == 0 && -- !Function->hasAttr() && -- getFunctionLinkage(Function) -- == llvm::Function::AvailableExternallyLinkage) -+ if (!shouldEmitFunction(Function)) - return; - - if (const CXXMethodDecl *Method = dyn_cast(D)) { ---- cfe/trunk/lib/CodeGen/CodeGenModule.h 2011/10/26 20:33:43 143048 -+++ cfe/trunk/lib/CodeGen/CodeGenModule.h 2011/10/26 20:41:06 143049 -@@ -324,6 +324,8 @@ - void createOpenCLRuntime(); - void createCUDARuntime(); - -+ bool isTriviallyRecursiveViaAsm(const FunctionDecl *F); -+ bool shouldEmitFunction(const FunctionDecl *F); - llvm::LLVMContext &VMContext; - - /// @name Cache for Blocks Runtime Globals diff --git a/llvm-pr9614-part2.patch b/llvm-pr9614-part2.patch deleted file mode 100644 index 06a8c32..0000000 --- a/llvm-pr9614-part2.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- cfe/trunk/lib/CodeGen/CodeGenModule.cpp 2011/10/28 20:43:47 143221 -+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp 2011/10/28 20:43:56 143222 -@@ -901,18 +901,15 @@ - CodeGenModule::shouldEmitFunction(const FunctionDecl *F) { - if (getFunctionLinkage(F) != llvm::Function::AvailableExternallyLinkage) - return true; -- if (F->hasAttr()) -- return true; -- if (CodeGenOpts.OptimizationLevel == 0) -+ if (CodeGenOpts.OptimizationLevel == 0 && -+ !F->hasAttr()) - return false; - // PR9614. Avoid cases where the source code is lying to us. An available - // externally function should have an equivalent function somewhere else, - // but a function that calls itself is clearly not equivalent to the real - // implementation. - // This happens in glibc's btowc and in some configure checks. -- if (isTriviallyRecursiveViaAsm(F)) -- return false; -- return true; -+ return !isTriviallyRecursiveViaAsm(F); - } - - void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { diff --git a/llvm.changes b/llvm.changes index 240bb86..cf2d37c 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 1 11:31:57 UTC 2011 - idonmez@suse.com + +- Update r143456 from llvm-3.0 branch + * llvm/clang 3.0rc2 + ------------------------------------------------------------------- Fri Oct 28 20:54:16 UTC 2011 - idonmez@suse.com diff --git a/llvm.spec b/llvm.spec index 31623a0..5b76819 100644 --- a/llvm.spec +++ b/llvm.spec @@ -26,7 +26,7 @@ %endif Name: llvm -Version: 2.9.99.svn20111025 +Version: 2.9.99.svn20111101 Release: 1 License: NCSA Summary: Low Level Virtual Machine @@ -40,9 +40,6 @@ Patch1: set-revision.patch Patch2: clang-cmake-lib.patch # PATCH-FIX-OPENSUSE assume-opensuse.patch idoenmez@suse.de -- Always enable openSUSE/SUSE features Patch3: assume-opensuse.patch -# PATCH-FIX-UPSTREAM llvm-pr9614-part1.patch idoenmez@suse.de -- Fix LLVM PR9614 -Patch4: llvm-pr9614-part1.patch -Patch5: llvm-pr9614-part2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -135,11 +132,6 @@ This package contains vim plugins for LLVM like syntax highlighting. %patch2 %patch3 -pushd tools/clang -%patch4 -p2 -%patch5 -p2 -popd - sed -i s,SVN_REVISION,\"%{_revision}\",g tools/clang/lib/Basic/Version.cpp %build From 5c15b50344c18af714019f9374f2f96e81e0d5e365d858c6aa485399bf5aa789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Tue, 1 Nov 2011 13:53:35 +0000 Subject: [PATCH 2/2] Fix tarball OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=86 --- llvm-2.9.99.svn20111101.tar.bz2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm-2.9.99.svn20111101.tar.bz2 b/llvm-2.9.99.svn20111101.tar.bz2 index 742d482..ba71ef9 100644 --- a/llvm-2.9.99.svn20111101.tar.bz2 +++ b/llvm-2.9.99.svn20111101.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc767c1daee0cb599040e843d788b20db88b295ce178e4f66c2d63a79f2fa53a -size 24839751 +oid sha256:abff0ad36592b3b85b6dfb53ab48743a86183ce16c995928ae8a183e8c1fcbb3 +size 13965478