From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 22 15:00:56 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A5D7AD9; Sat, 22 Dec 2012 15:00:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0788FC0A; Sat, 22 Dec 2012 15:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBMF0uPN098239; Sat, 22 Dec 2012 15:00:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBMF0sRj098221; Sat, 22 Dec 2012 15:00:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212221500.qBMF0sRj098221@svn.freebsd.org> From: Dimitry Andric Date: Sat, 22 Dec 2012 15:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244592 - in vendor/clang/dist: docs include/clang/Sema lib/Basic lib/Driver lib/Parse lib/Sema test/CXX/basic/basic.scope/basic.scope.local test/Parser X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2012 15:00:56 -0000 Author: dim Date: Sat Dec 22 15:00:54 2012 New Revision: 244592 URL: http://svnweb.freebsd.org/changeset/base/244592 Log: Vendor import of clang tags/RELEASE_32/final r170710 (effectively, 3.2 release): http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final@170710 Modified: vendor/clang/dist/docs/ReleaseNotes.html vendor/clang/dist/include/clang/Sema/Scope.h vendor/clang/dist/lib/Basic/Version.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Sema/IdentifierResolver.cpp vendor/clang/dist/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp vendor/clang/dist/test/Parser/bracket-crash.cpp Modified: vendor/clang/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.html Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/docs/ReleaseNotes.html Sat Dec 22 15:00:54 2012 (r244592) @@ -43,12 +43,6 @@ td {

Written by the LLVM Team

-

These are in-progress notes for the upcoming Clang 3.2 -release.
-You may prefer the -Clang 3.1 -Release Notes.

-

Introduction

@@ -91,7 +85,7 @@ explain them more clearly, and provide m them. The improvements since the 3.1 release include:

    -
  • -Wuninitialized has been taught to recognise uninitialized uses +
  • -Wuninitialized has been taught to recognize uninitialized uses which always occur when an explicitly-written non-constant condition is either true or false. For example: @@ -170,14 +164,11 @@ int f(vector<map<int, double>&g
  • -
  • Clang's -fcatch-undefined-behavior option has been renamed to - -fsanitize=undefined and has grown the ability to check for several - new types of undefined behavior. See the Users Manual for more information. - - - - - +
  • The Address Sanitizer feature and Clang's -fcatch-undefined-behavior option have been moved to a unified flag set: + -fsanitize. This flag can be used to enable the different dynamic checking tools when building. For example, + -faddress-sanitizer is now -fsanitize=address, and -fcatch-undefined-behavior is now + -fsanitize=undefined. With this release the set of checks available continues to grow, see the Clang + documentation and specific sanitizer notes below for details.
@@ -215,6 +206,35 @@ function call.

pointer_with_type_tag and type_tag_for_datatype attributes in Clang language extensions documentation.

+

Documentation comment support

+

Clang now supports documentation comments written in a Doxygen-like syntax. +Clang parses the comments and can detect syntactic and semantic errors in +comments. These warnings are off by default. Pass -Wdocumentation +flag to enable warnings about documentation comments.

+ +

For example, given:

+ +
/// \param [in] Str the string.
+/// \returns a modified string.
+void do_something(const std::string &str);
+ +

clang -Wdocumentation will emit two warnings:

+ +
doc-test.cc:3:6: warning: '\returns' command used in a comment that is attached to a function returning void [-Wdocumentation]
+/// \returns a modified string.
+    ~^~~~~~~~~~~~~~~~~~~~~~~~~~
+doc-test.cc:2:17: warning: parameter 'Str' not found in the function declaration [-Wdocumentation]
+/// \param [in] Str the string.
+                ^~~
+doc-test.cc:2:17: note: did you mean 'str'?
+/// \param [in] Str the string.
+                ^~~
+                str
+ +

libclang includes a new API, clang_FullComment_getAsXML, to convert +comments to XML documents. This API can be used to build documentation +extraction tools.

+

New Compiler Flags

@@ -239,7 +259,8 @@ attributes in Clang language extensions

C11 Feature Support

-

...

+

Clang 3.2 adds support for the C11 _Alignof keyword, pedantic warning through option + -Wempty-translation-unit (C11 6.9p1)

C++ Language Changes in Clang

@@ -247,40 +268,42 @@ attributes in Clang language extensions

C++11 Feature Support

-

...

+

Clang 3.2 supports most of the language features + added in the latest ISO C++ standard,C++ 2011. + Use -std=c++11 or -std=gnu++11 to enable support for these features. In addition to the features supported by Clang 3.1, the + following features have been added:

- -

Objective-C Language Changes in Clang

- - -

...

+
    +
  • Implemented the C++11 discarded value expression rules for volatile lvalues.
  • +
  • Support for the C++11 enum forward declarations.
  • +
  • Handling of C++11 attribute namespaces (automatically).
  • +
  • Implemented C++11 [conv.prom]p4: an enumeration with a fixed underlying type has integral promotions + to both its underlying type and to its underlying type's promoted type.
  • +
-

Internal API Changes

+

Objective-C Language Changes in Clang

-

These are major API changes that have happened since the 3.1 release of - Clang. If upgrading an external codebase that uses Clang as a library, this - section should help get you past the largest hurdles of upgrading.

- -

API change 1

- -

...

+

Bug-fixes, no functionality changes.

Python Binding Changes

-The following methods have been added: +The following classes and methods have been added:
    -
  • ...
  • +
  • class CompilationDatabaseError(Exception)
  • +
  • class CompileCommand(object)
  • +
  • class CompileCommands(object)
  • +
  • class CompilationDatabase(ClangObject)
  • +
  • Cursor.is_static_method
  • +
  • Cursor.is_static_method
  • +
  • SourceLocation.from_offset
  • +
  • Cursor.is_static_method
-

Significant Known Problems

- - -

Additional Information

@@ -296,17 +319,6 @@ The following methods have been added: the mailing list.

- - - - Modified: vendor/clang/dist/include/clang/Sema/Scope.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Scope.h Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/include/clang/Sema/Scope.h Sat Dec 22 15:00:54 2012 (r244592) @@ -84,11 +84,18 @@ public: /// TryScope - This is the scope of a C++ try statement. TryScope = 0x1000, + /// CatchScope - This is the scope of a C++ catch statement. + CatchScope = 0x2000, + + /// FnTryCatchScope - This is the scope for a function-level C++ try or + /// catch scope. + FnTryCatchScope = 0x4000, + /// FnTryScope - This is the scope of a function-level C++ try scope. - FnTryScope = 0x3000, + FnTryScope = TryScope | FnTryCatchScope, /// FnCatchScope - This is the scope of a function-level C++ catch scope. - FnCatchScope = 0x4000 + FnCatchScope = CatchScope | FnTryCatchScope }; private: /// The parent scope for this scope. This is null for the translation-unit Modified: vendor/clang/dist/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Version.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/lib/Basic/Version.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -32,7 +32,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/branches/release_32/lib/Basic/Version.cpp $"); + static StringRef SVNRepository("$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: vendor/clang/dist/lib/Driver/ToolChains.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/ToolChains.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/lib/Driver/ToolChains.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -1855,6 +1855,8 @@ enum LinuxDistro { UbuntuNatty, UbuntuOneiric, UbuntuPrecise, + UbuntuQuantal, + UbuntuRaring, UnknownDistro }; @@ -1872,7 +1874,7 @@ static bool IsDebian(enum LinuxDistro Di } static bool IsUbuntu(enum LinuxDistro Distro) { - return Distro >= UbuntuHardy && Distro <= UbuntuPrecise; + return Distro >= UbuntuHardy && Distro <= UbuntuRaring; } static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) { @@ -1894,6 +1896,8 @@ static LinuxDistro DetectLinuxDistro(llv .Case("natty", UbuntuNatty) .Case("oneiric", UbuntuOneiric) .Case("precise", UbuntuPrecise) + .Case("quantal", UbuntuQuantal) + .Case("raring", UbuntuRaring) .Default(UnknownDistro); return Version; } Modified: vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -706,8 +706,7 @@ SourceLocation Parser::ParseDecltypeSpec if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) { EndLoc = ConsumeParen(); } else { - assert(Tok.is(tok::semi)); - if (PP.isBacktrackEnabled()) { + if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) { // Backtrack to get the location of the last token before the semi. PP.RevertCachedTokens(2); ConsumeToken(); // the semi. Modified: vendor/clang/dist/lib/Parse/ParseStmt.cpp ============================================================================== --- vendor/clang/dist/lib/Parse/ParseStmt.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/lib/Parse/ParseStmt.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -2197,7 +2197,7 @@ StmtResult Parser::ParseCXXCatchBlock(bo // The name in a catch exception-declaration is local to the handler and // shall not be redeclared in the outermost block of the handler. ParseScope CatchScope(this, Scope::DeclScope | Scope::ControlScope | - (FnCatch ? Scope::FnCatchScope : 0)); + (FnCatch ? Scope::FnCatchScope : Scope::CatchScope)); // exception-declaration is equivalent to '...' or a parameter-declaration // without default arguments. Modified: vendor/clang/dist/lib/Sema/IdentifierResolver.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/IdentifierResolver.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/lib/Sema/IdentifierResolver.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -135,16 +135,13 @@ bool IdentifierResolver::isDeclInScope(D // of the controlled statement. // assert(S->getParent() && "No TUScope?"); - if (S->getFlags() & Scope::FnTryScope) - return S->getParent()->isDeclScope(D); if (S->getParent()->getFlags() & Scope::ControlScope) { - if (S->getParent()->getFlags() & Scope::FnCatchScope) { - S = S->getParent(); - if (S->isDeclScope(D)) - return true; - } - return S->getParent()->isDeclScope(D); + S = S->getParent(); + if (S->isDeclScope(D)) + return true; } + if (S->getFlags() & Scope::FnTryCatchScope) + return S->getParent()->isDeclScope(D); } return false; } Modified: vendor/clang/dist/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp ============================================================================== --- vendor/clang/dist/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/test/CXX/basic/basic.scope/basic.scope.local/p2.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -35,3 +35,26 @@ void func7() { int i; // expected-error{{redefinition of 'i'}} } } + +void func8() { + int i; + try { + int i; + } catch (...) { + } +} + +void func9() { + if (bool b = true) + try { + int b; // FIXME: this probably should be invalid, maybe + } catch (...) { + } +} + +void func10() { + if (bool b = true) + if (true) { + int b; // FIXME: decide whether this is valid + } +} Modified: vendor/clang/dist/test/Parser/bracket-crash.cpp ============================================================================== --- vendor/clang/dist/test/Parser/bracket-crash.cpp Sat Dec 22 14:59:27 2012 (r244591) +++ vendor/clang/dist/test/Parser/bracket-crash.cpp Sat Dec 22 15:00:54 2012 (r244592) @@ -4,3 +4,6 @@ decltype(; struct{ a } + +// PR14549. Must be at end of file. +decltype(