Skip to content

Commit

Permalink
Merge remote-tracking branch 'clang/master' into erj-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-jones committed Mar 29, 2016
2 parents aee6c13 + 18acf60 commit d529254
Show file tree
Hide file tree
Showing 291 changed files with 11,184 additions and 3,671 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -817,3 +817,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
ExternalProject_Add_StepTargets(${NEXT_CLANG_STAGE} ${target})
endforeach()
endif()

if (LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
add_subdirectory(utils/ClangVisualizers)
endif()
1 change: 1 addition & 0 deletions cmake/caches/Apple-stage1.cmake
Expand Up @@ -37,6 +37,7 @@ set(CLANG_BOOTSTRAP_TARGETS
check-all
check-llvm
check-clang
llvm-config
test-suite
test-depends
llvm-test-depends
Expand Down
29 changes: 29 additions & 0 deletions docs/ClangFormatStyleOptions.rst
Expand Up @@ -519,6 +519,19 @@ the configuration (without a prefix: ``Auto``).
- Regex: '.\*'
Priority: 1
**IncludeIsMainRegex** (``std::string``)
Specify a regular expression of suffixes that are allowed in the
file-to-main-include mapping.

When guessing whether a #include is the "main" include (to assign
category 0, see above), use this regex of allowed suffixes to the header
stem. A partial match is done, so that:
- "" means "arbitrary suffix"
- "$" means "no suffix"

For example, if configured to "(_test)?$", then a header a.h would be seen
as the "main" include in both a.cc and a_test.cc.

**IndentCaseLabels** (``bool``)
Indent case labels one level from the switch statement.

Expand All @@ -532,6 +545,22 @@ the configuration (without a prefix: ``Auto``).
Indent if a function definition or declaration is wrapped after the
type.

**JavaScriptQuotes** (``JavaScriptQuoteStyle``)
The JavaScriptQuoteStyle to use for JavaScript strings.

Possible values:

* ``JSQS_Leave`` (in configuration: ``Leave``)
Leave string quotes as they are.

* ``JSQS_Single`` (in configuration: ``Single``)
Always use single quotes.

* ``JSQS_Double`` (in configuration: ``Double``)
Always use double quotes.



**KeepEmptyLinesAtTheStartOfBlocks** (``bool``)
If true, empty lines at the start of blocks are kept.

Expand Down
29 changes: 29 additions & 0 deletions docs/LanguageExtensions.rst
Expand Up @@ -1505,6 +1505,35 @@ C-style cast applied to each element of the first argument.
Query for this feature with ``__has_builtin(__builtin_convertvector)``.
``__builtin_bitreverse``
------------------------
* ``__builtin_bitreverse8``
* ``__builtin_bitreverse16``
* ``__builtin_bitreverse32``
* ``__builtin_bitreverse64``
**Syntax**:
.. code-block:: c++
__builtin_bitreverse32(x)
**Examples**:
.. code-block:: c++
uint8_t rev_x = __builtin_bitreverse8(x);
uint16_t rev_x = __builtin_bitreverse16(x);
uint32_t rev_y = __builtin_bitreverse32(y);
uint64_t rev_z = __builtin_bitreverse64(z);
**Description**:
The '``__builtin_bitreverse``' family of builtins is used to reverse
the bitpattern of an integer value; for example ``0b10110110`` becomes
``0b01101101``.
``__builtin_unreachable``
-------------------------
Expand Down
12 changes: 12 additions & 0 deletions docs/LibASTMatchersReference.html
Expand Up @@ -4854,6 +4854,18 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
</pre></td></tr>


<tr><td>Matcher&lt;<a href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">ReturnStmt</a>&gt;</td><td class="name" onclick="toggle('hasReturnValue0')"><a name="hasReturnValue0Anchor">hasReturnValue</a></td><td>Matcher&lt;<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>&gt; InnerMatcher</td></tr>
<tr><td colspan="4" class="doc" id="hasReturnValue0"><pre>Matches the return value expression of a return statement

Given
return a + b;
hasReturnValue(binaryOperator())
matches 'return a + b'
with binaryOperator()
matching 'a + b'
</pre></td></tr>


<tr><td>Matcher&lt;<a href="http://clang.llvm.org/doxygen/classclang_1_1StmtExpr.html">StmtExpr</a>&gt;</td><td class="name" onclick="toggle('hasAnySubstatement1')"><a name="hasAnySubstatement1Anchor">hasAnySubstatement</a></td><td>Matcher&lt;<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt; InnerMatcher</td></tr>
<tr><td colspan="4" class="doc" id="hasAnySubstatement1"><pre>Matches compound statements where at least one substatement matches
a given matcher. Also matches StmtExprs that have CompoundStmt as children.
Expand Down
1 change: 1 addition & 0 deletions docs/ReleaseNotes.rst
Expand Up @@ -79,6 +79,7 @@ TLS is enabled for Cygwin defaults to -femulated-tls.

C Language Changes in Clang
---------------------------
The -faltivec and -maltivec flags no longer silently include altivec.h on Power platforms.

...

Expand Down
37 changes: 13 additions & 24 deletions docs/UsersManual.rst
Expand Up @@ -1770,13 +1770,11 @@ Intentionally unsupported GCC extensions
Microsoft extensions
--------------------

clang has some experimental support for extensions from Microsoft Visual
C++; to enable it, use the ``-fms-extensions`` command-line option. This is
the default for Windows targets. Note that the support is incomplete.
Some constructs such as ``dllexport`` on classes are ignored with a warning,
and others such as `Microsoft IDL annotations
<http://msdn.microsoft.com/en-us/library/8tesw2eh.aspx>`_ are silently
ignored.
clang has support for many extensions from Microsoft Visual C++. To enable these
extensions, use the ``-fms-extensions`` command-line option. This is the default
for Windows targets. Clang does not implement every pragma or declspec provided
by MSVC, but the popular ones, such as ``__declspec(dllexport)`` and ``#pragma
comment(lib)`` are well supported.

clang has a ``-fms-compatibility`` flag that makes clang accept enough
invalid C++ to be able to parse most Microsoft headers. For example, it
Expand All @@ -1789,23 +1787,14 @@ for Windows targets.
definitions until the end of a translation unit. This flag is enabled by
default for Windows targets.

- clang allows setting ``_MSC_VER`` with ``-fmsc-version=``. It defaults to
1700 which is the same as Visual C/C++ 2012. Any number is supported
and can greatly affect what Windows SDK and c++stdlib headers clang
can compile.
- clang does not support the Microsoft extension where anonymous record
members can be declared using user defined typedefs.
- clang supports the Microsoft ``#pragma pack`` feature for controlling
record layout. GCC also contains support for this feature, however
where MSVC and GCC are incompatible clang follows the MSVC
definition.
- clang supports the Microsoft ``#pragma comment(lib, "foo.lib")`` feature for
automatically linking against the specified library. Currently this feature
only works with the Visual C++ linker.
- clang supports the Microsoft ``#pragma comment(linker, "/flag:foo")`` feature
for adding linker flags to COFF object files. The user is responsible for
ensuring that the linker understands the flags.
- clang defaults to C++11 for Windows targets.
For compatibility with existing code that compiles with MSVC, clang defines the
``_MSC_VER`` and ``_MSC_FULL_VER`` macros. These default to the values of 1800
and 180000000 respectively, making clang look like an early release of Visual
C++ 2013. The ``-fms-compatibility-version=`` flag overrides these values. It
accepts a dotted version tuple, such as 19.00.23506. Changing the MSVC
compatibility version makes clang behave more like that version of MSVC. For
example, ``-fms-compatibility-version=19`` will enable C++14 features and define
``char16_t`` and ``char32_t`` as builtin types.

.. _cxx:

Expand Down
2 changes: 1 addition & 1 deletion include/clang-c/Index.h
Expand Up @@ -4958,7 +4958,7 @@ CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
* Note that the column should point just after the syntactic construct that
* initiated code completion, and not in the middle of a lexical token.
*
* \param unsaved_files the Tiles that have not yet been saved to disk
* \param unsaved_files the Files that have not yet been saved to disk
* but may be required for parsing or code completion, including the
* contents of those files. The contents and name of these files (as
* specified by CXUnsavedFile) are copied when necessary, so the
Expand Down
5 changes: 3 additions & 2 deletions include/clang/AST/ASTContext.h
Expand Up @@ -36,6 +36,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/Support/Allocator.h"
Expand Down Expand Up @@ -393,8 +394,8 @@ class ASTContext : public RefCountedBase<ASTContext> {

/// \brief Side-table of mangling numbers for declarations which rarely
/// need them (like static local vars).
llvm::DenseMap<const NamedDecl *, unsigned> MangleNumbers;
llvm::DenseMap<const VarDecl *, unsigned> StaticLocalNumbers;
llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;

/// \brief Mapping that stores parameterIndex values for ParmVarDecls when
/// that value exceeds the bitfield size of ParmVarDeclBits.ParameterIndex.
Expand Down
74 changes: 37 additions & 37 deletions include/clang/AST/DeclCXX.h
Expand Up @@ -301,30 +301,30 @@ class CXXRecordDecl : public RecordDecl {
DefinitionData(CXXRecordDecl *D);

/// \brief True if this class has any user-declared constructors.
bool UserDeclaredConstructor : 1;
unsigned UserDeclaredConstructor : 1;

/// \brief The user-declared special members which this class has.
unsigned UserDeclaredSpecialMembers : 6;

/// \brief True when this class is an aggregate.
bool Aggregate : 1;
unsigned Aggregate : 1;

/// \brief True when this class is a POD-type.
bool PlainOldData : 1;
unsigned PlainOldData : 1;

/// true when this class is empty for traits purposes,
/// i.e. has no data members other than 0-width bit-fields, has no
/// virtual function/base, and doesn't inherit from a non-empty
/// class. Doesn't take union-ness into account.
bool Empty : 1;
unsigned Empty : 1;

/// \brief True when this class is polymorphic, i.e., has at
/// least one virtual member or derives from a polymorphic class.
bool Polymorphic : 1;
unsigned Polymorphic : 1;

/// \brief True when this class is abstract, i.e., has at least
/// one pure virtual function, (that can come from a base class).
bool Abstract : 1;
unsigned Abstract : 1;

/// \brief True when this class has standard layout.
///
Expand All @@ -340,62 +340,62 @@ class CXXRecordDecl : public RecordDecl {
/// classes with non-static data members, and
/// * has no base classes of the same type as the first non-static data
/// member.
bool IsStandardLayout : 1;
unsigned IsStandardLayout : 1;

/// \brief True when there are no non-empty base classes.
///
/// This is a helper bit of state used to implement IsStandardLayout more
/// efficiently.
bool HasNoNonEmptyBases : 1;
unsigned HasNoNonEmptyBases : 1;

/// \brief True when there are private non-static data members.
bool HasPrivateFields : 1;
unsigned HasPrivateFields : 1;

/// \brief True when there are protected non-static data members.
bool HasProtectedFields : 1;
unsigned HasProtectedFields : 1;

/// \brief True when there are private non-static data members.
bool HasPublicFields : 1;
unsigned HasPublicFields : 1;

/// \brief True if this class (or any subobject) has mutable fields.
bool HasMutableFields : 1;
unsigned HasMutableFields : 1;

/// \brief True if this class (or any nested anonymous struct or union)
/// has variant members.
bool HasVariantMembers : 1;
unsigned HasVariantMembers : 1;

/// \brief True if there no non-field members declared by the user.
bool HasOnlyCMembers : 1;
unsigned HasOnlyCMembers : 1;

/// \brief True if any field has an in-class initializer, including those
/// within anonymous unions or structs.
bool HasInClassInitializer : 1;
unsigned HasInClassInitializer : 1;

/// \brief True if any field is of reference type, and does not have an
/// in-class initializer.
///
/// In this case, value-initialization of this class is illegal in C++98
/// even if the class has a trivial default constructor.
bool HasUninitializedReferenceMember : 1;
unsigned HasUninitializedReferenceMember : 1;

/// \brief True if any non-mutable field whose type doesn't have a user-
/// provided default ctor also doesn't have an in-class initializer.
bool HasUninitializedFields : 1;
unsigned HasUninitializedFields : 1;

/// \brief These flags are \c true if a defaulted corresponding special
/// member can't be fully analyzed without performing overload resolution.
/// @{
bool NeedOverloadResolutionForMoveConstructor : 1;
bool NeedOverloadResolutionForMoveAssignment : 1;
bool NeedOverloadResolutionForDestructor : 1;
unsigned NeedOverloadResolutionForMoveConstructor : 1;
unsigned NeedOverloadResolutionForMoveAssignment : 1;
unsigned NeedOverloadResolutionForDestructor : 1;
/// @}

/// \brief These flags are \c true if an implicit defaulted corresponding
/// special member would be defined as deleted.
/// @{
bool DefaultedMoveConstructorIsDeleted : 1;
bool DefaultedMoveAssignmentIsDeleted : 1;
bool DefaultedDestructorIsDeleted : 1;
unsigned DefaultedMoveConstructorIsDeleted : 1;
unsigned DefaultedMoveAssignmentIsDeleted : 1;
unsigned DefaultedDestructorIsDeleted : 1;
/// @}

/// \brief The trivial special members which this class has, per
Expand All @@ -415,63 +415,63 @@ class CXXRecordDecl : public RecordDecl {
unsigned DeclaredNonTrivialSpecialMembers : 6;

/// \brief True when this class has a destructor with no semantic effect.
bool HasIrrelevantDestructor : 1;
unsigned HasIrrelevantDestructor : 1;

/// \brief True when this class has at least one user-declared constexpr
/// constructor which is neither the copy nor move constructor.
bool HasConstexprNonCopyMoveConstructor : 1;
unsigned HasConstexprNonCopyMoveConstructor : 1;

/// \brief True if this class has a (possibly implicit) defaulted default
/// constructor.
bool HasDefaultedDefaultConstructor : 1;
unsigned HasDefaultedDefaultConstructor : 1;

/// \brief True if a defaulted default constructor for this class would
/// be constexpr.
bool DefaultedDefaultConstructorIsConstexpr : 1;
unsigned DefaultedDefaultConstructorIsConstexpr : 1;

/// \brief True if this class has a constexpr default constructor.
///
/// This is true for either a user-declared constexpr default constructor
/// or an implicitly declared constexpr default constructor.
bool HasConstexprDefaultConstructor : 1;
unsigned HasConstexprDefaultConstructor : 1;

/// \brief True when this class contains at least one non-static data
/// member or base class of non-literal or volatile type.
bool HasNonLiteralTypeFieldsOrBases : 1;
unsigned HasNonLiteralTypeFieldsOrBases : 1;

/// \brief True when visible conversion functions are already computed
/// and are available.
bool ComputedVisibleConversions : 1;
unsigned ComputedVisibleConversions : 1;

/// \brief Whether we have a C++11 user-provided default constructor (not
/// explicitly deleted or defaulted).
bool UserProvidedDefaultConstructor : 1;
unsigned UserProvidedDefaultConstructor : 1;

/// \brief The special members which have been declared for this class,
/// either by the user or implicitly.
unsigned DeclaredSpecialMembers : 6;

/// \brief Whether an implicit copy constructor would have a const-qualified
/// parameter.
bool ImplicitCopyConstructorHasConstParam : 1;
unsigned ImplicitCopyConstructorHasConstParam : 1;

/// \brief Whether an implicit copy assignment operator would have a
/// const-qualified parameter.
bool ImplicitCopyAssignmentHasConstParam : 1;
unsigned ImplicitCopyAssignmentHasConstParam : 1;

/// \brief Whether any declared copy constructor has a const-qualified
/// parameter.
bool HasDeclaredCopyConstructorWithConstParam : 1;
unsigned HasDeclaredCopyConstructorWithConstParam : 1;

/// \brief Whether any declared copy assignment operator has either a
/// const-qualified reference parameter or a non-reference parameter.
bool HasDeclaredCopyAssignmentWithConstParam : 1;
unsigned HasDeclaredCopyAssignmentWithConstParam : 1;

/// \brief Whether this class describes a C++ lambda.
bool IsLambda : 1;
unsigned IsLambda : 1;

/// \brief Whether we are currently parsing base specifiers.
bool IsParsingBaseSpecifiers : 1;
unsigned IsParsingBaseSpecifiers : 1;

/// \brief The number of base class specifiers in Bases.
unsigned NumBases;
Expand Down

0 comments on commit d529254

Please sign in to comment.