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

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

Issue 923163002: Clang update.sh: add support for LLVM_FORCE_HEAD_REVISION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « no previous file | no next file » | 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 echo "LLVM_FORCE_HEAD_REVISION was set; using r${CLANG_REVISION}"
160 fi
161
140 if [[ -n "$if_needed" ]]; then 162 if [[ -n "$if_needed" ]]; then
141 if [[ "${OS}" == "Darwin" ]]; then 163 if [[ "${OS}" == "Darwin" ]]; then
142 # clang is used on Mac. 164 # clang is used on Mac.
143 true 165 true
144 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then 166 elif [[ "$GYP_DEFINES" =~ .*(clang|tsan|asan|lsan|msan)=1.* ]]; then
145 # clang requested via $GYP_DEFINES. 167 # clang requested via $GYP_DEFINES.
146 true 168 true
147 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then 169 elif [[ -d "${LLVM_BUILD_DIR}" ]]; then
148 # clang previously downloaded, remove third_party/llvm-build to prevent 170 # clang previously downloaded, remove third_party/llvm-build to prevent
149 # updating. 171 # updating.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 fi 311 fi
290 312
291 # While we're bundling our own libc++ on OS X, we need to compile libc++abi 313 # 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). 314 # into it too (since OS X 10.6 doesn't have libc++abi.dylib either).
293 if [ "${OS}" = "Darwin" ]; then 315 if [ "${OS}" = "Darwin" ]; then
294 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}" 316 echo Getting libc++abi r"${CLANG_REVISION}" in "${LIBCXXABI_DIR}"
295 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \ 317 svn co --force "${LLVM_REPO_URL}/libcxxabi/trunk@${CLANG_REVISION}" \
296 "${LIBCXXABI_DIR}" 318 "${LIBCXXABI_DIR}"
297 fi 319 fi
298 320
299 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974) 321 if [[ -n "$with_patches" ]]; then
300 pushd "${CLANG_DIR}" 322
301 cat << 'EOF' | 323 # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974)
324 pushd "${CLANG_DIR}"
325 cat << 'EOF' |
302 --- third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (revisio n 202554) 326 --- 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) 327 +++ third_party/llvm/tools/clang/test/Index/crash-recovery-modules.m (working copy)
304 @@ -12,6 +12,8 @@ 328 @@ -12,6 +12,8 @@
305 329
306 // REQUIRES: crash-recovery 330 // REQUIRES: crash-recovery
307 // REQUIRES: shell 331 // REQUIRES: shell
308 +// XFAIL: * 332 +// XFAIL: *
309 +// (PR11974) 333 +// (PR11974)
310 334
311 @import Crash; 335 @import Crash;
312 EOF 336 EOF
313 patch -p4 337 patch -p4
314 popd 338 popd
315 339
316 pushd "${CLANG_DIR}" 340 pushd "${CLANG_DIR}"
317 cat << 'EOF' | 341 cat << 'EOF' |
318 --- unittests/libclang/LibclangTest.cpp (revision 215949) 342 --- unittests/libclang/LibclangTest.cpp (revision 215949)
319 +++ unittests/libclang/LibclangTest.cpp (working copy) 343 +++ unittests/libclang/LibclangTest.cpp (working copy)
320 @@ -431,7 +431,7 @@ 344 @@ -431,7 +431,7 @@
321 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU)); 345 EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU));
322 } 346 }
323 347
324 -TEST_F(LibclangReparseTest, ReparseWithModule) { 348 -TEST_F(LibclangReparseTest, ReparseWithModule) {
325 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) { 349 +TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
326 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;"; 350 const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
327 const char *HeaderBottom = "\n};\n#endif\n"; 351 const char *HeaderBottom = "\n};\n#endif\n";
328 const char *MFile = "#include \"HeaderFile.h\"\nint main() {" 352 const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
329 EOF 353 EOF
330 patch -p0 354 patch -p0
331 popd 355 popd
332 356
333 # Apply r223211: "Revert r222997." 357 # Apply r223211: "Revert r222997."
334 pushd "${LLVM_DIR}" 358 pushd "${LLVM_DIR}"
335 cat << 'EOF' | 359 cat << 'EOF' |
336 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp 360 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp
337 +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp 361 +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp
338 @@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySan itizerVisitor> { 362 @@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySan itizerVisitor> {
339 Value *OriginPtr = 363 Value *OriginPtr =
340 getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset); 364 getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
341 setOrigin(A, EntryIRB.CreateLoad(OriginPtr)); 365 setOrigin(A, EntryIRB.CreateLoad(OriginPtr));
342 - } else { 366 - } else {
343 - setOrigin(A, getCleanOrigin()); 367 - setOrigin(A, getCleanOrigin());
344 } 368 }
345 } 369 }
(...skipping 23 matching lines...) Expand all
369 /// \brief Get the origin for i-th argument of the instruction I. 393 /// \brief Get the origin for i-th argument of the instruction I.
370 @@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> { 394 @@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemoryS anitizerVisitor> {
371 IRB.CreateStore(getCleanShadow(&I), ShadowPtr); 395 IRB.CreateStore(getCleanShadow(&I), ShadowPtr);
372 396
373 setShadow(&I, getCleanShadow(&I)); 397 setShadow(&I, getCleanShadow(&I));
374 - setOrigin(&I, getCleanOrigin()); 398 - setOrigin(&I, getCleanOrigin());
375 } 399 }
376 400
377 void visitAtomicRMWInst(AtomicRMWInst &I) { 401 void visitAtomicRMWInst(AtomicRMWInst &I) {
378 EOF 402 EOF
379 patch -p1 403 patch -p1
380 popd 404 popd
381 405
382 # Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command" 406 # Apply r223219: "Preserve LD_LIBRARY_PATH when using the 'env' command"
383 pushd "${CLANG_DIR}" 407 pushd "${CLANG_DIR}"
384 cat << 'EOF' | 408 cat << 'EOF' |
385 --- a/test/Driver/env.c 409 --- a/test/Driver/env.c
386 +++ b/test/Driver/env.c 410 +++ b/test/Driver/env.c
387 @@ -5,12 +5,14 @@ 411 @@ -5,12 +5,14 @@
388 // REQUIRES: shell 412 // REQUIRES: shell
389 // 413 //
390 // The PATH variable is heavily used when trying to find a linker. 414 // 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 \ 415 -// 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" \ 416 +// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
393 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 417 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
394 // RUN: --target=i386-unknown-linux \ 418 // RUN: --target=i386-unknown-linux \
395 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 419 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
396 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 420 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
397 // 421 //
398 -// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2 >&1 \ 422 -// 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" \ 423 +// 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 \ 424 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
401 // RUN: --target=i386-unknown-linux \ 425 // RUN: --target=i386-unknown-linux \
402 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 426 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
403 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 427 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
404 EOF 428 EOF
405 patch -p1 429 patch -p1
406 popd 430 popd
407 431
408 # Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed" 432 # Revert r220714: "Frontend: Define __EXCEPTIONS if -fexceptions is passed"
409 pushd "${CLANG_DIR}" 433 pushd "${CLANG_DIR}"
410 cat << 'EOF' | 434 cat << 'EOF' |
411 --- a/lib/Frontend/InitPreprocessor.cpp 435 --- a/lib/Frontend/InitPreprocessor.cpp
412 +++ b/lib/Frontend/InitPreprocessor.cpp 436 +++ b/lib/Frontend/InitPreprocessor.cpp
413 @@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, 437 @@ -566,7 +566,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
414 Builder.defineMacro("__BLOCKS__"); 438 Builder.defineMacro("__BLOCKS__");
415 } 439 }
416 440
417 - if (!LangOpts.MSVCCompat && LangOpts.Exceptions) 441 - if (!LangOpts.MSVCCompat && LangOpts.Exceptions)
418 + if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions) 442 + if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
419 Builder.defineMacro("__EXCEPTIONS"); 443 Builder.defineMacro("__EXCEPTIONS");
420 if (!LangOpts.MSVCCompat && LangOpts.RTTI) 444 if (!LangOpts.MSVCCompat && LangOpts.RTTI)
(...skipping 20 matching lines...) Expand all
441 +++ b/test/Preprocessor/predefined-exceptions.m 465 +++ b/test/Preprocessor/predefined-exceptions.m
442 @@ -1,6 +1,6 @@ 466 @@ -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 467 // 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 468 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
445 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1 469 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
446 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1 470 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
447 471
448 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s 472 // 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 473 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
450 EOF 474 EOF
451 patch -p1 475 patch -p1
452 popd 476 popd
453 477
454 # Apply r223177: "Ensure typos in the default values of template parameters get diagnosed." 478 # Apply r223177: "Ensure typos in the default values of template parameters ge t diagnosed."
455 pushd "${CLANG_DIR}" 479 pushd "${CLANG_DIR}"
456 cat << 'EOF' | 480 cat << 'EOF' |
457 --- a/lib/Parse/ParseTemplate.cpp 481 --- a/lib/Parse/ParseTemplate.cpp
458 +++ b/lib/Parse/ParseTemplate.cpp 482 +++ b/lib/Parse/ParseTemplate.cpp
459 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign ed Position) { 483 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign ed Position) {
460 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); 484 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false);
461 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); 485 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
462 486
463 - DefaultArg = ParseAssignmentExpression(); 487 - DefaultArg = ParseAssignmentExpression();
464 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()) ; 488 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()) ;
465 if (DefaultArg.isInvalid()) 489 if (DefaultArg.isInvalid())
466 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch); 490 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch);
(...skipping 18 matching lines...) Expand all
485 +++ b/test/SemaCXX/typo-correction-delayed.cpp 509 +++ b/test/SemaCXX/typo-correction-delayed.cpp
486 @@ -102,3 +102,7 @@ void f(int *i) { 510 @@ -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'{{$}}}} 511 __atomic_load(i, i, something_something); // expected-error-re {{use of unde clared identifier 'something_something'{{$}}}}
488 } 512 }
489 } 513 }
490 + 514 +
491 +const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}} 515 +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'?}} 516 +template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
493 +S<1> s; 517 +S<1> s;
494 EOF 518 EOF
495 patch -p1 519 patch -p1
496 popd 520 popd
497 521
498 # Apply r223209: "Handle delayed corrections in a couple more error paths in Par sePostfixExpressionSuffix." 522 # Apply r223209: "Handle delayed corrections in a couple more error paths in P arsePostfixExpressionSuffix."
499 pushd "${CLANG_DIR}" 523 pushd "${CLANG_DIR}"
500 cat << 'EOF' | 524 cat << 'EOF' |
501 --- a/lib/Parse/ParseExpr.cpp 525 --- a/lib/Parse/ParseExpr.cpp
502 +++ b/lib/Parse/ParseExpr.cpp 526 +++ b/lib/Parse/ParseExpr.cpp
503 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { 527 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
504 SourceLocation OpenLoc = ConsumeToken(); 528 SourceLocation OpenLoc = ConsumeToken();
505 529
506 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) { 530 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) {
507 + (void)Actions.CorrectDelayedTyposInExpr(LHS); 531 + (void)Actions.CorrectDelayedTyposInExpr(LHS);
508 LHS = ExprError(); 532 LHS = ExprError();
509 } 533 }
510 534
(...skipping 13 matching lines...) Expand all
524 const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}} 548 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'?}} 549 template <int I = defaultArg> struct S {}; // expected-error {{use of undeclar ed identifier 'defaultArg'; did you mean 'DefaultArg'?}}
526 S<1> s; 550 S<1> s;
527 + 551 +
528 +namespace foo {} 552 +namespace foo {}
529 +void test_paren_suffix() { 553 +void test_paren_suffix() {
530 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \ 554 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \
531 + // expected-error {{expected expression}} 555 + // expected-error {{expected expression}}
532 +} 556 +}
533 EOF 557 EOF
534 patch -p1 558 patch -p1
535 popd 559 popd
536 560
537 # Apply r223705: "Handle possible TypoExprs in member initializers." 561 # Apply r223705: "Handle possible TypoExprs in member initializers."
538 pushd "${CLANG_DIR}" 562 pushd "${CLANG_DIR}"
539 cat << 'EOF' | 563 cat << 'EOF' |
540 --- a/lib/Sema/SemaDeclCXX.cpp 564 --- a/lib/Sema/SemaDeclCXX.cpp
541 +++ b/lib/Sema/SemaDeclCXX.cpp 565 +++ b/lib/Sema/SemaDeclCXX.cpp
542 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD, 566 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD,
543 SourceLocation IdLoc, 567 SourceLocation IdLoc,
544 Expr *Init, 568 Expr *Init,
545 SourceLocation EllipsisLoc) { 569 SourceLocation EllipsisLoc) {
546 + ExprResult Res = CorrectDelayedTyposInExpr(Init); 570 + ExprResult Res = CorrectDelayedTyposInExpr(Init);
547 + if (!Res.isUsable()) 571 + if (!Res.isUsable())
548 + return true; 572 + return true;
549 + Init = Res.get(); 573 + Init = Res.get();
(...skipping 10 matching lines...) Expand all
560 // expected-error {{expected expression}} 584 // expected-error {{expected expression}}
561 } 585 }
562 + 586 +
563 +const int kNum = 10; // expected-note {{'kNum' declared here}} 587 +const int kNum = 10; // expected-note {{'kNum' declared here}}
564 +class SomeClass { 588 +class SomeClass {
565 + int Kind; 589 + int Kind;
566 +public: 590 +public:
567 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}} 591 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i dentifier 'kSum'; did you mean 'kNum'?}}
568 +}; 592 +};
569 EOF 593 EOF
570 patch -p1 594 patch -p1
571 popd 595 popd
572 596
573 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overload resolution" 597 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overlo ad resolution"
574 pushd "${CLANG_DIR}" 598 pushd "${CLANG_DIR}"
575 cat << 'EOF' | 599 cat << 'EOF' |
576 --- a/lib/Sema/SemaExprCXX.cpp 600 --- a/lib/Sema/SemaExprCXX.cpp
577 +++ b/lib/Sema/SemaExprCXX.cpp 601 +++ b/lib/Sema/SemaExprCXX.cpp
578 @@ -6105,8 +6105,13 @@ public: 602 @@ -6105,8 +6105,13 @@ public:
579 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, 603 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
580 RParenLoc, ExecConfig); 604 RParenLoc, ExecConfig);
581 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { 605 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
582 - if (!Result.isInvalid() && Result.get()) 606 - if (!Result.isInvalid() && Result.get())
583 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee(); 607 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee();
584 + if (!Result.isInvalid() && Result.get()) { 608 + if (!Result.isInvalid() && Result.get()) {
585 + Expr *ResultCall = Result.get(); 609 + Expr *ResultCall = Result.get();
(...skipping 27 matching lines...) Expand all
613 +int main() { 637 +int main() {
614 + // expected-note@+1 {{'result' declared here}} 638 + // expected-note@+1 {{'result' declared here}}
615 + const char *result; 639 + const char *result;
616 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}} 640 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
617 + if (AssertionResult ar = (Compare("value1", resulta))) 641 + if (AssertionResult ar = (Compare("value1", resulta)))
618 + ; 642 + ;
619 + else 643 + else
620 + printf("ar: %d\n", ar.val); 644 + printf("ar: %d\n", ar.val);
621 +} 645 +}
622 EOF 646 EOF
623 patch -p1 647 patch -p1
624 popd 648 popd
625 649
626 # Apply r224173: "Implement feedback on r224172 in PR21899" 650 # Apply r224173: "Implement feedback on r224172 in PR21899"
627 pushd "${CLANG_DIR}" 651 pushd "${CLANG_DIR}"
628 cat << 'EOF' | 652 cat << 'EOF' |
629 --- a/lib/Sema/SemaExprCXX.cpp 653 --- a/lib/Sema/SemaExprCXX.cpp
630 +++ b/lib/Sema/SemaExprCXX.cpp 654 +++ b/lib/Sema/SemaExprCXX.cpp
631 @@ -6105,7 +6105,7 @@ public: 655 @@ -6105,7 +6105,7 @@ public:
632 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, 656 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args,
633 RParenLoc, ExecConfig); 657 RParenLoc, ExecConfig);
634 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { 658 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) {
635 - if (!Result.isInvalid() && Result.get()) { 659 - if (!Result.isInvalid() && Result.get()) {
636 + if (Result.isUsable()) { 660 + if (Result.isUsable()) {
637 Expr *ResultCall = Result.get(); 661 Expr *ResultCall = Result.get();
638 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall)) 662 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall))
(...skipping 24 matching lines...) Expand all
663 // expected-note@+1 {{'result' declared here}} 687 // expected-note@+1 {{'result' declared here}}
664 const char *result; 688 const char *result;
665 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}} 689 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean ' result'?}}
666 - if (AssertionResult ar = (Compare("value1", resulta))) 690 - if (AssertionResult ar = (Compare("value1", resulta)))
667 - ; 691 - ;
668 - else 692 - else
669 - printf("ar: %d\n", ar.val); 693 - printf("ar: %d\n", ar.val);
670 + Overload(resulta); 694 + Overload(resulta);
671 } 695 }
672 EOF 696 EOF
673 patch -p1 697 patch -p1
674 popd 698 popd
675 699
676 700 # 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) 701 pushd "${LLVM_DIR}"
678 pushd "${LLVM_DIR}" 702 cat << 'EOF' |
679 cat << 'EOF' |
680 Index: test/Bindings/Go/go.test 703 Index: test/Bindings/Go/go.test
681 =================================================================== 704 ===================================================================
682 --- test/Bindings/Go/go.test (revision 223109) 705 --- test/Bindings/Go/go.test (revision 223109)
683 +++ test/Bindings/Go/go.test (working copy) 706 +++ test/Bindings/Go/go.test (working copy)
684 @@ -1,3 +1,3 @@ 707 @@ -1,3 +1,3 @@
685 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm 708 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
686 +; RUN: true 709 +; RUN: true
687 710
688 ; REQUIRES: shell 711 ; REQUIRES: shell
689 EOF 712 EOF
690 patch -p0 713 patch -p0
691 popd 714 popd
692 715
716 fi
693 717
694 # Echo all commands. 718 # Echo all commands.
695 set -x 719 set -x
696 720
697 # Set default values for CC and CXX if they're not set in the environment. 721 # Set default values for CC and CXX if they're not set in the environment.
698 CC=${CC:-cc} 722 CC=${CC:-cc}
699 CXX=${CXX:-c++} 723 CXX=${CXX:-c++}
700 724
701 if [[ -n "${gcc_toolchain}" ]]; then 725 if [[ -n "${gcc_toolchain}" ]]; then
702 # Use the specified gcc installation for building. 726 # Use the specified gcc installation for building.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 959
936 if [[ -n "$run_tests" ]]; then 960 if [[ -n "$run_tests" ]]; then
937 # Run Chrome tool tests. 961 # Run Chrome tool tests.
938 ninja -C "${LLVM_BUILD_DIR}" cr-check-all 962 ninja -C "${LLVM_BUILD_DIR}" cr-check-all
939 # Run the LLVM and Clang tests. 963 # Run the LLVM and Clang tests.
940 ninja -C "${LLVM_BUILD_DIR}" check-all 964 ninja -C "${LLVM_BUILD_DIR}" check-all
941 fi 965 fi
942 966
943 # After everything is done, log success for this revision. 967 # After everything is done, log success for this revision.
944 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" 968 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698