aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-09 13:41:39 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-09 13:41:39 +0000
commitfd617d0143a158bc1c996445262d409280e7b0cc (patch)
tree0baef1eaa4407d6f0c0ca5cce71812260eed808a /include/llvm/Support
parent20a990e16e0d6b4d676bfc02bfe840a3fa6c33bd (diff)
Move MinAlign to MathExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43944 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/Alignment.h28
-rw-r--r--include/llvm/Support/MathExtras.h7
2 files changed, 7 insertions, 28 deletions
diff --git a/include/llvm/Support/Alignment.h b/include/llvm/Support/Alignment.h
deleted file mode 100644
index 41259b69ba..0000000000
--- a/include/llvm/Support/Alignment.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------- Alignment.h - Alignment computation ------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file was developed by Duncan Sands and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines utilities for computing alignments.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_ALIGNMENT_H
-#define LLVM_SUPPORT_ALIGNMENT_H
-
-namespace llvm {
-
-/// MinAlign - A and B are either alignments or offsets. Return the minimum
-/// alignment that may be assumed after adding the two together.
-
-static inline unsigned MinAlign(unsigned A, unsigned B) {
- // The largest power of 2 that divides both A and B.
- return (A | B) & -(A | B);
-}
-
-} // end namespace llvm
-#endif
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 88a110395d..3955735d0b 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -358,6 +358,13 @@ int IsNAN(double d);
int IsInf(float f);
int IsInf(double d);
+/// MinAlign - A and B are either alignments or offsets. Return the minimum
+/// alignment that may be assumed after adding the two together.
+static inline unsigned MinAlign(unsigned A, unsigned B) {
+ // The largest power of 2 that divides both A and B.
+ return (A | B) & -(A | B);
+}
+
} // End llvm namespace
#endif