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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « tools/clang/scripts/update.py ('k') | tools/git/for-all-touched-files.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
(...skipping 13 matching lines...) Expand all
24 STAMP_FILE="${LLVM_DIR}/../llvm-build/cr_build_revision" 24 STAMP_FILE="${LLVM_DIR}/../llvm-build/cr_build_revision"
25 CHROMIUM_TOOLS_DIR="${THIS_DIR}/.." 25 CHROMIUM_TOOLS_DIR="${THIS_DIR}/.."
26 26
27 ABS_CHROMIUM_TOOLS_DIR="${PWD}/${CHROMIUM_TOOLS_DIR}" 27 ABS_CHROMIUM_TOOLS_DIR="${PWD}/${CHROMIUM_TOOLS_DIR}"
28 ABS_LIBCXX_DIR="${PWD}/${LIBCXX_DIR}" 28 ABS_LIBCXX_DIR="${PWD}/${LIBCXX_DIR}"
29 ABS_LIBCXXABI_DIR="${PWD}/${LIBCXXABI_DIR}" 29 ABS_LIBCXXABI_DIR="${PWD}/${LIBCXXABI_DIR}"
30 ABS_LLVM_DIR="${PWD}/${LLVM_DIR}" 30 ABS_LLVM_DIR="${PWD}/${LLVM_DIR}"
31 ABS_LLVM_BUILD_DIR="${PWD}/${LLVM_BUILD_DIR}" 31 ABS_LLVM_BUILD_DIR="${PWD}/${LLVM_BUILD_DIR}"
32 ABS_COMPILER_RT_DIR="${PWD}/${COMPILER_RT_DIR}" 32 ABS_COMPILER_RT_DIR="${PWD}/${COMPILER_RT_DIR}"
33 33
34
35 # Use both the clang revision and the plugin revisions to test for updates.
36 BLINKGCPLUGIN_REVISION=\
37 $(grep 'set(LIBRARYNAME' "$THIS_DIR"/../blink_gc_plugin/CMakeLists.txt \
38 | cut -d ' ' -f 2 | tr -cd '[0-9]')
39 CLANG_AND_PLUGINS_REVISION="${CLANG_REVISION}-${BLINKGCPLUGIN_REVISION}"
40
41 # ${A:-a} returns $A if it's set, a else. 34 # ${A:-a} returns $A if it's set, a else.
42 LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project} 35 LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project}
43 36
44 if [[ -z "$GYP_DEFINES" ]]; then 37 if [[ -z "$GYP_DEFINES" ]]; then
45 GYP_DEFINES= 38 GYP_DEFINES=
46 fi 39 fi
47 if [[ -z "$GYP_GENERATORS" ]]; then 40 if [[ -z "$GYP_GENERATORS" ]]; then
48 GYP_GENERATORS= 41 GYP_GENERATORS=
49 fi 42 fi
50 43
51 44
52 # Die if any command dies, error on undefined variable expansions. 45 # Die if any command dies, error on undefined variable expansions.
53 set -eu 46 set -eu
54 47
48
49 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
50 # Use a real version number rather than HEAD to make sure that
51 # --print-revision, stamp file logic, etc. all works naturally.
52 CLANG_REVISION=$(svn info "$LLVM_REPO_URL" \
53 | grep 'Last Changed Rev' | awk '{ printf $4; }')
54 fi
55
56 # Use both the clang revision and the plugin revisions to test for updates.
57 BLINKGCPLUGIN_REVISION=\
58 $(grep 'set(LIBRARYNAME' "$THIS_DIR"/../blink_gc_plugin/CMakeLists.txt \
59 | cut -d ' ' -f 2 | tr -cd '[0-9]')
60 CLANG_AND_PLUGINS_REVISION="${CLANG_REVISION}-${BLINKGCPLUGIN_REVISION}"
61
62
55 OS="$(uname -s)" 63 OS="$(uname -s)"
56 64
57 # Parse command line options. 65 # Parse command line options.
58 if_needed= 66 if_needed=
59 force_local_build= 67 force_local_build=
60 run_tests= 68 run_tests=
61 bootstrap= 69 bootstrap=
62 with_android=yes 70 with_android=yes
63 chrome_tools="plugins;blink_gc_plugin" 71 chrome_tools="plugins;blink_gc_plugin"
64 gcc_toolchain= 72 gcc_toolchain=
73 with_patches=yes
65 74
66 if [[ "${OS}" = "Darwin" ]]; then 75 if [[ "${OS}" = "Darwin" ]]; then
67 with_android= 76 with_android=
68 fi 77 fi
69 78
70 while [[ $# > 0 ]]; do 79 while [[ $# > 0 ]]; do
71 case $1 in 80 case $1 in
72 --bootstrap) 81 --bootstrap)
73 bootstrap=yes 82 bootstrap=yes
74 ;; 83 ;;
75 --if-needed) 84 --if-needed)
76 if_needed=yes 85 if_needed=yes
77 ;; 86 ;;
78 --force-local-build) 87 --force-local-build)
79 force_local_build=yes 88 force_local_build=yes
80 ;; 89 ;;
81 --print-revision) 90 --print-revision)
82 echo $CLANG_REVISION 91 echo $CLANG_REVISION
83 exit 0 92 exit 0
84 ;; 93 ;;
85 --run-tests) 94 --run-tests)
86 run_tests=yes 95 run_tests=yes
87 ;; 96 ;;
88 --without-android) 97 --without-android)
89 with_android= 98 with_android=
90 ;; 99 ;;
100 --without-patches)
101 with_patches=
102 ;;
91 --with-chrome-tools) 103 --with-chrome-tools)
92 shift 104 shift
93 if [[ $# == 0 ]]; then 105 if [[ $# == 0 ]]; then
94 echo "--with-chrome-tools requires an argument." 106 echo "--with-chrome-tools requires an argument."
95 exit 1 107 exit 1
96 fi 108 fi
97 chrome_tools=$1 109 chrome_tools=$1
98 ;; 110 ;;
99 --gcc-toolchain) 111 --gcc-toolchain)
100 shift 112 shift
(...skipping 17 matching lines...) Expand all
118 echo "--if-needed: Download clang only if the script thinks it is needed." 130 echo "--if-needed: Download clang only if the script thinks it is needed."
119 echo "--run-tests: Run tests after building. Only for local builds." 131 echo "--run-tests: Run tests after building. Only for local builds."
120 echo "--print-revision: Print current clang revision and exit." 132 echo "--print-revision: Print current clang revision and exit."
121 echo "--without-android: Don't build ASan Android runtime library." 133 echo "--without-android: Don't build ASan Android runtime library."
122 echo "--with-chrome-tools: Select which chrome tools to build." \ 134 echo "--with-chrome-tools: Select which chrome tools to build." \
123 "Defaults to plugins;blink_gc_plugin." 135 "Defaults to plugins;blink_gc_plugin."
124 echo " Example: --with-chrome-tools plugins;empty-string" 136 echo " Example: --with-chrome-tools plugins;empty-string"
125 echo "--gcc-toolchain: Set the prefix for which GCC version should" 137 echo "--gcc-toolchain: Set the prefix for which GCC version should"
126 echo " be used for building. For example, to use gcc in" 138 echo " be used for building. For example, to use gcc in"
127 echo " /opt/foo/bin/gcc, use '--gcc-toolchain '/opt/foo" 139 echo " /opt/foo/bin/gcc, use '--gcc-toolchain '/opt/foo"
140 echo "--without-patches: Don't apply local patches."
128 echo 141 echo
129 exit 1 142 exit 1
130 ;; 143 ;;
131 *) 144 *)
132 echo "Unknown argument: '$1'." 145 echo "Unknown argument: '$1'."
133 echo "Use --help for help." 146 echo "Use --help for help."
134 exit 1 147 exit 1
135 ;; 148 ;;
136 esac 149 esac
137 shift 150 shift
138 done 151 done
139 152
153 if [[ -n ${LLVM_FORCE_HEAD_REVISION:-''} ]]; then
154 force_local_build=yes
155
156 # Skip local patches when using HEAD: they probably don't apply anymore.
157 with_patches=
158
159 if ! [[ "$GYP_DEFINES" =~ .*OS=android.* ]]; then
160 # Only build the Android ASan rt when targetting Android.
161 with_android=
162 fi
163
164 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}"
165 fi
166
140 if [[ -n "$if_needed" ]]; then 167 if [[ -n "$if_needed" ]]; then
141 if [[ "${OS}" == "Darwin" ]]; then 168 if [[ "${OS}" == "Darwin" ]]; then
142 # clang is used on Mac. 169 # clang is used on Mac.
143 true 170 true
144 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then 171 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then
145 # clang requested via $GYP_DEFINES. 172 # clang requested via $GYP_DEFINES.
146 true 173 true
147 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then 174 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then
148 # clang previously downloaded, remove third_party/llvm-build to prevent 175 # clang previously downloaded, remove third_party/llvm-build to prevent
149 # updating. 176 # updating.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 fi 316 fi
290 317
291 # While we're bundling our own libc++ on OS X, we need to compile libc++abi 318 # While we're bundling our own libc++ on OS X, we need to compile libc++abi
292 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either). 319 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either).
293 if [ "${OS}" = "Darwin" ]; then 320 if [ "${OS}" = "Darwin" ]; then
294 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" 321 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}"
295 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ 322 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \
296 "${LIBCXXABI_DIR}" 323 "${LIBCXXABI_DIR}"
297 fi 324 fi
298 325
299 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) 326 if [[ -n "$with_patches" ]]; then
300 pushd "${CLANG_DIR}" 327
301 cat << 'EOF' | 328 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974)
329 pushd "${CLANG_DIR}"
330 cat << 'EOF' |
302 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio n 202554) 331 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio n 202554)
303 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working copy) 332 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working copy)
304 @@ -12,6 +12,8 @@ 333 @@ -12,6 +12,8 @@
305 334
306 // REQUIRES: crash-recovery 335 // REQUIRES: crash-recovery
307 // REQUIRES: shell 336 // REQUIRES: shell
308 +// XFAIL: * 337 +// XFAIL: *
309 +// (PR11974) 338 +// (PR11974)
310 339
311 @import Crash; 340 @import Crash;
312 EOF 341 EOF
313 patch -p4 342 patch -p4
314 popd 343 popd
315 344
316 pushd "${CLANG_DIR}" 345 pushd "${CLANG_DIR}"
317 cat << 'EOF' | 346 cat << 'EOF' |
318 --- unittests/libclang/LibclangTest.cpp (revision 215949) 347 --- unittests/libclang/LibclangTest.cpp (revision 215949)
319 +++ unittests/libclang/LibclangTest.cpp (working copy) 348 +++ unittests/libclang/LibclangTest.cpp (working copy)
320 @@ -431,7 +431,7 @@ 349 @@ -431,7 +431,7 @@
321 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); 350 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU));
322 } 351 }
323 352
324 -TEST_F(LibclangReparseTest, ReparseWithModule) { 353 -TEST_F(LibclangReparseTest, ReparseWithModule) {
325 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { 354 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
326 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; 355 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
327 const char *HeaderBottom = "\n};\n#endif\n"; 356 const char *HeaderBottom = "\n};\n#endif\n";
328 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" 357 const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
329 EOF 358 EOF
330 patch -p0 359 patch -p0
331 popd 360 popd
332 361
333 # Apply r223211: "Revert r222997." 362 # Apply r223211: "Revert r222997."
334 pushd "${LLVM_DIR}" 363 pushd "${LLVM_DIR}"
335 cat << 'EOF' | 364 cat << 'EOF' |
336 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp 365 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
337 +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp 366 +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
338 @@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySan itizerVisitor> { 367 @@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySan itizerVisitor> {
339 Value *OriginPtr = 368 Value *OriginPtr =
340 getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset); 369 getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
341 setOrigin(A, EntryIRB.CreateLoad(OriginPtr)); 370 setOrigin(A, EntryIRB.CreateLoad(OriginPtr));
342 - } else { 371 - } else {
343 - setOrigin(A, getCleanOrigin()); 372 - setOrigin(A, getCleanOrigin());
344 } 373 }
345 } 374 }
(...skipping 23 matching lines...) Expand all
369 /// \brief Get the origin for i-th argument of the instruction I. 398 /// \brief Get the origin for i-th argument of the instruction I.
370 @@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> { 399 @@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> {
371 IRB.CreateStore(getCleanShadow(&I), ShadowPtr); 400 IRB.CreateStore(getCleanShadow(&I), ShadowPtr);
372 401
373 setShadow(&I, getCleanShadow(&I)); 402 setShadow(&I, getCleanShadow(&I));
374 - setOrigin(&I, getCleanOrigin()); 403 - setOrigin(&I, getCleanOrigin());
375 } 404 }
376 405
377 void visitAtomicRMWInst(AtomicRMWInst &I) { 406 void visitAtomicRMWInst(AtomicRMWInst &I) {
378 EOF 407 EOF
379 patch -p1 408 patch -p1
380 popd 409 popd
381 410
382 # Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command" 411 # Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command"
383 pushd "${CLANG_DIR}" 412 pushd "${CLANG_DIR}"
384 cat << 'EOF' | 413 cat << 'EOF' |
385 --- a/test/Driver/env.c 414 --- a/test/Driver/env.c
386 +++ b/test/Driver/env.c 415 +++ b/test/Driver/env.c
387 @@ -5,12 +5,14 @@ 416 @@ -5,12 +5,14 @@
388 // REQUIRES: shell 417 // REQUIRES: shell
389 // 418 //
390 // The PATH variable is heavily used when trying to find a linker. 419 // The PATH variable is heavily used when trying to find a linker.
391 -// RUN: env -i LC_ALL=C %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 420 -// RUN: env -i LC_ALL=C %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
392 +// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ 421 +// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
393 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 422 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
394 // RUN: --target=i386-unknown-linux \ 423 // RUN: --target=i386-unknown-linux \
395 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 424 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
396 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 425 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
397 // 426 //
398 -// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2 >&1 \ 427 -// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2 >&1 \
399 +// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ 428 +// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
400 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 429 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
401 // RUN: --target=i386-unknown-linux \ 430 // RUN: --target=i386-unknown-linux \
402 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 431 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
403 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 432 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
404 EOF 433 EOF
405 patch -p1 434 patch -p1
406 popd 435 popd
407 436
408 # Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed" 437 # Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed"
409 pushd "${CLANG_DIR}" 438 pushd "${CLANG_DIR}"
410 cat << 'EOF' | 439 cat << 'EOF' |
411 --- a/lib/Frontend/InitPreprocessor.cpp 440 --- a/lib/Frontend/InitPreprocessor.cpp
412 +++ b/lib/Frontend/InitPreprocessor.cpp 441 +++ b/lib/Frontend/InitPreprocessor.cpp
413 @@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, 442 @@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
414 Builder.defineMacro("__BLOCKS__"); 443 Builder.defineMacro("__BLOCKS__");
415 } 444 }
416 445
417 - if (!LangOpts.MSVCCompat && LangOpts.Exceptions) 446 - if (!LangOpts.MSVCCompat && LangOpts.Exceptions)
418 + if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions) 447 + if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
419 Builder.defineMacro("__EXCEPTIONS"); 448 Builder.defineMacro("__EXCEPTIONS");
420 if (!LangOpts.MSVCCompat && LangOpts.RTTI) 449 if (!LangOpts.MSVCCompat && LangOpts.RTTI)
(...skipping 20 matching lines...) Expand all
441 +++ b/test/Preprocessor/predefined-exceptions.m 470 +++ b/test/Preprocessor/predefined-exceptions.m
442 @@ -1,6 +1,6 @@ 471 @@ -1,6 +1,6 @@
443 // RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | Fi leCheck -check-prefix=CHECK-OBJC-NOCXX %s 472 // RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | Fi leCheck -check-prefix=CHECK-OBJC-NOCXX %s
444 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 473 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
445 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1 474 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
446 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1 475 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
447 476
448 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s 477 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s
449 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 478 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
450 EOF 479 EOF
451 patch -p1 480 patch -p1
452 popd 481 popd
453 482
454 # Apply r223177: "Ensure typos in the default values of template parameters get diagnosed." 483 # Apply r223177: "Ensure typos in the default values of template parameters ge t diagnosed."
455 pushd "${CLANG_DIR}" 484 pushd "${CLANG_DIR}"
456 cat << 'EOF' | 485 cat << 'EOF' |
457 --- a/lib/Parse/ParseTemplate.cpp 486 --- a/lib/Parse/ParseTemplate.cpp
458 +++ b/lib/Parse/ParseTemplate.cpp 487 +++ b/lib/Parse/ParseTemplate.cpp
459 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign ed Position) { 488 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign ed Position) {
460 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); 489 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false);
461 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); 490 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
462 491
463 - DefaultArg = ParseAssignmentExpression(); 492 - DefaultArg = ParseAssignmentExpression();
464 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()) ; 493 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()) ;
465 if (DefaultArg.isInvalid()) 494 if (DefaultArg.isInvalid())
466 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch); 495 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch);
(...skipping 18 matching lines...) Expand all
485 +++ b/test/SemaCXX/typo-correction-delayed.cpp 514 +++ b/test/SemaCXX/typo-correction-delayed.cpp
486 @@ -102,3 +102,7 @@ void f(int *i) { 515 @@ -102,3 +102,7 @@ void f(int *i) {
487 __atomic_load(i, i, something_something); // expected-error-re {{use of unde clared identifier 'something_something'{{$}}}} 516 __atomic_load(i, i, something_something); // expected-error-re {{use of unde clared identifier 'something_something'{{$}}}}
488 } 517 }
489 } 518 }
490 + 519 +
491 +const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}} 520 +const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}}
492 +template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}} 521 +template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
493 +S<1> s; 522 +S<1> s;
494 EOF 523 EOF
495 patch -p1 524 patch -p1
496 popd 525 popd
497 526
498 # Apply r223209: "Handle delayed corrections in a couple more error paths in Par sePostfixExpressionSuffix." 527 # Apply r223209: "Handle delayed corrections in a couple more error paths in P arsePostfixExpressionSuffix."
499 pushd "${CLANG_DIR}" 528 pushd "${CLANG_DIR}"
500 cat << 'EOF' | 529 cat << 'EOF' |
501 --- a/lib/Parse/ParseExpr.cpp 530 --- a/lib/Parse/ParseExpr.cpp
502 +++ b/lib/Parse/ParseExpr.cpp 531 +++ b/lib/Parse/ParseExpr.cpp
503 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { 532 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
504 SourceLocation OpenLoc = ConsumeToken(); 533 SourceLocation OpenLoc = ConsumeToken();
505 534
506 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) { 535 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) {
507 + (void)Actions.CorrectDelayedTyposInExpr(LHS); 536 + (void)Actions.CorrectDelayedTyposInExpr(LHS);
508 LHS = ExprError(); 537 LHS = ExprError();
509 } 538 }
510 539
(...skipping 13 matching lines...) Expand all
524 const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}} 553 const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}}
525 template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}} 554 template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
526 S<1> s; 555 S<1> s;
527 + 556 +
528 +namespace foo {} 557 +namespace foo {}
529 +void test_paren_suffix() { 558 +void test_paren_suffix() {
530 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \ 559 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \
531 + // expected-error {{expected expression}} 560 + // expected-error {{expected expression}}
532 +} 561 +}
533 EOF 562 EOF
534 patch -p1 563 patch -p1
535 popd 564 popd
536 565
537 # Apply r223705: "Handle possible TypoExprs in member initializers." 566 # Apply r223705: "Handle possible TypoExprs in member initializers."
538 pushd "${CLANG_DIR}" 567 pushd "${CLANG_DIR}"
539 cat << 'EOF' | 568 cat << 'EOF' |
540 --- a/lib/Sema/SemaDeclCXX.cpp 569 --- a/lib/Sema/SemaDeclCXX.cpp
541 +++ b/lib/Sema/SemaDeclCXX.cpp 570 +++ b/lib/Sema/SemaDeclCXX.cpp
542 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD, 571 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD,
543 SourceLocation IdLoc, 572 SourceLocation IdLoc,
544 Expr *Init, 573 Expr *Init,
545 SourceLocation EllipsisLoc) { 574 SourceLocation EllipsisLoc) {
546 + ExprResult Res = CorrectDelayedTyposInExpr(Init); 575 + ExprResult Res = CorrectDelayedTyposInExpr(Init);
547 + if (!Res.isUsable()) 576 + if (!Res.isUsable())
548 + return true; 577 + return true;
549 + Init = Res.get(); 578 + Init = Res.get();
(...skipping 10 matching lines...) Expand all
560 // expected-error {{expected expression}} 589 // expected-error {{expected expression}}
561 } 590 }
562 + 591 +
563 +const int kNum = 10; // expected-note {{'kNum' declared here}} 592 +const int kNum = 10; // expected-note {{'kNum' declared here}}
564 +class SomeClass { 593 +class SomeClass {
565 + int Kind; 594 + int Kind;
566 +public: 595 +public:
567 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}} 596 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}}
568 +}; 597 +};
569 EOF 598 EOF
570 patch -p1 599 patch -p1
571 popd 600 popd
572 601
573 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overload resolution" 602 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overlo ad resolution"
574 pushd "${CLANG_DIR}" 603 pushd "${CLANG_DIR}"
575 cat << 'EOF' | 604 cat << 'EOF' |
576 --- a/lib/Sema/SemaExprCXX.cpp 605 --- a/lib/Sema/SemaExprCXX.cpp
577 +++ b/lib/Sema/SemaExprCXX.cpp 606 +++ b/lib/Sema/SemaExprCXX.cpp
578 @@ -6105,8 +6105,13 @@ public: 607 @@ -6105,8 +6105,13 @@ public:
579 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, 608 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
580 RParenLoc, ExecConfig); 609 RParenLoc, ExecConfig);
581 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { 610 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
582 - if (!Result.isInvalid() && Result.get()) 611 - if (!Result.isInvalid() && Result.get())
583 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee(); 612 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee();
584 + if (!Result.isInvalid() && Result.get()) { 613 + if (!Result.isInvalid() && Result.get()) {
585 + Expr *ResultCall = Result.get(); 614 + Expr *ResultCall = Result.get();
(...skipping 27 matching lines...) Expand all
613 +int main() { 642 +int main() {
614 + // expected-note@+1 {{'result' declared here}} 643 + // expected-note@+1 {{'result' declared here}}
615 + const char *result; 644 + const char *result;
616 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}} 645 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
617 + if (AssertionResult ar = (Compare("value1", resulta))) 646 + if (AssertionResult ar = (Compare("value1", resulta)))
618 + ; 647 + ;
619 + else 648 + else
620 + printf("ar: %d\n", ar.val); 649 + printf("ar: %d\n", ar.val);
621 +} 650 +}
622 EOF 651 EOF
623 patch -p1 652 patch -p1
624 popd 653 popd
625 654
626 # Apply r224173: "Implement feedback on r224172 in PR21899" 655 # Apply r224173: "Implement feedback on r224172 in PR21899"
627 pushd "${CLANG_DIR}" 656 pushd "${CLANG_DIR}"
628 cat << 'EOF' | 657 cat << 'EOF' |
629 --- a/lib/Sema/SemaExprCXX.cpp 658 --- a/lib/Sema/SemaExprCXX.cpp
630 +++ b/lib/Sema/SemaExprCXX.cpp 659 +++ b/lib/Sema/SemaExprCXX.cpp
631 @@ -6105,7 +6105,7 @@ public: 660 @@ -6105,7 +6105,7 @@ public:
632 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, 661 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
633 RParenLoc, ExecConfig); 662 RParenLoc, ExecConfig);
634 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { 663 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
635 - if (!Result.isInvalid() && Result.get()) { 664 - if (!Result.isInvalid() && Result.get()) {
636 + if (Result.isUsable()) { 665 + if (Result.isUsable()) {
637 Expr *ResultCall = Result.get(); 666 Expr *ResultCall = Result.get();
638 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall)) 667 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall))
(...skipping 24 matching lines...) Expand all
663 // expected-note@+1 {{'result' declared here}} 692 // expected-note@+1 {{'result' declared here}}
664 const char *result; 693 const char *result;
665 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}} 694 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
666 - if (AssertionResult ar = (Compare("value1", resulta))) 695 - if (AssertionResult ar = (Compare("value1", resulta)))
667 - ; 696 - ;
668 - else 697 - else
669 - printf("ar: %d\n", ar.val); 698 - printf("ar: %d\n", ar.val);
670 + Overload(resulta); 699 + Overload(resulta);
671 } 700 }
672 EOF 701 EOF
673 patch -p1 702 patch -p1
674 popd 703 popd
675 704
676 705 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR21 552)
677 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR2155 2) 706 pushd "${LLVM_DIR}"
678 pushd "${LLVM_DIR}" 707 cat << 'EOF' |
679 cat << 'EOF' |
680 Index: test/Bindings/Go/go.test 708 Index: test/Bindings/Go/go.test
681 =================================================================== 709 ===================================================================
682 --- test/Bindings/Go/go.test (revision 223109) 710 --- test/Bindings/Go/go.test (revision 223109)
683 +++ test/Bindings/Go/go.test (working copy) 711 +++ test/Bindings/Go/go.test (working copy)
684 @@ -1,3 +1,3 @@ 712 @@ -1,3 +1,3 @@
685 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm 713 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
686 +; RUN: true 714 +; RUN: true
687 715
688 ; REQUIRES: shell 716 ; REQUIRES: shell
689 EOF 717 EOF
690 patch -p0 718 patch -p0
691 popd 719 popd
692 720
721 fi
693 722
694 # Echo all commands. 723 # Echo all commands.
695 set -x 724 set -x
696 725
697 # Set default values for CC and CXX if they're not set in the environment. 726 # Set default values for CC and CXX if they're not set in the environment.
698 CC=${CC:-cc} 727 CC=${CC:-cc}
699 CXX=${CXX:-c++} 728 CXX=${CXX:-c++}
700 729
701 if [[ -n "${gcc_toolchain}" ]]; then 730 if [[ -n "${gcc_toolchain}" ]]; then
702 # Use the specified gcc installation for building. 731 # Use the specified gcc installation for building.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 fi 926 fi
898 927
899 popd 928 popd
900 929
901 if [[ -n "${with_android}" ]]; then 930 if [[ -n "${with_android}" ]]; then
902 # Make a standalone Android toolchain. 931 # Make a standalone Android toolchain.
903 ${ANDROID_NDK_DIR}/build/tools/make-standalone-toolchain.sh \ 932 ${ANDROID_NDK_DIR}/build/tools/make-standalone-toolchain.sh \
904 --platform=android-14 \ 933 --platform=android-14 \
905 --install-dir="${LLVM_BUILD_DIR}/android-toolchain" \ 934 --install-dir="${LLVM_BUILD_DIR}/android-toolchain" \
906 --system=linux-x86_64 \ 935 --system=linux-x86_64 \
907 --stl=libcxx \ 936 --stl=stlport \
908 --toolchain=arm-linux-androideabi-4.9 937 --toolchain=arm-linux-androideabi-4.9
909 938
910 # Android NDK r9d copies a broken unwind.h into the toolchain, see 939 # Android NDK r9d copies a broken unwind.h into the toolchain, see
911 # http://crbug.com/357890 940 # http://crbug.com/357890
912 rm -v "${LLVM_BUILD_DIR}"/android-toolchain/include/c++/*/unwind.h 941 rm -v "${LLVM_BUILD_DIR}"/android-toolchain/include/c++/*/unwind.h
913 942
914 # Build ASan runtime for Android in a separate build tree. 943 # Build ASan runtime for Android in a separate build tree.
915 mkdir -p ${LLVM_BUILD_DIR}/android 944 mkdir -p ${LLVM_BUILD_DIR}/android
916 pushd ${LLVM_BUILD_DIR}/android 945 pushd ${LLVM_BUILD_DIR}/android
917 rm -fv CMakeCache.txt 946 rm -fv CMakeCache.txt
(...skipping 17 matching lines...) Expand all
935 964
936 if [[ -n "$run_tests" ]]; then 965 if [[ -n "$run_tests" ]]; then
937 # Run Chrome tool tests. 966 # Run Chrome tool tests.
938 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 967 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
939 # Run the LLVM and Clang tests. 968 # Run the LLVM and Clang tests.
940 ninja -C "${LLVM_BUILD_DIR}" check-all 969 ninja -C "${LLVM_BUILD_DIR}" check-all
941 fi 970 fi
942 971
943 # After everything is done, log success for this revision. 972 # After everything is done, log success for this revision.
944 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" 973 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}"
OLDNEW
« no previous file with comments | « tools/clang/scripts/update.py ('k') | tools/git/for-all-touched-files.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698