Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: tools/clang/scripts/update.sh

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # This script will check out llvm and clang into third_party/llvm and build it. 6 # This script will check out llvm and clang into third_party/llvm and build it.
7 7
8 # Do NOT CHANGE this if you don't know what you're doing -- see 8 # Do NOT CHANGE this if you don't know what you're doing -- see
9 # https://code.google.com/p/chromium/wiki/UpdatingClang 9 # https://code.google.com/p/chromium/wiki/UpdatingClang
10 # Reverting problematic clang rolls is safe, though. 10 # Reverting problematic clang rolls is safe, though.
11 CLANG_REVISION=223108 11 CLANG_REVISION=231191
12
13 # This is incremented when pushing a new build of Clang at the same revision.
14 CLANG_SUB_REVISION=1
15
16 PACKAGE_VERSION="${CLANG_REVISION}-${CLANG_SUB_REVISION}"
12 17
13 THIS_DIR="$(dirname "${0}")" 18 THIS_DIR="$(dirname "${0}")"
14 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" 19 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm"
15 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" 20 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts"
16 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" 21 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt"
17 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap" 22 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap"
18 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install" 23 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install"
19 CLANG_DIR="${LLVM_DIR}/tools/clang" 24 CLANG_DIR="${LLVM_DIR}/tools/clang"
20 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt" 25 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt"
21 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx" 26 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx"
22 LIBCXXABI_DIR="${LLVM_DIR}/projects/libcxxabi" 27 LIBCXXABI_DIR="${LLVM_DIR}/projects/libcxxabi"
23 ANDROID_NDK_DIR="${THIS_DIR}/../../../third_party/android_tools/ndk" 28 ANDROID_NDK_DIR="${THIS_DIR}/../../../third_party/android_tools/ndk"
24 STAMP_FILE="${LLVM_DIR}/../llvm-build/cr_build_revision" 29 STAMP_FILE="${LLVM_DIR}/../llvm-build/cr_build_revision"
25 CHROMIUM_TOOLS_DIR="${THIS_DIR}/.." 30 CHROMIUM_TOOLS_DIR="${THIS_DIR}/.."
31 BINUTILS_DIR="${THIS_DIR}/../../../third_party/binutils"
26 32
27 ABS_CHROMIUM_TOOLS_DIR="${PWD}/${CHROMIUM_TOOLS_DIR}" 33 ABS_CHROMIUM_TOOLS_DIR="${PWD}/${CHROMIUM_TOOLS_DIR}"
28 ABS_LIBCXX_DIR="${PWD}/${LIBCXX_DIR}" 34 ABS_LIBCXX_DIR="${PWD}/${LIBCXX_DIR}"
29 ABS_LIBCXXABI_DIR="${PWD}/${LIBCXXABI_DIR}" 35 ABS_LIBCXXABI_DIR="${PWD}/${LIBCXXABI_DIR}"
30 ABS_LLVM_DIR="${PWD}/${LLVM_DIR}" 36 ABS_LLVM_DIR="${PWD}/${LLVM_DIR}"
31 ABS_LLVM_BUILD_DIR="${PWD}/${LLVM_BUILD_DIR}" 37 ABS_LLVM_BUILD_DIR="${PWD}/${LLVM_BUILD_DIR}"
32 ABS_COMPILER_RT_DIR="${PWD}/${COMPILER_RT_DIR}" 38 ABS_COMPILER_RT_DIR="${PWD}/${COMPILER_RT_DIR}"
39 ABS_BINUTILS_DIR="${PWD}/${BINUTILS_DIR}"
33 40
34 # ${A:-a} returns $A if it's set, a else. 41 # ${A:-a} returns $A if it's set, a else.
35 LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project} 42 LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project}
36 43
44 CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang
45
37 if [[ -z "$GYP_DEFINES" ]]; then 46 if [[ -z "$GYP_DEFINES" ]]; then
38 GYP_DEFINES= 47 GYP_DEFINES=
39 fi 48 fi
40 if [[ -z "$GYP_GENERATORS" ]]; then 49 if [[ -z "$GYP_GENERATORS" ]]; then
41 GYP_GENERATORS= 50 GYP_GENERATORS=
42 fi 51 fi
43 52
44 53
45 # Die if any command dies, error on undefined variable expansions. 54 # Die if any command dies, error on undefined variable expansions.
46 set -eu 55 set -eu
47 56
48 57
49 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then 58 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
50 # Use a real version number rather than HEAD to make sure that 59 # Use a real version number rather than HEAD to make sure that
51 # --print-revision, stamp file logic, etc. all works naturally. 60 # --print-revision, stamp file logic, etc. all works naturally.
52 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \ 61 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \
53 | grep 'Last Changed Rev' | awk '{ printf $4; }') 62 | grep 'Last Changed Rev' | awk '{ printf $4; }')
63 PACKAGE_VERSION="${CLANG_REVISION}-0"
54 fi 64 fi
55 65
56 # Use both the clang revision and the plugin revisions to test for updates. 66 # Use both the clang revision and the plugin revisions to test for updates.
57 BLINKGCPLUGIN_REVISION=\ 67 BLINKGCPLUGIN_REVISION=\
58 $(grep 'set(LIBRARYNAME' "$THIS_DIR"/../blink_gc_plugin/CMakeLists.txt \ 68 $(grep 'set(LIBRARYNAME' "$THIS_DIR"/../blink_gc_plugin/CMakeLists.txt \
59 | cut -d ' ' -f 2 | tr -cd '[0-9]') 69 | cut -d ' ' -f 2 | tr -cd '[0-9]')
60 CLANG_AND_PLUGINS_REVISION="${CLANG_REVISION}-${BLINKGCPLUGIN_REVISION}" 70 CLANG_AND_PLUGINS_REVISION="${CLANG_REVISION}-${BLINKGCPLUGIN_REVISION}"
61 71
62 72
63 OS="$(uname -s)" 73 OS="$(uname -s)"
(...skipping 17 matching lines...) Expand all
81 --bootstrap) 91 --bootstrap)
82 bootstrap=yes 92 bootstrap=yes
83 ;; 93 ;;
84 --if-needed) 94 --if-needed)
85 if_needed=yes 95 if_needed=yes
86 ;; 96 ;;
87 --force-local-build) 97 --force-local-build)
88 force_local_build=yes 98 force_local_build=yes
89 ;; 99 ;;
90 --print-revision) 100 --print-revision)
91 echo $CLANG_REVISION 101 echo $PACKAGE_VERSION
92 exit 0 102 exit 0
93 ;; 103 ;;
94 --run-tests) 104 --run-tests)
95 run_tests=yes 105 run_tests=yes
96 ;; 106 ;;
97 --without-android) 107 --without-android)
98 with_android= 108 with_android=
99 ;; 109 ;;
100 --without-patches) 110 --without-patches)
101 with_patches= 111 with_patches=
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 force_local_build=yes 164 force_local_build=yes
155 165
156 # Skip local patches when using HEAD: they probably don't apply anymore. 166 # Skip local patches when using HEAD: they probably don't apply anymore.
157 with_patches= 167 with_patches=
158 168
159 if ! [[ "$GYP_DEFINES" =~ .*OS=android.* ]]; then 169 if ! [[ "$GYP_DEFINES" =~ .*OS=android.* ]]; then
160 # Only build the Android ASan rt when targetting Android. 170 # Only build the Android ASan rt when targetting Android.
161 with_android= 171 with_android=
162 fi 172 fi
163 173
174 LLVM_BUILD_TOOLS_DIR="${ABS_LLVM_DIR}/../llvm-build-tools"
175
176 if [[ "${OS}" == "Linux" ]] && [[ -z "${gcc_toolchain}" ]]; then
177 if [[ $(gcc -dumpversion) < "4.7.0" ]]; then
178 # We need a newer GCC version.
179 if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/gcc482" ]]; then
180 echo "Downloading pre-built GCC 4.8.2..."
181 mkdir -p "${LLVM_BUILD_TOOLS_DIR}"
182 curl --fail -L "${CDS_URL}/tools/gcc482.tgz" | \
183 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}"
184 echo Done
185 fi
186 gcc_toolchain="${LLVM_BUILD_TOOLS_DIR}/gcc482"
187 else
188 # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++.
189 gcc_toolchain="$(dirname $(dirname $(which gcc)))"
190 fi
191 fi
192
193 if [[ "${OS}" == "Linux" ]]; then
194 # TODO(hans): Might need to make this work on Mac eventually.
195 if [[ $(cmake --version | grep -Eo '[0-9.]+') < "3.0" ]]; then
196 # We need a newer CMake version.
197 if [[ ! -e "${LLVM_BUILD_TOOLS_DIR}/cmake310" ]]; then
198 echo "Downloading pre-built CMake 3.10..."
199 mkdir -p "${LLVM_BUILD_TOOLS_DIR}"
200 curl --fail -L "${CDS_URL}/tools/cmake310.tgz" | \
201 tar zxf - -C "${LLVM_BUILD_TOOLS_DIR}"
202 echo Done
203 fi
204 export PATH="${LLVM_BUILD_TOOLS_DIR}/cmake310/bin:${PATH}"
205 fi
206 fi
207
164 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}" 208 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}"
165 fi 209 fi
166 210
167 if [[ -n "$if_needed" ]]; then 211 if [[ -n "$if_needed" ]]; then
168 if [[ "${OS}" == "Darwin" ]]; then 212 if [[ "${OS}" == "Darwin" ]]; then
169 # clang is used on Mac. 213 # clang is used on Mac.
170 true 214 true
171 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then 215 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then
172 # clang requested via $GYP_DEFINES. 216 # clang requested via $GYP_DEFINES.
173 true 217 true
(...skipping 12 matching lines...) Expand all
186 exit 0 230 exit 0
187 fi 231 fi
188 fi 232 fi
189 233
190 234
191 # Check if there's anything to be done, exit early if not. 235 # Check if there's anything to be done, exit early if not.
192 if [[ -f "${STAMP_FILE}" ]]; then 236 if [[ -f "${STAMP_FILE}" ]]; then
193 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}") 237 PREVIOUSLY_BUILT_REVISON=$(cat "${STAMP_FILE}")
194 if [[ -z "$force_local_build" ]] && \ 238 if [[ -z "$force_local_build" ]] && \
195 [[ "${PREVIOUSLY_BUILT_REVISON}" = \ 239 [[ "${PREVIOUSLY_BUILT_REVISON}" = \
196 "${CLANG_AND_PLUGINS_REVISION}" ]]; then 240 "${PACKAGE_VERSION}" ]]; then
197 echo "Clang already at ${CLANG_AND_PLUGINS_REVISION}" 241 echo "Clang already at ${PACKAGE_VERSION}"
198 exit 0 242 exit 0
199 fi 243 fi
200 fi 244 fi
201 # To always force a new build if someone interrupts their build half way. 245 # To always force a new build if someone interrupts their build half way.
202 rm -f "${STAMP_FILE}" 246 rm -f "${STAMP_FILE}"
203 247
204 248
205 if [[ -z "$force_local_build" ]]; then 249 if [[ -z "$force_local_build" ]]; then
206 # Check if there's a prebuilt binary and if so just fetch that. That's faster, 250 # Check if there's a prebuilt binary and if so just fetch that. That's faster,
207 # and goma relies on having matching binary hashes on client and server too. 251 # and goma relies on having matching binary hashes on client and server too.
208 CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang 252 CDS_FILE="clang-${PACKAGE_VERSION}.tgz"
209 CDS_FILE="clang-${CLANG_REVISION}.tgz"
210 CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX) 253 CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
211 CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}" 254 CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
212 if [ "${OS}" = "Linux" ]; then 255 if [ "${OS}" = "Linux" ]; then
213 CDS_FULL_URL="${CDS_URL}/Linux_x64/${CDS_FILE}" 256 CDS_FULL_URL="${CDS_URL}/Linux_x64/${CDS_FILE}"
214 elif [ "${OS}" = "Darwin" ]; then 257 elif [ "${OS}" = "Darwin" ]; then
215 CDS_FULL_URL="${CDS_URL}/Mac/${CDS_FILE}" 258 CDS_FULL_URL="${CDS_URL}/Mac/${CDS_FILE}"
216 fi 259 fi
217 echo Trying to download prebuilt clang 260 echo Trying to download prebuilt clang
218 if which curl > /dev/null; then 261 if which curl > /dev/null; then
219 curl -L --fail "${CDS_FULL_URL}" -o "${CDS_OUTPUT}" || \ 262 curl -L --fail "${CDS_FULL_URL}" -o "${CDS_OUTPUT}" || \
220 rm -rf "${CDS_OUT_DIR}" 263 rm -rf "${CDS_OUT_DIR}"
221 elif which wget > /dev/null; then 264 elif which wget > /dev/null; then
222 wget "${CDS_FULL_URL}" -O "${CDS_OUTPUT}" || rm -rf "${CDS_OUT_DIR}" 265 wget "${CDS_FULL_URL}" -O "${CDS_OUTPUT}" || rm -rf "${CDS_OUT_DIR}"
223 else 266 else
224 echo "Neither curl nor wget found. Please install one of these." 267 echo "Neither curl nor wget found. Please install one of these."
225 exit 1 268 exit 1
226 fi 269 fi
227 if [ -f "${CDS_OUTPUT}" ]; then 270 if [ -f "${CDS_OUTPUT}" ]; then
228 rm -rf "${LLVM_BUILD_DIR}" 271 rm -rf "${LLVM_BUILD_DIR}"
229 mkdir -p "${LLVM_BUILD_DIR}" 272 mkdir -p "${LLVM_BUILD_DIR}"
230 tar -xzf "${CDS_OUTPUT}" -C "${LLVM_BUILD_DIR}" 273 tar -xzf "${CDS_OUTPUT}" -C "${LLVM_BUILD_DIR}"
231 echo clang "${CLANG_REVISION}" unpacked 274 echo clang "${PACKAGE_VERSION}" unpacked
232 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" 275 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
233 rm -rf "${CDS_OUT_DIR}" 276 rm -rf "${CDS_OUT_DIR}"
234 exit 0 277 exit 0
235 else 278 else
236 echo Did not find prebuilt clang at r"${CLANG_REVISION}", building 279 echo Did not find prebuilt clang "${PACKAGE_VERSION}", building
237 fi 280 fi
238 fi 281 fi
239 282
240 if [[ -n "${with_android}" ]] && ! [[ -d "${ANDROID_NDK_DIR}" ]]; then 283 if [[ -n "${with_android}" ]] && ! [[ -d "${ANDROID_NDK_DIR}" ]]; then
241 echo "Android NDK not found at ${ANDROID_NDK_DIR}" 284 echo "Android NDK not found at ${ANDROID_NDK_DIR}"
242 echo "The Android NDK is needed to build a Clang whose -fsanitize=address" 285 echo "The Android NDK is needed to build a Clang whose -fsanitize=address"
243 echo "works on Android. See " 286 echo "works on Android. See "
244 echo "http://code.google.com/p/chromium/wiki/AndroidBuildInstructions for how" 287 echo "http://code.google.com/p/chromium/wiki/AndroidBuildInstructions for how"
245 echo "to install the NDK, or pass --without-android." 288 echo "to install the NDK, or pass --without-android."
246 exit 1 289 exit 1
(...skipping 23 matching lines...) Expand all
270 "${CLANG_DIR}/lib/Frontend/InitPreprocessor.cpp" \ 313 "${CLANG_DIR}/lib/Frontend/InitPreprocessor.cpp" \
271 "${CLANG_DIR}/test/Frontend/exceptions.c" \ 314 "${CLANG_DIR}/test/Frontend/exceptions.c" \
272 "${CLANG_DIR}/test/Preprocessor/predefined-exceptions.m" \ 315 "${CLANG_DIR}/test/Preprocessor/predefined-exceptions.m" \
273 "${LLVM_DIR}/test/Bindings/Go/go.test" \ 316 "${LLVM_DIR}/test/Bindings/Go/go.test" \
274 "${CLANG_DIR}/lib/Parse/ParseExpr.cpp" \ 317 "${CLANG_DIR}/lib/Parse/ParseExpr.cpp" \
275 "${CLANG_DIR}/lib/Parse/ParseTemplate.cpp" \ 318 "${CLANG_DIR}/lib/Parse/ParseTemplate.cpp" \
276 "${CLANG_DIR}/lib/Sema/SemaDeclCXX.cpp" \ 319 "${CLANG_DIR}/lib/Sema/SemaDeclCXX.cpp" \
277 "${CLANG_DIR}/lib/Sema/SemaExprCXX.cpp" \ 320 "${CLANG_DIR}/lib/Sema/SemaExprCXX.cpp" \
278 "${CLANG_DIR}/test/SemaCXX/default2.cpp" \ 321 "${CLANG_DIR}/test/SemaCXX/default2.cpp" \
279 "${CLANG_DIR}/test/SemaCXX/typo-correction-delayed.cpp" \ 322 "${CLANG_DIR}/test/SemaCXX/typo-correction-delayed.cpp" \
323 "${COMPILER_RT_DIR}/lib/sanitizer_common/sanitizer_stoptheworld_linux_libc dep.cc" \
324 "${COMPILER_RT_DIR}/test/tsan/signal_segv_handler.cc" \
280 ; do 325 ; do
281 if [[ -e "${i}" ]]; then 326 if [[ -e "${i}" ]]; then
282 rm -f "${i}" # For unversioned files. 327 rm -f "${i}" # For unversioned files.
283 svn revert "${i}" 328 svn revert "${i}"
284 fi; 329 fi;
285 done 330 done
286 331
287 echo Remove the Clang tools shim dir 332 echo Remove the Clang tools shim dir
288 CHROME_TOOLS_SHIM_DIR=${ABS_LLVM_DIR}/tools/chrometools 333 CHROME_TOOLS_SHIM_DIR=${ABS_LLVM_DIR}/tools/chrometools
289 rm -rfv ${CHROME_TOOLS_SHIM_DIR} 334 rm -rfv ${CHROME_TOOLS_SHIM_DIR}
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 397
353 -TEST_F(LibclangReparseTest, ReparseWithModule) { 398 -TEST_F(LibclangReparseTest, ReparseWithModule) {
354 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { 399 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
355 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; 400 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
356 const char *HeaderBottom = "\n};\n#endif\n"; 401 const char *HeaderBottom = "\n};\n#endif\n";
357 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" 402 const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
358 EOF 403 EOF
359 patch -p0 404 patch -p0
360 popd 405 popd
361 406
362 # Apply r223211: "Revert r222997."
363 pushd "${LLVM_DIR}"
364 cat << 'EOF' |
365 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
366 +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
367 @@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySan itizerVisitor> {
368 Value *OriginPtr =
369 getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
370 setOrigin(A, EntryIRB.CreateLoad(OriginPtr));
371 - } else {
372 - setOrigin(A, getCleanOrigin());
373 }
374 }
375 ArgOffset += RoundUpToAlignment(Size, kShadowTLSAlignment);
376 @@ -942,13 +940,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> {
377 /// \brief Get the origin for a value.
378 Value *getOrigin(Value *V) {
379 if (!MS.TrackOrigins) return nullptr;
380 - if (!PropagateShadow) return getCleanOrigin();
381 - if (isa<Constant>(V)) return getCleanOrigin();
382 - assert((isa<Instruction>(V) || isa<Argument>(V)) &&
383 - "Unexpected value type in getOrigin()");
384 - Value *Origin = OriginMap[V];
385 - assert(Origin && "Missing origin");
386 - return Origin;
387 + if (isa<Instruction>(V) || isa<Argument>(V)) {
388 + Value *Origin = OriginMap[V];
389 + if (!Origin) {
390 + DEBUG(dbgs() << "NO ORIGIN: " << *V << "\n");
391 + Origin = getCleanOrigin();
392 + }
393 + return Origin;
394 + }
395 + return getCleanOrigin();
396 }
397
398 /// \brief Get the origin for i-th argument of the instruction I.
399 @@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> {
400 IRB.CreateStore(getCleanShadow(&I), ShadowPtr);
401
402 setShadow(&I, getCleanShadow(&I));
403 - setOrigin(&I, getCleanOrigin());
404 }
405
406 void visitAtomicRMWInst(AtomicRMWInst &I) {
407 EOF
408 patch -p1
409 popd
410
411 # Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command"
412 pushd "${CLANG_DIR}"
413 cat << 'EOF' |
414 --- a/test/Driver/env.c
415 +++ b/test/Driver/env.c
416 @@ -5,12 +5,14 @@
417 // REQUIRES: shell
418 //
419 // The PATH variable is heavily used when trying to find a linker.
420 -// RUN: env -i LC_ALL=C %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
421 +// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
422 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
423 // RUN: --target=i386-unknown-linux \
424 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
425 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
426 //
427 -// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2 >&1 \
428 +// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
429 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
430 // RUN: --target=i386-unknown-linux \
431 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
432 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
433 EOF
434 patch -p1
435 popd
436
437 # Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed"
438 pushd "${CLANG_DIR}"
439 cat << 'EOF' |
440 --- a/lib/Frontend/InitPreprocessor.cpp
441 +++ b/lib/Frontend/InitPreprocessor.cpp
442 @@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
443 Builder.defineMacro("__BLOCKS__");
444 }
445
446 - if (!LangOpts.MSVCCompat && LangOpts.Exceptions)
447 + if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
448 Builder.defineMacro("__EXCEPTIONS");
449 if (!LangOpts.MSVCCompat && LangOpts.RTTI)
450 Builder.defineMacro("__GXX_RTTI");
451 diff --git a/test/Frontend/exceptions.c b/test/Frontend/exceptions.c
452 index 981b5b9..4bbaaa3 100644
453 --- a/test/Frontend/exceptions.c
454 +++ b/test/Frontend/exceptions.c
455 @@ -1,9 +1,6 @@
456 -// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -DMS_MODE - verify %s
457 +// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s
458 // expected-no-diagnostics
459
460 -// RUN: %clang_cc1 -fms-compatibility -fexceptions -verify %s
461 -// expected-no-diagnostics
462 -
463 -#if defined(MS_MODE) && defined(__EXCEPTIONS)
464 +#if defined(__EXCEPTIONS)
465 #error __EXCEPTIONS should not be defined.
466 #endif
467 diff --git a/test/Preprocessor/predefined-exceptions.m b/test/Preprocessor/prede fined-exceptions.m
468 index 0791075..c13f429 100644
469 --- a/test/Preprocessor/predefined-exceptions.m
470 +++ b/test/Preprocessor/predefined-exceptions.m
471 @@ -1,6 +1,6 @@
472 // RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | Fi leCheck -check-prefix=CHECK-OBJC-NOCXX %s
473 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
474 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
475 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
476
477 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s
478 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
479 EOF
480 patch -p1
481 popd
482
483 # Apply r223177: "Ensure typos in the default values of template parameters ge t diagnosed."
484 pushd "${CLANG_DIR}"
485 cat << 'EOF' |
486 --- a/lib/Parse/ParseTemplate.cpp
487 +++ b/lib/Parse/ParseTemplate.cpp
488 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign ed Position) {
489 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false);
490 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
491
492 - DefaultArg = ParseAssignmentExpression();
493 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()) ;
494 if (DefaultArg.isInvalid())
495 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch);
496 }
497 diff --git a/test/SemaCXX/default2.cpp b/test/SemaCXX/default2.cpp
498 index 1626044..c4d40b4 100644
499 --- a/test/SemaCXX/default2.cpp
500 +++ b/test/SemaCXX/default2.cpp
501 @@ -122,3 +122,9 @@ class XX {
502 void A(int length = -1 ) { }
503 void B() { A(); }
504 };
505 +
506 +template <int I = (1 * I)> struct S {}; // expected-error-re {{use of undeclar ed identifier 'I'{{$}}}}
507 +S<1> s;
508 +
509 +template <int I1 = I2, int I2 = 1> struct T {}; // expected-error-re {{use of undeclared identifier 'I2'{{$}}}}
510 +T<0, 1> t;
511 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc tion-delayed.cpp
512 index bff1d76..7bf9258 100644
513 --- a/test/SemaCXX/typo-correction-delayed.cpp
514 +++ b/test/SemaCXX/typo-correction-delayed.cpp
515 @@ -102,3 +102,7 @@ void f(int *i) {
516 __atomic_load(i, i, something_something); // expected-error-re {{use of unde clared identifier 'something_something'{{$}}}}
517 }
518 }
519 +
520 +const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}}
521 +template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
522 +S<1> s;
523 EOF
524 patch -p1
525 popd
526
527 # Apply r223209: "Handle delayed corrections in a couple more error paths in P arsePostfixExpressionSuffix."
528 pushd "${CLANG_DIR}"
529 cat << 'EOF' |
530 --- a/lib/Parse/ParseExpr.cpp
531 +++ b/lib/Parse/ParseExpr.cpp
532 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
533 SourceLocation OpenLoc = ConsumeToken();
534
535 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) {
536 + (void)Actions.CorrectDelayedTyposInExpr(LHS);
537 LHS = ExprError();
538 }
539
540 @@ -1440,6 +1441,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
541 if (Tok.isNot(tok::r_paren)) {
542 if (ParseExpressionList(ArgExprs, CommaLocs, &Sema::CodeCompleteCall,
543 LHS.get())) {
544 + (void)Actions.CorrectDelayedTyposInExpr(LHS);
545 LHS = ExprError();
546 }
547 }
548 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc tion-delayed.cpp
549 index 7bf9258..f7ef015 100644
550 --- a/test/SemaCXX/typo-correction-delayed.cpp
551 +++ b/test/SemaCXX/typo-correction-delayed.cpp
552 @@ -106,3 +106,9 @@ void f(int *i) {
553 const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}}
554 template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
555 S<1> s;
556 +
557 +namespace foo {}
558 +void test_paren_suffix() {
559 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \
560 + // expected-error {{expected expression}}
561 +}
562 EOF
563 patch -p1
564 popd
565
566 # Apply r223705: "Handle possible TypoExprs in member initializers."
567 pushd "${CLANG_DIR}"
568 cat << 'EOF' |
569 --- a/lib/Sema/SemaDeclCXX.cpp
570 +++ b/lib/Sema/SemaDeclCXX.cpp
571 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD,
572 SourceLocation IdLoc,
573 Expr *Init,
574 SourceLocation EllipsisLoc) {
575 + ExprResult Res = CorrectDelayedTyposInExpr(Init);
576 + if (!Res.isUsable())
577 + return true;
578 + Init = Res.get();
579 +
580 if (!ConstructorD)
581 return true;
582
583 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc tion-delayed.cpp
584 index f7ef015..d303b58 100644
585 --- a/test/SemaCXX/typo-correction-delayed.cpp
586 +++ b/test/SemaCXX/typo-correction-delayed.cpp
587 @@ -112,3 +112,10 @@ void test_paren_suffix() {
588 foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \
589 // expected-error {{expected expression}}
590 }
591 +
592 +const int kNum = 10; // expected-note {{'kNum' declared here}}
593 +class SomeClass {
594 + int Kind;
595 +public:
596 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}}
597 +};
598 EOF
599 patch -p1
600 popd
601
602 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overlo ad resolution"
603 pushd "${CLANG_DIR}"
604 cat << 'EOF' |
605 --- a/lib/Sema/SemaExprCXX.cpp
606 +++ b/lib/Sema/SemaExprCXX.cpp
607 @@ -6105,8 +6105,13 @@ public:
608 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
609 RParenLoc, ExecConfig);
610 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
611 - if (!Result.isInvalid() && Result.get())
612 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee();
613 + if (!Result.isInvalid() && Result.get()) {
614 + Expr *ResultCall = Result.get();
615 + if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall))
616 + ResultCall = BE->getSubExpr();
617 + if (auto *CE = dyn_cast<CallExpr>(ResultCall))
618 + OverloadResolution[OE] = CE->getCallee();
619 + }
620 }
621 return Result;
622 }
623 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc tion-delayed.cpp
624 index d303b58..d42888f 100644
625 --- a/test/SemaCXX/typo-correction-delayed.cpp
626 +++ b/test/SemaCXX/typo-correction-delayed.cpp
627 @@ -119,3 +119,23 @@ class SomeClass {
628 public:
629 explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}}
630 };
631 +
632 +extern "C" int printf(const char *, ...);
633 +
634 +// There used to be an issue with typo resolution inside overloads.
635 +struct AssertionResult {
636 + ~AssertionResult();
637 + operator bool();
638 + int val;
639 +};
640 +AssertionResult Compare(const char *a, const char *b);
641 +AssertionResult Compare(int a, int b);
642 +int main() {
643 + // expected-note@+1 {{'result' declared here}}
644 + const char *result;
645 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
646 + if (AssertionResult ar = (Compare("value1", resulta)))
647 + ;
648 + else
649 + printf("ar: %d\n", ar.val);
650 +}
651 EOF
652 patch -p1
653 popd
654
655 # Apply r224173: "Implement feedback on r224172 in PR21899"
656 pushd "${CLANG_DIR}"
657 cat << 'EOF' |
658 --- a/lib/Sema/SemaExprCXX.cpp
659 +++ b/lib/Sema/SemaExprCXX.cpp
660 @@ -6105,7 +6105,7 @@ public:
661 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
662 RParenLoc, ExecConfig);
663 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
664 - if (!Result.isInvalid() && Result.get()) {
665 + if (Result.isUsable()) {
666 Expr *ResultCall = Result.get();
667 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall))
668 ResultCall = BE->getSubExpr();
669 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc tion-delayed.cpp
670 index d42888f..7879d29 100644
671 --- a/test/SemaCXX/typo-correction-delayed.cpp
672 +++ b/test/SemaCXX/typo-correction-delayed.cpp
673 @@ -120,22 +120,13 @@ public:
674 explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}}
675 };
676
677 -extern "C" int printf(const char *, ...);
678 -
679 // There used to be an issue with typo resolution inside overloads.
680 -struct AssertionResult {
681 - ~AssertionResult();
682 - operator bool();
683 - int val;
684 -};
685 -AssertionResult Compare(const char *a, const char *b);
686 -AssertionResult Compare(int a, int b);
687 -int main() {
688 +struct AssertionResult { ~AssertionResult(); };
689 +AssertionResult Overload(const char *a);
690 +AssertionResult Overload(int a);
691 +void UseOverload() {
692 // expected-note@+1 {{'result' declared here}}
693 const char *result;
694 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
695 - if (AssertionResult ar = (Compare("value1", resulta)))
696 - ;
697 - else
698 - printf("ar: %d\n", ar.val);
699 + Overload(resulta);
700 }
701 EOF
702 patch -p1
703 popd
704
705 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR21 552) 407 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR21 552)
706 pushd "${LLVM_DIR}" 408 pushd "${LLVM_DIR}"
707 cat << 'EOF' | 409 cat << 'EOF' |
708 Index: test/Bindings/Go/go.test 410 Index: test/Bindings/Go/go.test
709 =================================================================== 411 ===================================================================
710 --- test/Bindings/Go/go.test (revision 223109) 412 --- test/Bindings/Go/go.test (revision 223109)
711 +++ test/Bindings/Go/go.test (working copy) 413 +++ test/Bindings/Go/go.test (working copy)
712 @@ -1,3 +1,3 @@ 414 @@ -1,3 +1,3 @@
713 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm 415 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
714 +; RUN: true 416 +; RUN: true
715 417
716 ; REQUIRES: shell 418 ; REQUIRES: shell
717 EOF 419 EOF
718 patch -p0 420 patch -p0
719 popd 421 popd
720 422
423
721 fi 424 fi
722 425
723 # Echo all commands. 426 # Echo all commands.
724 set -x 427 set -x
725 428
726 # Set default values for CC and CXX if they're not set in the environment. 429 # Set default values for CC and CXX if they're not set in the environment.
727 CC=${CC:-cc} 430 CC=${CC:-cc}
728 CXX=${CXX:-c++} 431 CXX=${CXX:-c++}
729 432
730 if [[ -n "${gcc_toolchain}" ]]; then 433 if [[ -n "${gcc_toolchain}" ]]; then
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 -nodefaultlibs -current_version 1 -compatibility_version 1 \ 538 -nodefaultlibs -current_version 1 -compatibility_version 1 \
836 -lSystem -install_name @executable_path/libc++.dylib \ 539 -lSystem -install_name @executable_path/libc++.dylib \
837 -Wl,-unexported_symbols_list,${ABS_LIBCXX_DIR}/lib/libc++unexp.exp \ 540 -Wl,-unexported_symbols_list,${ABS_LIBCXX_DIR}/lib/libc++unexp.exp \
838 -Wl,-force_symbols_not_weak_list,${ABS_LIBCXX_DIR}/lib/notweak.exp \ 541 -Wl,-force_symbols_not_weak_list,${ABS_LIBCXX_DIR}/lib/notweak.exp \
839 -Wl,-force_symbols_weak_list,${ABS_LIBCXX_DIR}/lib/weak.exp 542 -Wl,-force_symbols_weak_list,${ABS_LIBCXX_DIR}/lib/weak.exp
840 ln -sf libc++.1.dylib libc++.dylib 543 ln -sf libc++.1.dylib libc++.dylib
841 popd 544 popd
842 LDFLAGS+="-stdlib=libc++ -L${PWD}/libcxxbuild" 545 LDFLAGS+="-stdlib=libc++ -L${PWD}/libcxxbuild"
843 fi 546 fi
844 547
548 # Find the binutils include dir for the gold plugin.
549 BINUTILS_INCDIR=""
550 if [ "${OS}" = "Linux" ]; then
551 BINUTILS_INCDIR="${ABS_BINUTILS_DIR}/Linux_x64/Release/include"
552 fi
553
845 # Hook the Chromium tools into the LLVM build. Several Chromium tools have 554 # Hook the Chromium tools into the LLVM build. Several Chromium tools have
846 # dependencies on LLVM/Clang libraries. The LLVM build detects implicit tools 555 # dependencies on LLVM/Clang libraries. The LLVM build detects implicit tools
847 # in the tools subdirectory, so install a shim CMakeLists.txt that forwards to 556 # in the tools subdirectory, so install a shim CMakeLists.txt that forwards to
848 # the real directory for the Chromium tools. 557 # the real directory for the Chromium tools.
849 # Note that the shim directory name intentionally has no _ or _. The implicit 558 # Note that the shim directory name intentionally has no _ or _. The implicit
850 # tool detection logic munges them in a weird way. 559 # tool detection logic munges them in a weird way.
851 mkdir -v ${CHROME_TOOLS_SHIM_DIR} 560 mkdir -v ${CHROME_TOOLS_SHIM_DIR}
852 cat > ${CHROME_TOOLS_SHIM_DIR}/CMakeLists.txt << EOF 561 cat > ${CHROME_TOOLS_SHIM_DIR}/CMakeLists.txt << EOF
853 # Since tools/clang isn't actually a subdirectory, use the two argument version 562 # Since tools/clang isn't actually a subdirectory, use the two argument version
854 # to specify where build artifacts go. CMake doesn't allow reusing the same 563 # to specify where build artifacts go. CMake doesn't allow reusing the same
855 # binary dir for multiple source dirs, so the build artifacts have to go into a 564 # binary dir for multiple source dirs, so the build artifacts have to go into a
856 # subdirectory... 565 # subdirectory...
857 add_subdirectory(\${CHROMIUM_TOOLS_SRC} \${CMAKE_CURRENT_BINARY_DIR}/a) 566 add_subdirectory(\${CHROMIUM_TOOLS_SRC} \${CMAKE_CURRENT_BINARY_DIR}/a)
858 EOF 567 EOF
859 rm -fv CMakeCache.txt 568 rm -fv CMakeCache.txt
860 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \ 569 MACOSX_DEPLOYMENT_TARGET=${deployment_target} cmake -GNinja \
861 -DCMAKE_BUILD_TYPE=Release \ 570 -DCMAKE_BUILD_TYPE=Release \
862 -DLLVM_ENABLE_ASSERTIONS=ON \ 571 -DLLVM_ENABLE_ASSERTIONS=ON \
863 -DLLVM_ENABLE_THREADS=OFF \ 572 -DLLVM_ENABLE_THREADS=OFF \
573 -DLLVM_BINUTILS_INCDIR="${BINUTILS_INCDIR}" \
864 -DCMAKE_C_COMPILER="${CC}" \ 574 -DCMAKE_C_COMPILER="${CC}" \
865 -DCMAKE_CXX_COMPILER="${CXX}" \ 575 -DCMAKE_CXX_COMPILER="${CXX}" \
866 -DCMAKE_C_FLAGS="${CFLAGS}" \ 576 -DCMAKE_C_FLAGS="${CFLAGS}" \
867 -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ 577 -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
868 -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \ 578 -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
869 -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ 579 -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
870 -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" \ 580 -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" \
871 -DCMAKE_INSTALL_PREFIX="${ABS_LLVM_BUILD_DIR}" \ 581 -DCMAKE_INSTALL_PREFIX="${ABS_LLVM_BUILD_DIR}" \
872 -DCHROMIUM_TOOLS_SRC="${ABS_CHROMIUM_TOOLS_DIR}" \ 582 -DCHROMIUM_TOOLS_SRC="${ABS_CHROMIUM_TOOLS_DIR}" \
873 -DCHROMIUM_TOOLS="${chrome_tools}" \ 583 -DCHROMIUM_TOOLS="${chrome_tools}" \
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 fi 673 fi
964 674
965 if [[ -n "$run_tests" ]]; then 675 if [[ -n "$run_tests" ]]; then
966 # Run Chrome tool tests. 676 # Run Chrome tool tests.
967 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 677 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
968 # Run the LLVM and Clang tests. 678 # Run the LLVM and Clang tests.
969 ninja -C "${LLVM_BUILD_DIR}" check-all 679 ninja -C "${LLVM_BUILD_DIR}" check-all
970 fi 680 fi
971 681
972 # After everything is done, log success for this revision. 682 # After everything is done, log success for this revision.
973 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" 683 echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
OLDNEW
« no previous file with comments | « tools/clang/scripts/update.py ('k') | tools/generate_library_loader/generate_library_loader.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698