pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

llvm-netbsd: clang-format -i



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Jun 4 01:04:08 2017 +0200
Changeset:	14c295bc320abaed6cc8af6c22f848a2ca005c7b

Modified Files:
	llvm-netbsd/distinfo
	llvm-netbsd/patches/patch-lib_Support_Unix_Memory.inc

Log Message:
llvm-netbsd: clang-format -i

Prepare patch for pushing upstream.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=14c295bc320abaed6cc8af6c22f848a2ca005c7b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 llvm-netbsd/distinfo                               |  2 +-
 .../patches/patch-lib_Support_Unix_Memory.inc      | 35 ++++++++++++----------
 2 files changed, 20 insertions(+), 17 deletions(-)

diffs:
diff --git a/llvm-netbsd/distinfo b/llvm-netbsd/distinfo
index b4883f32ea..356e680034 100644
--- a/llvm-netbsd/distinfo
+++ b/llvm-netbsd/distinfo
@@ -13,4 +13,4 @@ SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-include_llvm_ADT_Triple.h) = be08dde07a038259a3314ec7791d2ccf8a682c0c
-SHA1 (patch-lib_Support_Unix_Memory.inc) = 3b98071466cd109c634852298565d68d07ce655a
+SHA1 (patch-lib_Support_Unix_Memory.inc) = fa0fe0137a1c6b6a143f1b15a5a6f5ef53edfe1c
diff --git a/llvm-netbsd/patches/patch-lib_Support_Unix_Memory.inc b/llvm-netbsd/patches/patch-lib_Support_Unix_Memory.inc
index 950d486947..3604b1b7fd 100644
--- a/llvm-netbsd/patches/patch-lib_Support_Unix_Memory.inc
+++ b/llvm-netbsd/patches/patch-lib_Support_Unix_Memory.inc
@@ -10,45 +10,47 @@ $NetBSD$
 +
 +  static const size_t overhead =
 +#if __NetBSD_Version__ - 0 >= 799007200
-+  sizeof(void*)
++      sizeof(void*)
 +#else
-+  0
++      0
 +#endif
-+  ;
++      ;
 +
-+  size_t NumPages = (NumBytes+overhead+PageSize-1)/PageSize;
++  size_t NumPages = (NumBytes + overhead + PageSize - 1) / PageSize;
  
    int fd = -1;
  
-@@ -195,6 +204,9 @@ Memory::AllocateRWX(size_t NumBytes, con
+@@ -195,6 +204,10 @@ Memory::AllocateRWX(size_t NumBytes, con
  #if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
    void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_EXEC,
                      flags, fd, 0);
 +#elif __NetBSD_Version__ - 0 >= 799007200
-+  void *pa = ::mmap(start, PageSize*NumPages, PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC),
-+                    flags, fd, 0);
++  void *pa =
++      ::mmap(start, PageSize * NumPages,
++             PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC), flags, fd, 0);
  #else
    void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
                      flags, fd, 0);
-@@ -223,19 +235,49 @@ Memory::AllocateRWX(size_t NumBytes, con
+@@ -223,19 +236,51 @@ Memory::AllocateRWX(size_t NumBytes, con
      MakeErrMsg(ErrMsg, "vm_protect RW failed");
      return MemoryBlock();
    }
 +#elif __NetBSD_Version__ - 0 >= 799007200
-+  void *codeseg = mremap(pa, PageSize*NumPages, NULL, PageSize*NumPages, MAP_REMAPDUP);
++  void *codeseg =
++      mremap(pa, PageSize * NumPages, NULL, PageSize * NumPages, MAP_REMAPDUP);
 +  if (codeseg == MAP_FAILED) {
-+    munmap(pa, PageSize*NumPages);
++    munmap(pa, PageSize * NumPages);
 +
-+    if (NearBlock) //Try again without a near hint
++    if (NearBlock) // Try again without a near hint
 +      return AllocateRWX(NumBytes, nullptr);
 +
 +    MakeErrMsg(ErrMsg, "Can't allocate RWX Memory");
 +    return MemoryBlock();
 +  }
-+  if (mprotect(codeseg, PageSize*NumPages, PROT_READ | PROT_EXEC) == -1) {
-+    munmap(pa, PageSize*NumPages);
-+    munmap(codeseg, PageSize*NumPages);
-+    if (NearBlock) //Try again without a near hint
++  if (mprotect(codeseg, PageSize * NumPages, PROT_READ | PROT_EXEC) == -1) {
++    munmap(pa, PageSize * NumPages);
++    munmap(codeseg, PageSize * NumPages);
++    if (NearBlock) // Try again without a near hint
 +      return AllocateRWX(NumBytes, nullptr);
 +
 +    MakeErrMsg(ErrMsg, "Can't allocate RWX Memory");
@@ -73,7 +75,8 @@ $NetBSD$
 +  static const size_t overhead = sizeof(void *);
 +  void *codeseg;
 +  memcpy(&codeseg, (void *)((uintptr_t)M.Address - overhead), sizeof(void *));
-+  if (0 != ::munmap(codeseg, M.Size + overhead) || 0 != ::munmap(M.Address, M.Size + overhead))
++  if (0 != ::munmap(codeseg, M.Size + overhead) ||
++      0 != ::munmap(M.Address, M.Size + overhead))
 +    return MakeErrMsg(ErrMsg, "Can't release RWX Memory");
 +#else
    if (0 != ::munmap(M.Address, M.Size))


Home | Main Index | Thread Index | Old Index