diff options
| author | Duncan Sands <baldrick@free.fr> | 2007-11-09 13:41:39 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2007-11-09 13:41:39 +0000 |
| commit | d2f53d1904d1e405a876eb1f7fcbffa4f34c4255 (patch) | |
| tree | 0baef1eaa4407d6f0c0ca5cce71812260eed808a | |
| parent | fd9af9d4d516a759fc378f81d356ba60e09bbbc8 (diff) | |
| download | external_llvm-d2f53d1904d1e405a876eb1f7fcbffa4f34c4255.zip external_llvm-d2f53d1904d1e405a876eb1f7fcbffa4f34c4255.tar.gz external_llvm-d2f53d1904d1e405a876eb1f7fcbffa4f34c4255.tar.bz2 | |
Move MinAlign to MathExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43944 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | include/llvm/Support/Alignment.h | 28 | ||||
| -rw-r--r-- | include/llvm/Support/MathExtras.h | 7 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 1 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 1 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp | 2 |
5 files changed, 8 insertions, 31 deletions
diff --git a/include/llvm/Support/Alignment.h b/include/llvm/Support/Alignment.h deleted file mode 100644 index 41259b6..0000000 --- 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 88a1103..3955735 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 diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 7a6e55e..8f6800a 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -37,7 +37,6 @@ #include "llvm/Target/TargetOptions.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/Alignment.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0731299..4e096d8 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -23,7 +23,6 @@ #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" -#include "llvm/Support/Alignment.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp index 8251341..b63bd8f 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp @@ -18,9 +18,9 @@ #include "llvm/DerivedTypes.h" #include "llvm/Target/TargetLowering.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/Support/Alignment.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" using namespace llvm; //===----------------------------------------------------------------------===// |
