rebase of the patches

This commit is contained in:
Sylvestre Ledru 2019-01-30 09:32:17 +01:00
parent 29cf874f1a
commit 5cc800bebf
3 changed files with 60 additions and 76 deletions

View File

@ -7,11 +7,11 @@
clang/test/Sema/warn-strlcpycat-size.c | 55 --------------
6 files changed, 25 insertions(+), 78 deletions(-)
Index: llvm-toolchain-snapshot_8~svn342269/clang/include/clang/Basic/Builtins.def
Index: llvm-toolchain-snapshot_9~svn352610/clang/include/clang/Basic/Builtins.def
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/include/clang/Basic/Builtins.def
+++ llvm-toolchain-snapshot_8~svn342269/clang/include/clang/Basic/Builtins.def
@@ -517,8 +517,8 @@ BUILTIN(__builtin___memset_chk, "v*v*izz
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/include/clang/Basic/Builtins.def
+++ llvm-toolchain-snapshot_9~svn352610/clang/include/clang/Basic/Builtins.def
@@ -519,8 +519,8 @@ BUILTIN(__builtin___memset_chk, "v*v*izz
BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF")
BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF")
BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF")
@ -22,7 +22,7 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/include/clang/Basic/Builtins.de
BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF")
BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF")
BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF")
@@ -968,8 +968,8 @@ LIBBUILTIN(getcontext, "iK*", "fj",
@@ -977,8 +977,8 @@ LIBBUILTIN(getcontext, "iK*", "fj",
LIBBUILTIN(_longjmp, "vJi", "fr", "setjmp.h", ALL_GNU_LANGUAGES)
LIBBUILTIN(siglongjmp, "vSJi", "fr", "setjmp.h", ALL_GNU_LANGUAGES)
// non-standard but very common
@ -33,11 +33,11 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/include/clang/Basic/Builtins.de
// id objc_msgSend(id, SEL, ...)
LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG)
// long double objc_msgSend_fpret(id self, SEL op, ...)
Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/AST/Decl.cpp
Index: llvm-toolchain-snapshot_9~svn352610/clang/lib/AST/Decl.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/lib/AST/Decl.cpp
+++ llvm-toolchain-snapshot_8~svn342269/clang/lib/AST/Decl.cpp
@@ -3639,13 +3639,13 @@ unsigned FunctionDecl::getMemoryFunction
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/lib/AST/Decl.cpp
+++ llvm-toolchain-snapshot_9~svn352610/clang/lib/AST/Decl.cpp
@@ -3660,13 +3660,13 @@ unsigned FunctionDecl::getMemoryFunction
case Builtin::BImemmove:
return Builtin::BImemmove;
@ -57,11 +57,11 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/AST/Decl.cpp
case Builtin::BI__builtin_memcmp:
case Builtin::BImemcmp:
Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/Sema/SemaChecking.cpp
Index: llvm-toolchain-snapshot_9~svn352610/clang/lib/Sema/SemaChecking.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/lib/Sema/SemaChecking.cpp
+++ llvm-toolchain-snapshot_8~svn342269/clang/lib/Sema/SemaChecking.cpp
@@ -1241,12 +1241,12 @@ Sema::CheckBuiltinFunctionCall(FunctionD
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/lib/Sema/SemaChecking.cpp
+++ llvm-toolchain-snapshot_9~svn352610/clang/lib/Sema/SemaChecking.cpp
@@ -1313,12 +1313,12 @@ Sema::CheckBuiltinFunctionCall(FunctionD
case Builtin::BI__builtin___memset_chk:
SemaBuiltinMemChkCall(*this, FDecl, TheCall, 2, 3, "memset");
break;
@ -76,7 +76,7 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/Sema/SemaChecking.cpp
case Builtin::BI__builtin___strncat_chk:
SemaBuiltinMemChkCall(*this, FDecl, TheCall, 2, 3, "strncat");
break;
@@ -4098,9 +4098,10 @@ bool Sema::CheckFunctionCall(FunctionDec
@@ -4247,9 +4247,10 @@ bool Sema::CheckFunctionCall(FunctionDec
return false;
// Handle memory setting and copying functions.
@ -90,28 +90,28 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/Sema/SemaChecking.cpp
CheckStrncatArguments(TheCall, FnInfo);
else
CheckMemaccessArguments(TheCall, CMId, FnInfo);
Index: llvm-toolchain-snapshot_8~svn342269/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
Index: llvm-toolchain-snapshot_9~svn352610/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ llvm-toolchain-snapshot_8~svn342269/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ llvm-toolchain-snapshot_9~svn352610/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
@@ -240,9 +240,9 @@ GenericTaintChecker::TaintPropagationRul
case Builtin::BIstrncpy:
case Builtin::BIstrncat:
return TaintPropagationRule(1, 2, 0, true);
return TaintPropagationRule({1, 2}, {0, ReturnValueIndex});
- case Builtin::BIstrlcpy:
- case Builtin::BIstrlcat:
- return TaintPropagationRule(1, 2, 0, false);
- return TaintPropagationRule({1, 2}, {0});
+// case Builtin::BIstrlcpy:
+// case Builtin::BIstrlcat:
+// return TaintPropagationRule(1, 2, 0, false);
+// return TaintPropagationRule({1, 2}, {0});
case Builtin::BIstrndup:
return TaintPropagationRule(0, 1, ReturnValueIndex);
return TaintPropagationRule({0, 1}, {ReturnValueIndex});
Index: llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/builtins.c
Index: llvm-toolchain-snapshot_9~svn352610/clang/test/Sema/builtins.c
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/test/Sema/builtins.c
+++ llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/builtins.c
@@ -190,11 +190,11 @@ void test18() {
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/test/Sema/builtins.c
+++ llvm-toolchain-snapshot_9~svn352610/clang/test/Sema/builtins.c
@@ -199,11 +199,11 @@ void test18() {
ptr = __builtin___memccpy_chk(dst, src, '\037', sizeof(src), sizeof(dst));
result = __builtin___strlcpy_chk(dst, src, sizeof(dst), sizeof(dst));
@ -125,7 +125,7 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/builtins.c
}
void no_ms_builtins() {
@@ -209,12 +209,12 @@ void unavailable() {
@@ -218,12 +218,12 @@ void unavailable() {
}
// rdar://18259539
@ -141,7 +141,7 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/builtins.c
static char buf[20];
strlcpy(buf, b, sizeof(b)); // expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} \\
@@ -223,12 +223,13 @@ void Test19(void)
@@ -232,12 +232,13 @@ void Test19(void)
// expected-note {{change size argument to be the size of the destination}} \
// expected-warning {{'__builtin___strlcpy_chk' will always overflow; destination buffer has size 20, but size argument is 40}}
@ -156,9 +156,9 @@ Index: llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/builtins.c
}
// rdar://11076881
Index: llvm-toolchain-snapshot_8~svn342269/clang/test/Sema/warn-strlcpycat-size.c
Index: llvm-toolchain-snapshot_9~svn352610/clang/test/Sema/warn-strlcpycat-size.c
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/clang/test/Sema/warn-strlcpycat-size.c
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/test/Sema/warn-strlcpycat-size.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// RUN: %clang_cc1 -Wstrlcpy-strlcat-size -verify -fsyntax-only %s

View File

@ -3,10 +3,10 @@ Author: Justin Hibbits <jrh29@alumni.cwru.edu>
Origin: https://reviews.llvm.org/D54583
Last-Update: 2018-12-04
Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cpp
Index: llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cpp
--- llvm-toolchain-snapshot_9~svn352610.orig/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -384,8 +384,16 @@ PPCTargetLowering::PPCTargetLowering(con
} else {
setOperationAction(ISD::BITCAST, MVT::f32, Expand);
@ -35,7 +35,7 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cp
}
return nullptr;
}
@@ -7885,6 +7896,15 @@ SDValue PPCTargetLowering::LowerBITCAST(
@@ -7790,6 +7801,15 @@ SDValue PPCTargetLowering::LowerBITCAST(
SDLoc dl(Op);
SDValue Op0 = Op->getOperand(0);
@ -51,7 +51,7 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cp
if (!EnableQuadPrecision ||
(Op.getValueType() != MVT::f128 ) ||
(Op0.getOpcode() != ISD::BUILD_PAIR) ||
@@ -7896,6 +7916,26 @@ SDValue PPCTargetLowering::LowerBITCAST(
@@ -7801,6 +7821,26 @@ SDValue PPCTargetLowering::LowerBITCAST(
Op0.getOperand(1));
}
@ -78,7 +78,7 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cp
// If this is a case we can't handle, return null and let the default
// expansion code take care of it. If we CAN select this case, and if it
// selects to a single instruction, return Op. Otherwise, if we can codegen
@@ -9679,6 +9719,8 @@ SDValue PPCTargetLowering::LowerOperatio
@@ -9584,6 +9624,8 @@ SDValue PPCTargetLowering::LowerOperatio
return LowerBSWAP(Op, DAG);
case ISD::ATOMIC_CMP_SWAP:
return LowerATOMIC_CMP_SWAP(Op, DAG);
@ -87,10 +87,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.cp
}
}
Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.h
Index: llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCISelLowering.h
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/lib/Target/PowerPC/PPCISelLowering.h
+++ llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.h
--- llvm-toolchain-snapshot_9~svn352610.orig/lib/Target/PowerPC/PPCISelLowering.h
+++ llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCISelLowering.h
@@ -195,6 +195,15 @@ namespace llvm {
/// Direct move of 2 consective GPR to a VSX register.
BUILD_FP128,
@ -115,10 +115,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCISelLowering.h
SDValue DAGCombineExtBoolTrunc(SDNode *N, DAGCombinerInfo &DCI) const;
SDValue DAGCombineBuildVector(SDNode *N, DAGCombinerInfo &DCI) const;
Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrInfo.td
Index: llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCInstrInfo.td
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/lib/Target/PowerPC/PPCInstrInfo.td
+++ llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrInfo.td
--- llvm-toolchain-snapshot_9~svn352610.orig/lib/Target/PowerPC/PPCInstrInfo.td
+++ llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCInstrInfo.td
@@ -230,6 +230,22 @@ def PPCbuild_fp128: SDNode<"PPCISD::BUIL
SDTCisSameAs<1,2>]>,
[]>;
@ -142,10 +142,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrInfo.td
// These are target-independent nodes, but have target-specific formats.
def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeqStart,
[SDNPHasChain, SDNPOutGlue]>;
Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrSPE.td
Index: llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCInstrSPE.td
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/lib/Target/PowerPC/PPCInstrSPE.td
+++ llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrSPE.td
--- llvm-toolchain-snapshot_9~svn352610.orig/lib/Target/PowerPC/PPCInstrSPE.td
+++ llvm-toolchain-snapshot_9~svn352610/lib/Target/PowerPC/PPCInstrSPE.td
@@ -511,7 +511,7 @@ def EVLWWSPLATX : EVXForm_1<792, (out
def EVMERGEHI : EVXForm_1<556, (outs sperc:$RT), (ins sperc:$RA, sperc:$RB),
@ -171,10 +171,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/lib/Target/PowerPC/PPCInstrSPE.td
+ (i32 (EXTRACT_SUBREG $rA, sub_32))>;
+
}
Index: llvm-toolchain-snapshot_9~svn351647/test/CodeGen/PowerPC/spe.ll
Index: llvm-toolchain-snapshot_9~svn352610/test/CodeGen/PowerPC/spe.ll
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/test/CodeGen/PowerPC/spe.ll
+++ llvm-toolchain-snapshot_9~svn351647/test/CodeGen/PowerPC/spe.ll
--- llvm-toolchain-snapshot_9~svn352610.orig/test/CodeGen/PowerPC/spe.ll
+++ llvm-toolchain-snapshot_9~svn352610/test/CodeGen/PowerPC/spe.ll
@@ -472,10 +472,8 @@ entry:
; CHECK-LABEL: test_dselect
; CHECK: andi.

View File

@ -1,8 +1,8 @@
Index: llvm-toolchain-snapshot_9~svn351647/clang/lib/Basic/FileManager.cpp
Index: llvm-toolchain-snapshot_9~svn352610/clang/lib/Basic/FileManager.cpp
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/clang/lib/Basic/FileManager.cpp
+++ llvm-toolchain-snapshot_9~svn351647/clang/lib/Basic/FileManager.cpp
@@ -495,6 +495,12 @@ void FileManager::invalidateCache(const
--- llvm-toolchain-snapshot_9~svn352610.orig/clang/lib/Basic/FileManager.cpp
+++ llvm-toolchain-snapshot_9~svn352610/clang/lib/Basic/FileManager.cpp
@@ -458,6 +458,12 @@ void FileManager::invalidateCache(const
UniqueRealFiles.erase(Entry->getUniqueID());
}
@ -15,10 +15,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/clang/lib/Basic/FileManager.cpp
void FileManager::GetUniqueIDMapping(
SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
UIDToFiles.clear();
Index: llvm-toolchain-snapshot_9~svn351647/lldb/include/lldb/lldb-defines.h
Index: llvm-toolchain-snapshot_9~svn352610/lldb/include/lldb/lldb-defines.h
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/lldb/include/lldb/lldb-defines.h
+++ llvm-toolchain-snapshot_9~svn351647/lldb/include/lldb/lldb-defines.h
--- llvm-toolchain-snapshot_9~svn352610.orig/lldb/include/lldb/lldb-defines.h
+++ llvm-toolchain-snapshot_9~svn352610/lldb/include/lldb/lldb-defines.h
@@ -27,6 +27,11 @@
#define INT32_MAX 2147483647
#endif
@ -31,10 +31,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/lldb/include/lldb/lldb-defines.h
#if !defined(UINT32_MAX)
#define UINT32_MAX 4294967295U
#endif
Index: llvm-toolchain-snapshot_9~svn351647/tools/dsymutil/DwarfLinker.cpp
Index: llvm-toolchain-snapshot_9~svn352610/tools/dsymutil/DwarfLinker.cpp
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/tools/dsymutil/DwarfLinker.cpp
+++ llvm-toolchain-snapshot_9~svn351647/tools/dsymutil/DwarfLinker.cpp
--- llvm-toolchain-snapshot_9~svn352610.orig/tools/dsymutil/DwarfLinker.cpp
+++ llvm-toolchain-snapshot_9~svn352610/tools/dsymutil/DwarfLinker.cpp
@@ -100,6 +100,11 @@
#include <utility>
#include <vector>
@ -47,10 +47,10 @@ Index: llvm-toolchain-snapshot_9~svn351647/tools/dsymutil/DwarfLinker.cpp
namespace llvm {
namespace dsymutil {
Index: llvm-toolchain-snapshot_9~svn351647/polly/lib/External/ppcg/cuda_common.c
Index: llvm-toolchain-snapshot_9~svn352610/polly/lib/External/ppcg/cuda_common.c
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/polly/lib/External/ppcg/cuda_common.c
+++ llvm-toolchain-snapshot_9~svn351647/polly/lib/External/ppcg/cuda_common.c
--- llvm-toolchain-snapshot_9~svn352610.orig/polly/lib/External/ppcg/cuda_common.c
+++ llvm-toolchain-snapshot_9~svn352610/polly/lib/External/ppcg/cuda_common.c
@@ -15,6 +15,11 @@
#include "cuda_common.h"
#include "ppcg.h"
@ -63,19 +63,3 @@ Index: llvm-toolchain-snapshot_9~svn351647/polly/lib/External/ppcg/cuda_common.c
/* Open the host .cu file and the kernel .hu and .cu files for writing.
* Add the necessary includes.
*/
Index: llvm-toolchain-snapshot_9~svn351647/clang/lib/Frontend/ModuleDependencyCollector.cpp
===================================================================
--- llvm-toolchain-snapshot_9~svn351647.orig/clang/lib/Frontend/ModuleDependencyCollector.cpp
+++ llvm-toolchain-snapshot_9~svn351647/clang/lib/Frontend/ModuleDependencyCollector.cpp
@@ -98,6 +98,11 @@ struct ModuleDependencyMMCallbacks : pub
}
+// For GNU Hurd
+#if defined(__GNU__) && !defined(PATH_MAX)
+# define PATH_MAX 4096
+#endif
+
// TODO: move this to Support/Path.h and check for HAVE_REALPATH?
static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
#ifdef LLVM_ON_UNIX