[libcxx-commits] [PATCH] D118008: [demangler] write-protect non-canonical source

Nathan Sidwell via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 24 05:29:40 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG897d1bb659c2: [demangler] write-protect non-canonical source (authored by urnathan).
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++abi.

Changed prior to commit:
  https://reviews.llvm.org/D118008?vs=402374&id=402484#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118008/new/

https://reviews.llvm.org/D118008

Files:
  libcxxabi/src/demangle/cp-to-llvm.sh
  llvm/include/llvm/Demangle/ItaniumDemangle.h
  llvm/include/llvm/Demangle/StringView.h
  llvm/include/llvm/Demangle/Utility.h


Index: llvm/include/llvm/Demangle/Utility.h
===================================================================
--- llvm/include/llvm/Demangle/Utility.h
+++ llvm/include/llvm/Demangle/Utility.h
@@ -1,3 +1,5 @@
+// Do not edit! -*- read-only -*-
+// See README.txt for instructions
 //===--- Utility.h ----------------------------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -10,8 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEMANGLE_UTILITY_H
-#define LLVM_DEMANGLE_UTILITY_H
+#ifndef DEMANGLE_UTILITY_H
+#define DEMANGLE_UTILITY_H
 
 #include "StringView.h"
 #include <array>
Index: llvm/include/llvm/Demangle/StringView.h
===================================================================
--- llvm/include/llvm/Demangle/StringView.h
+++ llvm/include/llvm/Demangle/StringView.h
@@ -1,3 +1,5 @@
+// Do not edit! -*- read-only -*-
+// See README.txt for instructions
 //===--- StringView.h -------------------------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -10,8 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEMANGLE_STRINGVIEW_H
-#define LLVM_DEMANGLE_STRINGVIEW_H
+#ifndef DEMANGLE_STRINGVIEW_H
+#define DEMANGLE_STRINGVIEW_H
 
 #include "DemangleConfig.h"
 #include <cassert>
Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -1,3 +1,5 @@
+// Do not edit! -*- read-only -*-
+// See README.txt for instructions
 //===------------------------- ItaniumDemangle.h ----------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -11,8 +13,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_DEMANGLE_ITANIUMDEMANGLE_H
-#define LLVM_DEMANGLE_ITANIUMDEMANGLE_H
+#ifndef DEMANGLE_ITANIUMDEMANGLE_H
+#define DEMANGLE_ITANIUMDEMANGLE_H
 
 // FIXME: (possibly) incomplete list of features that clang mangles that this
 // file does not yet support:
@@ -5749,4 +5751,4 @@
 
 DEMANGLE_NAMESPACE_END
 
-#endif // LLVM_DEMANGLE_ITANIUMDEMANGLE_H
+#endif // DEMANGLE_ITANIUMDEMANGLE_H
Index: libcxxabi/src/demangle/cp-to-llvm.sh
===================================================================
--- libcxxabi/src/demangle/cp-to-llvm.sh
+++ libcxxabi/src/demangle/cp-to-llvm.sh
@@ -5,7 +5,8 @@
 
 set -e
 
-FILES="ItaniumDemangle.h StringView.h Utility.h README.txt"
+cd $(dirname $0)
+HDRS="ItaniumDemangle.h StringView.h Utility.h"
 LLVM_DEMANGLE_DIR=$1
 
 if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then
@@ -21,7 +22,14 @@
 echo
 
 if [[ $ANSWER =~ ^[Yy]$ ]]; then
-    for I in $FILES ; do
-        cp $I $LLVM_DEMANGLE_DIR/$I
+    cp -f README.txt $LLVM_DEMANGLE_DIR
+    chmod -w $LLVM_DEMANGLE_DIR/README.txt
+    for I in $HDRS ; do
+	rm -f $LLVM_DEMANGLE_DIR/$I
+	cat - $I >$LLVM_DEMANGLE_DIR/$I <<EOF
+// Do not edit! -*- read-only -*-
+// See README.txt for instructions
+EOF
+	chmod -w $LLVM_DEMANGLE_DIR/$I
     done
 fi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118008.402484.patch
Type: text/x-patch
Size: 3288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220124/2f3cbbba/attachment.bin>


More information about the libcxx-commits mailing list