aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/support_macros.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2012-07-03 15:48:25 -0700
committerDerek Schuff <dschuff@chromium.org>2012-07-03 15:48:25 -0700
commit4f429c8b4e06d750b5464b6eafdd102af5196bdd (patch)
tree22a752c4654e3ab9e94c09739f7fb8f9e705433d /include/llvm/Support/support_macros.h
parente91f926f3b76774aa7ed4c327fbde6a39e42c87f (diff)
Diff from hg rev 0b098ca44de7
Diffstat (limited to 'include/llvm/Support/support_macros.h')
-rw-r--r--include/llvm/Support/support_macros.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/llvm/Support/support_macros.h b/include/llvm/Support/support_macros.h
new file mode 100644
index 0000000000..83d62c722c
--- /dev/null
+++ b/include/llvm/Support/support_macros.h
@@ -0,0 +1,25 @@
+// Define support macros for defining classes, etc.
+
+#ifndef LLVM_SUPPORT_SUPPORT_MACROS_H__
+#define LLVM_SUPPORT_SUPPORT_MACROS_H__
+
+// Define macro, to use within a class declaration, to disallow constructor
+// copy. Defines copy constructor declaration under the assumption that it
+// is never defined.
+#define DISALLOW_CLASS_COPY(class_name) \
+ class_name(class_name& arg) // Do not implement
+
+// Define macro, to use within a class declaration, to disallow assignment.
+// Defines assignment operation declaration under the assumption that it
+// is never defined.
+#define DISALLOW_CLASS_ASSIGN(class_name) \
+ void operator=(class_name& arg) // Do not implement
+
+// Define macro to add copy and assignment declarations to a class file,
+// for which no bodies will be defined, effectively disallowing these from
+// being defined in the class.
+#define DISALLOW_CLASS_COPY_AND_ASSIGN(class_name) \
+ DISALLOW_CLASS_COPY(class_name); \
+ DISALLOW_CLASS_ASSIGN(class_name)
+
+#endif // LLVM_SUPPORT_SUPPORT_MACROS_H__