OLD | NEW |
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=223109 | 11 CLANG_REVISION=223108 |
12 | 12 |
13 THIS_DIR="$(dirname "${0}")" | 13 THIS_DIR="$(dirname "${0}")" |
14 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" | 14 LLVM_DIR="${THIS_DIR}/../../../third_party/llvm" |
15 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" | 15 LLVM_BUILD_DIR="${LLVM_DIR}/../llvm-build/Release+Asserts" |
16 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" | 16 COMPILER_RT_BUILD_DIR="${LLVM_DIR}/../llvm-build/compiler-rt" |
17 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap" | 17 LLVM_BOOTSTRAP_DIR="${LLVM_DIR}/../llvm-bootstrap" |
18 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install" | 18 LLVM_BOOTSTRAP_INSTALL_DIR="${LLVM_DIR}/../llvm-bootstrap-install" |
19 CLANG_DIR="${LLVM_DIR}/tools/clang" | 19 CLANG_DIR="${LLVM_DIR}/tools/clang" |
20 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt" | 20 COMPILER_RT_DIR="${LLVM_DIR}/compiler-rt" |
21 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx" | 21 LIBCXX_DIR="${LLVM_DIR}/projects/libcxx" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 "${COMPILER_RT_DIR}/test/asan/TestCases/Linux/new_array_cookie_test.cc" \ | 237 "${COMPILER_RT_DIR}/test/asan/TestCases/Linux/new_array_cookie_test.cc" \ |
238 "${LLVM_DIR}/test/DebugInfo/gmlt.ll" \ | 238 "${LLVM_DIR}/test/DebugInfo/gmlt.ll" \ |
239 "${LLVM_DIR}/lib/CodeGen/SpillPlacement.cpp" \ | 239 "${LLVM_DIR}/lib/CodeGen/SpillPlacement.cpp" \ |
240 "${LLVM_DIR}/lib/CodeGen/SpillPlacement.h" \ | 240 "${LLVM_DIR}/lib/CodeGen/SpillPlacement.h" \ |
241 "${LLVM_DIR}/lib/Transforms/Instrumentation/MemorySanitizer.cpp" \ | 241 "${LLVM_DIR}/lib/Transforms/Instrumentation/MemorySanitizer.cpp" \ |
242 "${CLANG_DIR}/test/Driver/env.c" \ | 242 "${CLANG_DIR}/test/Driver/env.c" \ |
243 "${CLANG_DIR}/lib/Frontend/InitPreprocessor.cpp" \ | 243 "${CLANG_DIR}/lib/Frontend/InitPreprocessor.cpp" \ |
244 "${CLANG_DIR}/test/Frontend/exceptions.c" \ | 244 "${CLANG_DIR}/test/Frontend/exceptions.c" \ |
245 "${CLANG_DIR}/test/Preprocessor/predefined-exceptions.m" \ | 245 "${CLANG_DIR}/test/Preprocessor/predefined-exceptions.m" \ |
246 "${LLVM_DIR}/test/Bindings/Go/go.test" \ | 246 "${LLVM_DIR}/test/Bindings/Go/go.test" \ |
| 247 "${CLANG_DIR}/lib/Parse/ParseExpr.cpp" \ |
| 248 "${CLANG_DIR}/lib/Parse/ParseTemplate.cpp" \ |
| 249 "${CLANG_DIR}/lib/Sema/SemaDeclCXX.cpp" \ |
| 250 "${CLANG_DIR}/lib/Sema/SemaExprCXX.cpp" \ |
| 251 "${CLANG_DIR}/test/SemaCXX/default2.cpp" \ |
| 252 "${CLANG_DIR}/test/SemaCXX/typo-correction-delayed.cpp" \ |
247 ; do | 253 ; do |
248 if [[ -e "${i}" ]]; then | 254 if [[ -e "${i}" ]]; then |
249 rm -f "${i}" # For unversioned files. | 255 rm -f "${i}" # For unversioned files. |
250 svn revert "${i}" | 256 svn revert "${i}" |
251 fi; | 257 fi; |
252 done | 258 done |
253 | 259 |
254 echo Remove the Clang tools shim dir | 260 echo Remove the Clang tools shim dir |
255 CHROME_TOOLS_SHIM_DIR=${ABS_LLVM_DIR}/tools/chrometools | 261 CHROME_TOOLS_SHIM_DIR=${ABS_LLVM_DIR}/tools/chrometools |
256 rm -rfv ${CHROME_TOOLS_SHIM_DIR} | 262 rm -rfv ${CHROME_TOOLS_SHIM_DIR} |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 | 444 // CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 |
439 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1 | 445 -// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1 |
440 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1 | 446 +// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1 |
441 | 447 |
442 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except
ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s | 448 // RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-except
ions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s |
443 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 | 449 // CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1 |
444 EOF | 450 EOF |
445 patch -p1 | 451 patch -p1 |
446 popd | 452 popd |
447 | 453 |
| 454 # Apply r223177: "Ensure typos in the default values of template parameters get
diagnosed." |
| 455 pushd "${CLANG_DIR}" |
| 456 cat << 'EOF' | |
| 457 --- a/lib/Parse/ParseTemplate.cpp |
| 458 +++ b/lib/Parse/ParseTemplate.cpp |
| 459 @@ -676,7 +676,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsign
ed Position) { |
| 460 GreaterThanIsOperatorScope G(GreaterThanIsOperator, false); |
| 461 EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); |
| 462 |
| 463 - DefaultArg = ParseAssignmentExpression(); |
| 464 + DefaultArg = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression())
; |
| 465 if (DefaultArg.isInvalid()) |
| 466 SkipUntil(tok::comma, tok::greater, StopAtSemi | StopBeforeMatch); |
| 467 } |
| 468 diff --git a/test/SemaCXX/default2.cpp b/test/SemaCXX/default2.cpp |
| 469 index 1626044..c4d40b4 100644 |
| 470 --- a/test/SemaCXX/default2.cpp |
| 471 +++ b/test/SemaCXX/default2.cpp |
| 472 @@ -122,3 +122,9 @@ class XX { |
| 473 void A(int length = -1 ) { } |
| 474 void B() { A(); } |
| 475 }; |
| 476 + |
| 477 +template <int I = (1 * I)> struct S {}; // expected-error-re {{use of undeclar
ed identifier 'I'{{$}}}} |
| 478 +S<1> s; |
| 479 + |
| 480 +template <int I1 = I2, int I2 = 1> struct T {}; // expected-error-re {{use of
undeclared identifier 'I2'{{$}}}} |
| 481 +T<0, 1> t; |
| 482 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc
tion-delayed.cpp |
| 483 index bff1d76..7bf9258 100644 |
| 484 --- a/test/SemaCXX/typo-correction-delayed.cpp |
| 485 +++ b/test/SemaCXX/typo-correction-delayed.cpp |
| 486 @@ -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'{{$}}}} |
| 488 } |
| 489 } |
| 490 + |
| 491 +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'?}} |
| 493 +S<1> s; |
| 494 EOF |
| 495 patch -p1 |
| 496 popd |
| 497 |
| 498 # Apply r223209: "Handle delayed corrections in a couple more error paths in Par
sePostfixExpressionSuffix." |
| 499 pushd "${CLANG_DIR}" |
| 500 cat << 'EOF' | |
| 501 --- a/lib/Parse/ParseExpr.cpp |
| 502 +++ b/lib/Parse/ParseExpr.cpp |
| 503 @@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { |
| 504 SourceLocation OpenLoc = ConsumeToken(); |
| 505 |
| 506 if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) { |
| 507 + (void)Actions.CorrectDelayedTyposInExpr(LHS); |
| 508 LHS = ExprError(); |
| 509 } |
| 510 |
| 511 @@ -1440,6 +1441,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { |
| 512 if (Tok.isNot(tok::r_paren)) { |
| 513 if (ParseExpressionList(ArgExprs, CommaLocs, &Sema::CodeCompleteCall, |
| 514 LHS.get())) { |
| 515 + (void)Actions.CorrectDelayedTyposInExpr(LHS); |
| 516 LHS = ExprError(); |
| 517 } |
| 518 } |
| 519 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc
tion-delayed.cpp |
| 520 index 7bf9258..f7ef015 100644 |
| 521 --- a/test/SemaCXX/typo-correction-delayed.cpp |
| 522 +++ b/test/SemaCXX/typo-correction-delayed.cpp |
| 523 @@ -106,3 +106,9 @@ void f(int *i) { |
| 524 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'?}} |
| 526 S<1> s; |
| 527 + |
| 528 +namespace foo {} |
| 529 +void test_paren_suffix() { |
| 530 + foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace
'foo'{{$}}}} \ |
| 531 + // expected-error {{expected expression}} |
| 532 +} |
| 533 EOF |
| 534 patch -p1 |
| 535 popd |
| 536 |
| 537 # Apply r223705: "Handle possible TypoExprs in member initializers." |
| 538 pushd "${CLANG_DIR}" |
| 539 cat << 'EOF' | |
| 540 --- a/lib/Sema/SemaDeclCXX.cpp |
| 541 +++ b/lib/Sema/SemaDeclCXX.cpp |
| 542 @@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD, |
| 543 SourceLocation IdLoc, |
| 544 Expr *Init, |
| 545 SourceLocation EllipsisLoc) { |
| 546 + ExprResult Res = CorrectDelayedTyposInExpr(Init); |
| 547 + if (!Res.isUsable()) |
| 548 + return true; |
| 549 + Init = Res.get(); |
| 550 + |
| 551 if (!ConstructorD) |
| 552 return true; |
| 553 |
| 554 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc
tion-delayed.cpp |
| 555 index f7ef015..d303b58 100644 |
| 556 --- a/test/SemaCXX/typo-correction-delayed.cpp |
| 557 +++ b/test/SemaCXX/typo-correction-delayed.cpp |
| 558 @@ -112,3 +112,10 @@ 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 + |
| 563 +const int kNum = 10; // expected-note {{'kNum' declared here}} |
| 564 +class SomeClass { |
| 565 + int Kind; |
| 566 +public: |
| 567 + explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i
dentifier 'kSum'; did you mean 'kNum'?}} |
| 568 +}; |
| 569 EOF |
| 570 patch -p1 |
| 571 popd |
| 572 |
| 573 # Apply r224172: "Typo correction: Ignore temporary binding exprs after overload
resolution" |
| 574 pushd "${CLANG_DIR}" |
| 575 cat << 'EOF' | |
| 576 --- a/lib/Sema/SemaExprCXX.cpp |
| 577 +++ b/lib/Sema/SemaExprCXX.cpp |
| 578 @@ -6105,8 +6105,13 @@ public: |
| 579 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, |
| 580 RParenLoc, ExecConfig); |
| 581 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { |
| 582 - if (!Result.isInvalid() && Result.get()) |
| 583 - OverloadResolution[OE] = cast<CallExpr>(Result.get())->getCallee(); |
| 584 + if (!Result.isInvalid() && Result.get()) { |
| 585 + Expr *ResultCall = Result.get(); |
| 586 + if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall)) |
| 587 + ResultCall = BE->getSubExpr(); |
| 588 + if (auto *CE = dyn_cast<CallExpr>(ResultCall)) |
| 589 + OverloadResolution[OE] = CE->getCallee(); |
| 590 + } |
| 591 } |
| 592 return Result; |
| 593 } |
| 594 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc
tion-delayed.cpp |
| 595 index d303b58..d42888f 100644 |
| 596 --- a/test/SemaCXX/typo-correction-delayed.cpp |
| 597 +++ b/test/SemaCXX/typo-correction-delayed.cpp |
| 598 @@ -119,3 +119,23 @@ class SomeClass { |
| 599 public: |
| 600 explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i
dentifier 'kSum'; did you mean 'kNum'?}} |
| 601 }; |
| 602 + |
| 603 +extern "C" int printf(const char *, ...); |
| 604 + |
| 605 +// There used to be an issue with typo resolution inside overloads. |
| 606 +struct AssertionResult { |
| 607 + ~AssertionResult(); |
| 608 + operator bool(); |
| 609 + int val; |
| 610 +}; |
| 611 +AssertionResult Compare(const char *a, const char *b); |
| 612 +AssertionResult Compare(int a, int b); |
| 613 +int main() { |
| 614 + // expected-note@+1 {{'result' declared here}} |
| 615 + const char *result; |
| 616 + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean '
result'?}} |
| 617 + if (AssertionResult ar = (Compare("value1", resulta))) |
| 618 + ; |
| 619 + else |
| 620 + printf("ar: %d\n", ar.val); |
| 621 +} |
| 622 EOF |
| 623 patch -p1 |
| 624 popd |
| 625 |
| 626 # Apply r224173: "Implement feedback on r224172 in PR21899" |
| 627 pushd "${CLANG_DIR}" |
| 628 cat << 'EOF' | |
| 629 --- a/lib/Sema/SemaExprCXX.cpp |
| 630 +++ b/lib/Sema/SemaExprCXX.cpp |
| 631 @@ -6105,7 +6105,7 @@ public: |
| 632 auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, |
| 633 RParenLoc, ExecConfig); |
| 634 if (auto *OE = dyn_cast<OverloadExpr>(Callee)) { |
| 635 - if (!Result.isInvalid() && Result.get()) { |
| 636 + if (Result.isUsable()) { |
| 637 Expr *ResultCall = Result.get(); |
| 638 if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall)) |
| 639 ResultCall = BE->getSubExpr(); |
| 640 diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correc
tion-delayed.cpp |
| 641 index d42888f..7879d29 100644 |
| 642 --- a/test/SemaCXX/typo-correction-delayed.cpp |
| 643 +++ b/test/SemaCXX/typo-correction-delayed.cpp |
| 644 @@ -120,22 +120,13 @@ public: |
| 645 explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared i
dentifier 'kSum'; did you mean 'kNum'?}} |
| 646 }; |
| 647 |
| 648 -extern "C" int printf(const char *, ...); |
| 649 - |
| 650 // There used to be an issue with typo resolution inside overloads. |
| 651 -struct AssertionResult { |
| 652 - ~AssertionResult(); |
| 653 - operator bool(); |
| 654 - int val; |
| 655 -}; |
| 656 -AssertionResult Compare(const char *a, const char *b); |
| 657 -AssertionResult Compare(int a, int b); |
| 658 -int main() { |
| 659 +struct AssertionResult { ~AssertionResult(); }; |
| 660 +AssertionResult Overload(const char *a); |
| 661 +AssertionResult Overload(int a); |
| 662 +void UseOverload() { |
| 663 // expected-note@+1 {{'result' declared here}} |
| 664 const char *result; |
| 665 // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean '
result'?}} |
| 666 - if (AssertionResult ar = (Compare("value1", resulta))) |
| 667 - ; |
| 668 - else |
| 669 - printf("ar: %d\n", ar.val); |
| 670 + Overload(resulta); |
| 671 } |
| 672 EOF |
| 673 patch -p1 |
| 674 popd |
| 675 |
| 676 |
448 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR2155
2) | 677 # This Go bindings test doesn't work after the bootstrap build on Linux. (PR2155
2) |
449 pushd "${LLVM_DIR}" | 678 pushd "${LLVM_DIR}" |
450 cat << 'EOF' | | 679 cat << 'EOF' | |
451 Index: test/Bindings/Go/go.test | 680 Index: test/Bindings/Go/go.test |
452 =================================================================== | 681 =================================================================== |
453 --- test/Bindings/Go/go.test (revision 223109) | 682 --- test/Bindings/Go/go.test (revision 223109) |
454 +++ test/Bindings/Go/go.test (working copy) | 683 +++ test/Bindings/Go/go.test (working copy) |
455 @@ -1,3 +1,3 @@ | 684 @@ -1,3 +1,3 @@ |
456 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm | 685 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm |
457 +; RUN: true | 686 +; RUN: true |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 | 935 |
707 if [[ -n "$run_tests" ]]; then | 936 if [[ -n "$run_tests" ]]; then |
708 # Run Chrome tool tests. | 937 # Run Chrome tool tests. |
709 ninja -C "${LLVM_BUILD_DIR}" cr-check-all | 938 ninja -C "${LLVM_BUILD_DIR}" cr-check-all |
710 # Run the LLVM and Clang tests. | 939 # Run the LLVM and Clang tests. |
711 ninja -C "${LLVM_BUILD_DIR}" check-all | 940 ninja -C "${LLVM_BUILD_DIR}" check-all |
712 fi | 941 fi |
713 | 942 |
714 # After everything is done, log success for this revision. | 943 # After everything is done, log success for this revision. |
715 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" | 944 echo "${CLANG_AND_PLUGINS_REVISION}" > "${STAMP_FILE}" |
OLD | NEW |