Skip to content

Commit 5a7848f

Browse files
committed
Updating branches/google/testing to r289206
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/testing@289396 91177308-0d34-0410-b5e6-96231b3b80d8
2 parents f565ac9 + f6da5c0 commit 5a7848f

File tree

485 files changed

+26943
-6184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+26943
-6184
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
414414
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
415415
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
416416

417+
option(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
418+
"Disable abi-breaking checks mismatch detection at link-tim." OFF)
419+
417420
option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
418421
"Set to ON to force using an old, unsupported host toolchain." OFF)
419422

cmake/config-ix.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
7878

7979
check_include_file(mach/mach.h HAVE_MACH_MACH_H)
8080
check_include_file(histedit.h HAVE_HISTEDIT_H)
81+
check_include_file(CrashReporterClient.h HAVE_CRASHREPORTERCLIENT_H)
82+
if(APPLE)
83+
include(CheckCSourceCompiles)
84+
CHECK_C_SOURCE_COMPILES("
85+
static const char *__crashreporter_info__ = 0;
86+
asm(\".desc ___crashreporter_info__, 0x10\");
87+
int main() { return 0; }"
88+
HAVE_CRASHREPORTER_INFO)
89+
endif()
8190

8291
# library checks
8392
if( NOT PURE_WINDOWS )
@@ -164,6 +173,9 @@ endif()
164173
if( HAVE_SYS_UIO_H )
165174
check_symbol_exists(writev sys/uio.h HAVE_WRITEV)
166175
endif()
176+
set(CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE64_SOURCE")
177+
check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64)
178+
set(CMAKE_REQUIRED_DEFINITIONS "")
167179
check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL)
168180
check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
169181
check_symbol_exists(malloc_zone_statistics malloc/malloc.h

cmake/modules/AddLLVM.cmake

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,14 +1290,34 @@ endfunction()
12901290

12911291
function(add_llvm_tool_symlink link_name target)
12921292
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "OUTPUT_DIR" "" ${ARGN})
1293+
# This got a bit gross... For multi-configuration generators the target
1294+
# properties return the resolved value of the string, not the build system
1295+
# expression. To reconstruct the platform-agnostic path we have to do some
1296+
# magic. First we grab one of the types, and a type-specific path. Then from
1297+
# the type-specific path we find the last occurrence of the type in the path,
1298+
# and replace it with CMAKE_CFG_INTDIR. This allows the build step to be type
1299+
# agnostic again.
12931300
if(NOT ARG_OUTPUT_DIR)
1301+
if(CMAKE_CONFIGURATION_TYPES)
1302+
list(GET CMAKE_CONFIGURATION_TYPES 0 first_type)
1303+
string(TOUPPER ${first_type} first_type_upper)
1304+
set(first_type_suffix _${first_type_upper})
1305+
endif()
12941306
get_target_property(target_type ${target} TYPE)
12951307
if(${target_type} STREQUAL "STATIC_LIBRARY")
1296-
get_target_property(ARG_OUTPUT_DIR ${target} ARCHIVE_OUTPUT_DIRECTORY)
1308+
get_target_property(ARG_OUTPUT_DIR ${target} ARCHIVE_OUTPUT_DIRECTORY${first_type_suffix})
12971309
elseif(UNIX AND ${target_type} STREQUAL "SHARED_LIBRARY")
1298-
get_target_property(ARG_OUTPUT_DIR ${target} LIBRARY_OUTPUT_DIRECTORY)
1310+
get_target_property(ARG_OUTPUT_DIR ${target} LIBRARY_OUTPUT_DIRECTORY${first_type_suffix})
12991311
else()
1300-
get_target_property(ARG_OUTPUT_DIR ${target} RUNTIME_OUTPUT_DIRECTORY)
1312+
get_target_property(ARG_OUTPUT_DIR ${target} RUNTIME_OUTPUT_DIRECTORY${first_type_suffix})
1313+
endif()
1314+
if(CMAKE_CONFIGURATION_TYPES)
1315+
string(FIND "${ARG_OUTPUT_DIR}" "/${first_type}/" type_start REVERSE)
1316+
string(SUBSTRING "${ARG_OUTPUT_DIR}" 0 ${type_start} path_prefix)
1317+
string(SUBSTRING "${ARG_OUTPUT_DIR}" ${type_start} -1 path_suffix)
1318+
string(REPLACE "/${first_type}/" "/${CMAKE_CFG_INTDIR}/"
1319+
path_suffix ${path_suffix})
1320+
set(ARG_OUTPUT_DIR ${path_prefix}${path_suffix})
13011321
endif()
13021322
endif()
13031323

cmake/modules/TableGen.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44

55
include(LLVMExternalProjectUtils)
66

7+
if(LLVM_MAIN_INCLUDE_DIR)
8+
set(LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_INCLUDE_DIR})
9+
endif()
10+
711
function(tablegen project ofn)
812
# Validate calling context.
9-
foreach(v
10-
${project}_TABLEGEN_EXE
11-
LLVM_MAIN_SRC_DIR
12-
LLVM_MAIN_INCLUDE_DIR
13-
)
14-
if(NOT ${v})
15-
message(FATAL_ERROR "${v} not set")
16-
endif()
17-
endforeach()
13+
if(NOT ${project}_TABLEGEN_EXE)
14+
message(FATAL_ERROR "${project}_TABLEGEN_EXE not set")
15+
endif()
1816

1917
file(GLOB local_tds "*.td")
2018
file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
@@ -28,7 +26,7 @@ function(tablegen project ofn)
2826
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
2927
# Generate tablegen output in a temporary file.
3028
COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
31-
-I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
29+
${LLVM_TABLEGEN_FLAGS}
3230
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
3331
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
3432
# The file in LLVM_TARGET_DEFINITIONS may be not in the current

docs/LangRef.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4589,6 +4589,25 @@ Examples:
45894589
!2 = !{ i8 0, i8 2, i8 3, i8 6 }
45904590
!3 = !{ i8 -2, i8 0, i8 3, i8 6 }
45914591
4592+
'``absolute_symbol``' Metadata
4593+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4594+
4595+
``absolute_symbol`` metadata may be attached to a global variable
4596+
declaration. It marks the declaration as a reference to an absolute symbol,
4597+
which causes the backend to use absolute relocations for the symbol even
4598+
in position independent code, and expresses the possible ranges that the
4599+
global variable's *address* (not its value) is in, in the same format as
4600+
``range`` metadata.
4601+
4602+
Example:
4603+
4604+
.. code-block:: llvm
4605+
4606+
@a = external global i8, !absolute_symbol !0 ; Absolute symbol in range [0,256)
4607+
4608+
...
4609+
!0 = !{ i64 0, i64 256 }
4610+
45924611
'``unpredictable``' Metadata
45934612
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45944613

examples/HowToUseJIT/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ set(LLVM_LINK_COMPONENTS
22
Core
33
ExecutionEngine
44
Interpreter
5-
MC
65
Support
76
nativecodegen
87
)

include/llvm/ADT/BitVector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <cstdint>
2222
#include <cstdlib>
2323
#include <cstring>
24+
#include <utility>
2425

2526
namespace llvm {
2627

@@ -45,14 +46,13 @@ class BitVector {
4546
BitWord *WordRef;
4647
unsigned BitPos;
4748

48-
reference(); // Undefined
49-
5049
public:
5150
reference(BitVector &b, unsigned Idx) {
5251
WordRef = &b.Bits[Idx / BITWORD_SIZE];
5352
BitPos = Idx % BITWORD_SIZE;
5453
}
5554

55+
reference() = delete;
5656
reference(const reference&) = default;
5757

5858
reference &operator=(reference t) {

include/llvm/ADT/ImmutableList.h

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,28 @@
1616

1717
#include "llvm/ADT/FoldingSet.h"
1818
#include "llvm/Support/Allocator.h"
19-
#include "llvm/Support/DataTypes.h"
2019
#include <cassert>
20+
#include <cstdint>
21+
#include <new>
2122

2223
namespace llvm {
2324

2425
template <typename T> class ImmutableListFactory;
2526

2627
template <typename T>
2728
class ImmutableListImpl : public FoldingSetNode {
29+
friend class ImmutableListFactory<T>;
30+
2831
T Head;
2932
const ImmutableListImpl* Tail;
3033

3134
ImmutableListImpl(const T& head, const ImmutableListImpl* tail = nullptr)
3235
: Head(head), Tail(tail) {}
3336

34-
friend class ImmutableListFactory<T>;
35-
36-
void operator=(const ImmutableListImpl&) = delete;
37-
ImmutableListImpl(const ImmutableListImpl&) = delete;
38-
3937
public:
38+
ImmutableListImpl(const ImmutableListImpl &) = delete;
39+
ImmutableListImpl &operator=(const ImmutableListImpl &) = delete;
40+
4041
const T& getHead() const { return Head; }
4142
const ImmutableListImpl* getTail() const { return Tail; }
4243

@@ -79,15 +80,17 @@ class ImmutableList {
7980
}
8081

8182
class iterator {
82-
const ImmutableListImpl<T>* L;
83+
const ImmutableListImpl<T>* L = nullptr;
84+
8385
public:
84-
iterator() : L(nullptr) {}
86+
iterator() = default;
8587
iterator(ImmutableList l) : L(l.getInternalPointer()) {}
8688

8789
iterator& operator++() { L = L->getTail(); return *this; }
8890
bool operator==(const iterator& I) const { return L == I.L; }
8991
bool operator!=(const iterator& I) const { return L != I.L; }
9092
const value_type& operator*() const { return L->getHead(); }
93+
9194
ImmutableList getList() const { return L; }
9295
};
9396

@@ -121,7 +124,7 @@ class ImmutableList {
121124

122125
/// getHead - Returns the head of the list.
123126
const T& getHead() {
124-
assert (!isEmpty() && "Cannot get the head of an empty list.");
127+
assert(!isEmpty() && "Cannot get the head of an empty list.");
125128
return X->getHead();
126129
}
127130

@@ -145,7 +148,7 @@ class ImmutableListFactory {
145148
uintptr_t Allocator;
146149

147150
bool ownsAllocator() const {
148-
return Allocator & 0x1 ? false : true;
151+
return (Allocator & 0x1) == 0;
149152
}
150153

151154
BumpPtrAllocator& getAllocator() const {
@@ -203,27 +206,30 @@ class ImmutableListFactory {
203206
//===----------------------------------------------------------------------===//
204207

205208
template<typename T> struct DenseMapInfo;
206-
template<typename T> struct DenseMapInfo<ImmutableList<T> > {
209+
template<typename T> struct DenseMapInfo<ImmutableList<T>> {
207210
static inline ImmutableList<T> getEmptyKey() {
208211
return reinterpret_cast<ImmutableListImpl<T>*>(-1);
209212
}
213+
210214
static inline ImmutableList<T> getTombstoneKey() {
211215
return reinterpret_cast<ImmutableListImpl<T>*>(-2);
212216
}
217+
213218
static unsigned getHashValue(ImmutableList<T> X) {
214219
uintptr_t PtrVal = reinterpret_cast<uintptr_t>(X.getInternalPointer());
215220
return (unsigned((uintptr_t)PtrVal) >> 4) ^
216221
(unsigned((uintptr_t)PtrVal) >> 9);
217222
}
223+
218224
static bool isEqual(ImmutableList<T> X1, ImmutableList<T> X2) {
219225
return X1 == X2;
220226
}
221227
};
222228

223229
template <typename T> struct isPodLike;
224230
template <typename T>
225-
struct isPodLike<ImmutableList<T> > { static const bool value = true; };
231+
struct isPodLike<ImmutableList<T>> { static const bool value = true; };
226232

227-
} // end llvm namespace
233+
} // end namespace llvm
228234

229235
#endif // LLVM_ADT_IMMUTABLELIST_H

include/llvm/ADT/ImmutableMap.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
#ifndef LLVM_ADT_IMMUTABLEMAP_H
1515
#define LLVM_ADT_IMMUTABLEMAP_H
1616

17+
#include "llvm/ADT/FoldingSet.h"
1718
#include "llvm/ADT/ImmutableSet.h"
19+
#include "llvm/Support/Allocator.h"
20+
#include <utility>
1821

1922
namespace llvm {
2023

@@ -56,7 +59,7 @@ struct ImutKeyValueInfo {
5659
};
5760

5861
template <typename KeyT, typename ValT,
59-
typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
62+
typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
6063
class ImmutableMap {
6164
public:
6265
typedef typename ValInfo::value_type value_type;
@@ -106,6 +109,9 @@ class ImmutableMap {
106109
Factory(BumpPtrAllocator &Alloc, bool canonicalize = true)
107110
: F(Alloc), Canonicalize(canonicalize) {}
108111

112+
Factory(const Factory &) = delete;
113+
Factory &operator=(const Factory &) = delete;
114+
109115
ImmutableMap getEmptyMap() { return ImmutableMap(F.getEmptyTree()); }
110116

111117
ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
@@ -121,10 +127,6 @@ class ImmutableMap {
121127
typename TreeTy::Factory *getTreeFactory() const {
122128
return const_cast<typename TreeTy::Factory *>(&F);
123129
}
124-
125-
private:
126-
Factory(const Factory& RHS) = delete;
127-
void operator=(const Factory& RHS) = delete;
128130
};
129131

130132
bool contains(key_type_ref K) const {
@@ -203,9 +205,10 @@ class ImmutableMap {
203205
//===--------------------------------------------------===//
204206

205207
class iterator : public ImutAVLValueIterator<ImmutableMap> {
208+
friend class ImmutableMap;
209+
206210
iterator() = default;
207211
explicit iterator(TreeTy *Tree) : iterator::ImutAVLValueIterator(Tree) {}
208-
friend class ImmutableMap;
209212

210213
public:
211214
key_type_ref getKey() const { return (*this)->first; }
@@ -248,7 +251,7 @@ class ImmutableMap {
248251

249252
// NOTE: This will possibly become the new implementation of ImmutableMap some day.
250253
template <typename KeyT, typename ValT,
251-
typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
254+
typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
252255
class ImmutableMapRef {
253256
public:
254257
typedef typename ValInfo::value_type value_type;
@@ -362,9 +365,10 @@ class ImmutableMapRef {
362365
//===--------------------------------------------------===//
363366

364367
class iterator : public ImutAVLValueIterator<ImmutableMapRef> {
368+
friend class ImmutableMapRef;
369+
365370
iterator() = default;
366371
explicit iterator(TreeTy *Tree) : iterator::ImutAVLValueIterator(Tree) {}
367-
friend class ImmutableMapRef;
368372

369373
public:
370374
key_type_ref getKey() const { return (*this)->first; }

include/llvm/ADT/PackedVector.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define LLVM_ADT_PACKEDVECTOR_H
1616

1717
#include "llvm/ADT/BitVector.h"
18+
#include <cassert>
1819
#include <limits>
1920

2021
namespace llvm {
@@ -83,14 +84,15 @@ class PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
8384
PackedVector &Vec;
8485
const unsigned Idx;
8586

86-
reference(); // Undefined
8787
public:
88+
reference() = delete;
8889
reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) {}
8990

9091
reference &operator=(T val) {
9192
Vec.setValue(Vec.Bits, Idx, val);
9293
return *this;
9394
}
95+
9496
operator T() const {
9597
return Vec.getValue(Vec.Bits, Idx);
9698
}
@@ -144,6 +146,6 @@ class PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
144146
// Leave BitNum=0 undefined.
145147
template <typename T> class PackedVector<T, 0>;
146148

147-
} // end llvm namespace
149+
} // end namespace llvm
148150

149-
#endif
151+
#endif // LLVM_ADT_PACKEDVECTOR_H

0 commit comments

Comments
 (0)