[llvm-commits] [llvm] r111128 - /llvm/trunk/include/llvm/ADT/FoldingSet.h

Dan Gohman gohman at apple.com
Mon Aug 16 08:03:24 PDT 2010


Author: djg
Date: Mon Aug 16 10:03:24 2010
New Revision: 111128

URL: http://llvm.org/viewvc/llvm-project?rev=111128&view=rev
Log:
Constify FoldingSetNodeIDRef's Data.

Modified:
    llvm/trunk/include/llvm/ADT/FoldingSet.h

Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=111128&r1=111127&r2=111128&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Aug 16 10:03:24 2010
@@ -217,13 +217,13 @@
 /// is often much larger than necessary, and the possibility of heap
 /// allocation means it requires a non-trivial destructor call.
 class FoldingSetNodeIDRef {
-  unsigned* Data;
+  const unsigned* Data;
   size_t Size;
 public:
   FoldingSetNodeIDRef() : Data(0), Size(0) {}
-  FoldingSetNodeIDRef(unsigned *D, size_t S) : Data(D), Size(S) {}
+  FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {}
 
-  unsigned *getData() const { return Data; }
+  const unsigned *getData() const { return Data; }
   size_t getSize() const { return Size; }
 };
 





More information about the llvm-commits mailing list