diff options
author | Jush Lu <jush.msn@gmail.com> | 2011-03-09 19:39:16 +0800 |
---|---|---|
committer | Jush Lu <jush.msn@gmail.com> | 2011-03-09 19:39:16 +0800 |
commit | b5530586d68bd25831a6796b5d3199cb0769a35c (patch) | |
tree | fac4a03b53b6a64b0c00f433e4d8b3c9f2bc67cd /include/llvm/Object/ObjectFile.h | |
parent | b4e17c5bf4361bbdeced39aa071150d7fa9c3c10 (diff) | |
parent | d01f50f42ce60207ed6d27fb1778e456d83be06c (diff) | |
download | external_llvm-b5530586d68bd25831a6796b5d3199cb0769a35c.zip external_llvm-b5530586d68bd25831a6796b5d3199cb0769a35c.tar.gz external_llvm-b5530586d68bd25831a6796b5d3199cb0769a35c.tar.bz2 |
Merge upstream r127116
Diffstat (limited to 'include/llvm/Object/ObjectFile.h')
-rw-r--r-- | include/llvm/Object/ObjectFile.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index ca51581..eee9d44 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -15,7 +15,8 @@ #define LLVM_OBJECT_OBJECT_FILE_H #include "llvm/ADT/StringRef.h" -#include "llvm/System/DataTypes.h" +#include "llvm/Support/DataTypes.h" +#include <cstring> namespace llvm { @@ -25,7 +26,19 @@ class StringRef; namespace object { class ObjectFile; -typedef uint64_t DataRefImpl; + +union DataRefImpl { + struct { + uint32_t a, b; + } d; + intptr_t p; +}; + +static bool operator ==(const DataRefImpl &a, const DataRefImpl &b) { + // Check bitwise identical. This is the only legal way to compare a union w/o + // knowing which member is in use. + return std::memcmp(&a, &b, sizeof(DataRefImpl)) == 0; +} /// SymbolRef - This is a value type class that represents a single symbol in /// the list of symbols in the object file. |