Re: [PATCH] D11976: [libclang] Return deduced type for auto type, not the one written in the source.

2015-08-22 Thread Sergey Kalinichev via cfe-commits
skalinichev added a comment.

This is actually an unrelated issue (clang_getTypeDeclaration doesn't handle 
the auto type)

Using c-index-test -test-print-type --std=c++14 on your example I get:
VarDecl=z ... [type=std::basic_stringchar] ...

So, as you can see, z has correct type.

Anyway here is a quick fix for clang_getTypeDeclaration (will create a review 
request for it later on): https://paste.kde.org/p1fiwhery


http://reviews.llvm.org/D11976



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12119: Analyzer: Fix a crasher in UbigraphViz

2015-08-22 Thread Ismail Pazarbasi via cfe-commits
ismailp updated this revision to Diff 32903.
ismailp added a comment.

- Change parameter name to `OutStream`.


http://reviews.llvm.org/D12119

Files:
  lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
  test/Analysis/cfg.cpp

Index: test/Analysis/cfg.cpp
===
--- test/Analysis/cfg.cpp
+++ test/Analysis/cfg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple 
x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -std=c++11 %s  
%t 21
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple 
x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true 
-analyzer-viz-egraph-ubigraph -std=c++11 %s  %t 21
 // RUN: FileCheck --input-file=%t %s
 
 // CHECK-LABEL: void checkWrap(int i)
Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
===
--- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -745,9 +745,6 @@
 }
 
 void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) {
-
-  assert (Src != Dst  Self-edges are not allowed.);
-
   // Lookup the Src.  If it is a new node, it's a root.
   VMap::iterator SrcI= M.find(Src);
   unsigned SrcID;
@@ -778,8 +775,9 @@
 , ('arrow','true'), ('oriented', 'true'))\n;
 }
 
-UbigraphViz::UbigraphViz(std::unique_ptrraw_ostream Out, StringRef Filename)
-: Out(std::move(Out)), Filename(Filename), Cntr(0) {
+UbigraphViz::UbigraphViz(std::unique_ptrraw_ostream OutStream,
+ StringRef Filename)
+: Out(std::move(OutStream)), Filename(Filename), Cntr(0) {
 
   *Out  ('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n;
   *Out  ('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),


Index: test/Analysis/cfg.cpp
===
--- test/Analysis/cfg.cpp
+++ test/Analysis/cfg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -std=c++11 %s  %t 21
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -analyzer-viz-egraph-ubigraph -std=c++11 %s  %t 21
 // RUN: FileCheck --input-file=%t %s
 
 // CHECK-LABEL: void checkWrap(int i)
Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
===
--- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -745,9 +745,6 @@
 }
 
 void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) {
-
-  assert (Src != Dst  Self-edges are not allowed.);
-
   // Lookup the Src.  If it is a new node, it's a root.
   VMap::iterator SrcI= M.find(Src);
   unsigned SrcID;
@@ -778,8 +775,9 @@
 , ('arrow','true'), ('oriented', 'true'))\n;
 }
 
-UbigraphViz::UbigraphViz(std::unique_ptrraw_ostream Out, StringRef Filename)
-: Out(std::move(Out)), Filename(Filename), Cntr(0) {
+UbigraphViz::UbigraphViz(std::unique_ptrraw_ostream OutStream,
+ StringRef Filename)
+: Out(std::move(OutStream)), Filename(Filename), Cntr(0) {
 
   *Out  ('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n;
   *Out  ('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12119: Analyzer: Fix a crasher in UbigraphViz

2015-08-22 Thread Ismail Pazarbasi via cfe-commits
ismailp added inline comments.


Comment at: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:749
@@ -748,3 @@
-
-  assert (Src != Dst  Self-edges are not allowed.);
-

krememek wrote:
 Did you look at the test case that causes this assertion to fail?  I think it 
 would be good to know if this assertion is actually safe to remove.  I'm a 
 bit skeptical that it is safe to remove, and that (per my last review) that 
 this may be detecting that an invariant is getting violated.  If you are not 
 certain how to investigate that part, please report which test is triggering 
 the problem and myself or someone else familiar with the engine core can take 
 a look.  Thanks.
There wasn't a test that checks Ubigraph generator. After making the patch 
below, I picked a few existing tests, and added '-analyzer-viz-egraph-ubigraph' 
to their RUN lines. Then, I ran lit.py, and 'tests/Analysis/cfg.cpp' has 
crashed. I have minimized the test case to understand the problem.

Self-loop happens during implicit destructor of `Aggregate` in the following 
minimized test case:
```
  struct LifetimeExtend { LifetimeExtend(int); ~LifetimeExtend(); };
  struct Aggregate { const LifetimeExtend a; const LifetimeExtend b; };
  void test_lifetime_extended_temporaries() {
{
  Aggregate aggregate{LifetimeExtend(4), LifetimeExtend(4)};
  4;
}
  }
```
The destructor of `a` has a self-loop. My hypothesis is that `a` and `b` have 
the same `ProgramState`s. `b`'s destructor is visited first, since it's 
destroyed first. When destructor of `a` gets visited, analyzer calls 
`ProgramState::Profile` and finds the same state as `b`'s destructor. 
Therefore, both `a`'s destructor and `b`'s destructor have the same 
`ExplodedNode`. Do you think this is correct?

I have added -analyzer-viz-egraph-ubigraph to a few more C++ tests. I didn't 
observe any crash. However, I didn't verify that it generates correct ubigraph 
output.


http://reviews.llvm.org/D12119



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r245779 - [modules] Rearrange how redeclaration chains are loaded, to remove a walk over

2015-08-22 Thread Vassil Vassilev via cfe-commits

On 22/08/15 03:47, Richard Smith via cfe-commits wrote:

Author: rsmith
Date: Fri Aug 21 20:47:18 2015
New Revision: 245779

URL: http://llvm.org/viewvc/llvm-project?rev=245779view=rev
Log:
[modules] Rearrange how redeclaration chains are loaded, to remove a walk over
all modules and reduce the number of declarations we load when loading a
redeclaration chain.

The new approach is:
  * when loading the first declaration of an entity within a module file, we
first load all declarations of the entity that were imported into that
module file, and then load all the other declarations of that entity from
that module file and build a suitable decl chain from them
  * when loading any other declaration of an entity, we first load the first
declaration from the same module file

As before, we complete redecl chains through name lookup where necessary.

To make this work, I also had to change the way that template specializations
are stored -- it no longer suffices to track only canonical specializations; we
now emit all first local declarations when emitting a list of specializations
for a template.

On one testcase with several thousand imported module files, this reduces the
total runtime by 72%.

Very nice!
Does it reduce the depth of the redecl chains when merging? I.e. does 
this mean memory footprint reduction too?


Modified:
 cfe/trunk/include/clang/Serialization/ASTWriter.h
 cfe/trunk/lib/Serialization/ASTReader.cpp
 cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
 cfe/trunk/lib/Serialization/ASTWriter.cpp
 cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
 cfe/trunk/test/Modules/cxx-templates.cpp

Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=245779r1=245778r2=245779view=diff
==
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Fri Aug 21 20:47:18 2015
@@ -405,6 +405,10 @@ private:
/// \brief The set of declarations that may have redeclaration chains that
/// need to be serialized.
llvm::SmallVectorconst Decl *, 16 Redeclarations;
+
+  /// \brief A cache of the first local declaration for interesting
+  /// redeclaration chains.
+  llvm::DenseMapconst Decl *, const Decl * FirstLocalDeclCache;

/// \brief Statements that we've encountered while serializing a

/// declaration or type.
@@ -676,6 +680,10 @@ public:
const ASTTemplateArgumentListInfo *ASTTemplArgList,
RecordDataImpl Record);
  
+  /// \brief Find the first local declaration of a given local redeclarable

+  /// decl.
+  const Decl *getFirstLocalDecl(const Decl *D);
+
/// \brief Emit a reference to a declaration.
void AddDeclRef(const Decl *D, RecordDataImpl Record);
  
@@ -857,12 +865,6 @@ public:

void CompletedTagDefinition(const TagDecl *D) override;
void AddedVisibleDecl(const DeclContext *DC, const Decl *D) override;
void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) 
override;
-  void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD,
- const ClassTemplateSpecializationDecl *D) 
override;
-  void AddedCXXTemplateSpecialization(const VarTemplateDecl *TD,
-   const VarTemplateSpecializationDecl *D) 
override;
-  void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
-  const FunctionDecl *D) override;
void ResolvedExceptionSpec(const FunctionDecl *FD) override;
void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) 
override;
void ResolvedOperatorDelete(const CXXDestructorDecl *DD,

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=245779r1=245778r2=245779view=diff
==
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Aug 21 20:47:18 2015
@@ -8123,11 +8123,8 @@ void ASTReader::finishPendingActions() {
  PendingIncompleteDeclChains.clear();
  
  // Load pending declaration chains.

-for (unsigned I = 0; I != PendingDeclChains.size(); ++I) {
-  PendingDeclChainsKnown.erase(PendingDeclChains[I]);
+for (unsigned I = 0; I != PendingDeclChains.size(); ++I)
loadPendingDeclChain(PendingDeclChains[I]);
-}
-assert(PendingDeclChainsKnown.empty());
  PendingDeclChains.clear();
  
  assert(RedeclsDeserialized.empty()  some redecls not wired up);


Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: 

r245789 - [modules] Further simplification and speedup of redeclaration chain loading.

2015-08-22 Thread Richard Smith via cfe-commits
Author: rsmith
Date: Sat Aug 22 15:13:39 2015
New Revision: 245789

URL: http://llvm.org/viewvc/llvm-project?rev=245789view=rev
Log:
[modules] Further simplification and speedup of redeclaration chain loading.

Instead of eagerly deserializing a list of DeclIDs when we load a module file
and doing a binary search to find the redeclarations of a decl, store a list of
redeclarations of each chain before the first declaration and load it directly.

Modified:
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/include/clang/Serialization/ASTWriter.h
cfe/trunk/include/clang/Serialization/Module.h
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
cfe/trunk/lib/Serialization/Module.cpp

Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=245789r1=245788r2=245789view=diff
==
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Sat Aug 22 15:13:39 2015
@@ -433,10 +433,7 @@ namespace clang {
   /// declarations.
   TU_UPDATE_LEXICAL = 22,
   
-  /// \brief Record code for the array describing the locations (in the
-  /// LOCAL_REDECLARATIONS record) of the redeclaration chains, indexed by
-  /// the first known ID.
-  LOCAL_REDECLARATIONS_MAP = 23,
+  // ID 23 used to be for a list of local redeclarations.
 
   /// \brief Record code for declarations that Sema keeps references of.
   SEMA_DECL_REFS = 24,
@@ -514,13 +511,8 @@ namespace clang {
   /// imported by the AST file.
   IMPORTED_MODULES = 43,
   
-  // ID 40 used to be a table of merged canonical declarations.
-  
-  /// \brief Record code for the array of redeclaration chains.
-  ///
-  /// This array can only be interpreted properly using the local 
-  /// redeclarations map.
-  LOCAL_REDECLARATIONS = 45,
+  // ID 44 used to be a table of merged canonical declarations.
+  // ID 45 used to be a list of declaration IDs of local redeclarations.
   
   /// \brief Record code for the array of Objective-C categories (including
   /// extensions).
@@ -948,6 +940,9 @@ namespace clang {
 /// For more information about predefined declarations, see the
 /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
 const unsigned int NUM_PREDEF_DECL_IDS = 12;
+
+/// \brief Record code for a list of local redeclarations of a declaration.
+const unsigned int LOCAL_REDECLARATIONS = 50;
 
 /// \brief Record codes for each kind of declaration.
 ///

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=245789r1=245788r2=245789view=diff
==
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Sat Aug 22 15:13:39 2015
@@ -933,12 +933,9 @@ private:
   std::dequeDecl * InterestingDecls;
 
   /// \brief The list of redeclaration chains that still need to be 
-  /// reconstructed.
-  ///
-  /// Each element is the canonical declaration of the chain.
-  /// Elements in this vector should be unique; use 
-  /// PendingDeclChainsKnown to ensure uniqueness.
-  SmallVectorDecl *, 16 PendingDeclChains;
+  /// reconstructed, and the local offset to the corresponding list
+  /// of redeclarations.
+  SmallVectorstd::pairDecl *, uint64_t, 16 PendingDeclChains;
 
   /// \brief The list of canonical declarations whose redeclaration chains
   /// need to be marked as incomplete once we're done deserializing things.
@@ -1165,7 +1162,7 @@ private:
   RecordLocation DeclCursorForID(serialization::DeclID ID,
  unsigned RawLocation);
   void loadDeclUpdateRecords(serialization::DeclID ID, Decl *D);
-  void loadPendingDeclChain(Decl *D);
+  void loadPendingDeclChain(Decl *D, uint64_t LocalOffset);
   void loadObjCCategories(serialization::GlobalDeclID ID, ObjCInterfaceDecl *D,
   unsigned PreviousGeneration = 0);
 

Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=245789r1=245788r2=245789view=diff
==
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Sat Aug 22 15:13:39 2015
@@ -547,7 +547,6 @@ private:
   void WriteFPPragmaOptions(const FPOptions Opts);
 

Re: [PATCH] D11976: [libclang] Return deduced type for auto type, not the one written in the source.

2015-08-22 Thread Ben Jackson via cfe-commits
puremourning added a comment.

I can confirm that this patch fixes a number test cases found in ycmd 
http://github.com/Valorric/ycmd (a code-completion server). Specifically 
these ones marked as 'sic' 
https://github.com/Valloric/ycmd/blob/master/ycmd/tests/subcommands_test.py#L302-L312

So I'm in favour of this change :)


http://reviews.llvm.org/D11976



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r245793 - Refactor shared_timed_mutex tests.

2015-08-22 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sat Aug 22 16:24:01 2015
New Revision: 245793

URL: http://llvm.org/viewvc/llvm-project?rev=245793view=rev
Log:
Refactor shared_timed_mutex tests.

First I removed all of the uses of _LIBCPP_STD_VER and added LIT UNSUPPORTED 
tags to prevent the tests from being run in older standard dialects.
Second I increased the time tolerances used in some tests when testing with 
Thread Sanitizer because thread sanitizer make these tests take longer.

Modified:

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/member_swap.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/nonmember_swap.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.mod/release.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp

libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp

Modified: 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp?rev=245793r1=245792r2=245793view=diff
==
--- 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp
 Sat Aug 22 16:24:01 2015
@@ -8,6 +8,7 @@
 
//===--===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
 
 // shared_mutex
 
@@ -20,9 +21,7 @@
 
 int main()
 {
-#if _LIBCPP_STD_VER  11
 std::shared_lockstd::shared_timed_mutex ul;
 assert(!ul.owns_lock());
 assert(ul.mutex() == nullptr);
-#endif  // _LIBCPP_STD_VER  11
 }

Modified: 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp?rev=245793r1=245792r2=245793view=diff
==
--- 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp
 Sat Aug 22 16:24:01 2015
@@ -8,6 +8,7 @@
 
//===--===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03, c++11
 
 // 

[libcxx] r245806 - Recommit rL245802: Cleanup fancy pointer rebinding in list using __rebind_pointer.

2015-08-22 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sat Aug 22 21:56:05 2015
New Revision: 245806

URL: http://llvm.org/viewvc/llvm-project?rev=245806view=rev
Log:
Recommit rL245802: Cleanup fancy pointer rebinding in list using 
__rebind_pointer.

Currently we need an #ifdef branch every time we use pointer traits to rebind a 
pointer because
it is done differently in C++11 and C++03. This patch introduces the 
__rebind_pointer utility to
clean this up.

Also add a test that list and it's iterators can be instantiated with 
incomplete element types.

Added:
libcxx/trunk/test/std/containers/sequences/list/incomplete_type.pass.cpp
Modified:
libcxx/trunk/include/list
libcxx/trunk/include/memory

Modified: libcxx/trunk/include/list
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/list?rev=245806r1=245805r2=245806view=diff
==
--- libcxx/trunk/include/list (original)
+++ libcxx/trunk/include/list Sat Aug 22 21:56:05 2015
@@ -191,19 +191,10 @@ template class _Tp, class _VoidPtr str
 template class _Tp, class _VoidPtr
 struct __list_node_base
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other pointer;
-#endif
-
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_base __base_pointer;
-#else
-rebind__list_node_base::other __base_pointer;
-#endif
+typedef typename __rebind_pointer_VoidPtr, __list_node_Tp, _VoidPtr 
::type
+pointer;
+typedef typename __rebind_pointer_VoidPtr, __list_node_base::type
+__base_pointer;
 
 pointer __prev_;
 pointer __next_;
@@ -232,12 +223,8 @@ template class _Tp, class _VoidPtr cla
 template class _Tp, class _VoidPtr
 class _LIBCPP_TYPE_VIS_ONLY __list_iterator
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  __node_pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other __node_pointer;
-#endif
+typedef typename __rebind_pointer_VoidPtr, __list_node_Tp, _VoidPtr 
::type
+__node_pointer;
 
 __node_pointer __ptr_;
 
@@ -262,13 +249,7 @@ public:
 typedef bidirectional_iterator_tag   iterator_category;
 typedef _Tp  value_type;
 typedef value_type  reference;
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebindvalue_type
-#else
-rebindvalue_type::other
-#endif
- pointer;
+typedef typename __rebind_pointer_VoidPtr, value_type::type pointer;
 typedef typename pointer_traitspointer::difference_type difference_type;
 
 _LIBCPP_INLINE_VISIBILITY
@@ -365,12 +346,8 @@ public:
 template class _Tp, class _VoidPtr
 class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  __node_pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other __node_pointer;
-#endif
+typedef typename __rebind_pointer_VoidPtr, __list_node_Tp, _VoidPtr 
::type
+__node_pointer;
 
 __node_pointer __ptr_;
 
@@ -392,13 +369,7 @@ public:
 typedef bidirectional_iterator_tag   iterator_category;
 typedef _Tp  value_type;
 typedef const value_typereference;
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebindconst value_type
-#else
-rebindconst value_type::other
-#endif
- pointer;
+typedef typename __rebind_pointer_VoidPtr, const value_type::type 
pointer;
 typedef typename pointer_traitspointer::difference_type difference_type;
 
 _LIBCPP_INLINE_VISIBILITY

Modified: libcxx/trunk/include/memory
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=245806r1=245805r2=245806view=diff
==
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Sat Aug 22 21:56:05 2015
@@ -932,6 +932,15 @@ public:
 {return _VSTD::addressof(__r);}
 };
 
+template class _From, class _To
+struct __rebind_pointer {
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+typedef typename pointer_traits_From::template rebind_Totype;
+#else
+typedef typename pointer_traits_From::template rebind_To::other type;
+#endif
+};
+
 // allocator_traits
 
 namespace __has_pointer_type_imp

Added: libcxx/trunk/test/std/containers/sequences/list/incomplete_type.pass.cpp
URL: 

[PATCH] D12265: [ZORG] Add support for libc++ to SphinxDocBuilder.py

2015-08-22 Thread Eric Fiselier via cfe-commits
EricWF created this revision.
EricWF added reviewers: delcypher, silvas.
EricWF added subscribers: llvm-commits, cfe-commits.

http://reviews.llvm.org/D12265

Files:
  buildbot/osuosl/master/config/builders.py
  zorg/buildbot/builders/SphinxDocsBuilder.py

Index: zorg/buildbot/builders/SphinxDocsBuilder.py
===
--- zorg/buildbot/builders/SphinxDocsBuilder.py
+++ zorg/buildbot/builders/SphinxDocsBuilder.py
@@ -6,10 +6,11 @@
 from zorg.buildbot.commands.NinjaCommand import NinjaCommand
 
 def getSphinxDocsBuildFactory(
-llvm_html  = False, # Build LLVM HTML documentation
-llvm_man   = False, # Build LLVM man pages
-clang_html = False, # Build Clang HTML documentation
-lld_html   = False  # Build LLD HTML documentation
+llvm_html   = False, # Build LLVM HTML documentation
+llvm_man= False, # Build LLVM man pages
+clang_html  = False, # Build Clang HTML documentation
+lld_html= False, # Build LLD HTML documentation
+libcxx_html = False # Build Libc++ HTML documentation
 ):
 
 f = buildbot.process.factory.BuildFactory()
@@ -18,6 +19,8 @@
 llvm_objdir = 'llvm/build'
 clang_srcdir = llvm_srcdir + '/tools/clang'
 lld_srcdir = llvm_srcdir + '/tools/lld'
+libcxx_srcdir = llvm_srcdir + '/projects/libcxx'
+libcxxabi_srcdir = llvm_srcdir + '/projects/libcxxabi'
 
 # Get LLVM. This is essential for all builds
 # because we build all subprojects in tree
@@ -41,6 +44,18 @@
   defaultBranch='trunk',
   workdir=lld_srcdir))
 
+if libcxx_html:
+f.addStep(SVN(name='svn-libcxx',
+  mode='update',
+  baseURL='http://llvm.org/svn/llvm-project/libcxx/',
+  defaultBranch='trunk',
+  workdir=libcxx_srcdir))
+f.addStep(SVN(name='svn-libcxxabi',
+  mode='update',
+  baseURL='http://llvm.org/svn/llvm-project/libcxxabi/',
+  defaultBranch='trunk',
+  workdir=libcxxabi_srcdir))
+
 f.addStep(ShellCommand(name=create-build-dir,
command=[mkdir, -p, llvm_objdir],
haltOnFailure=False, # We might of already 
created the directory in a previous build
@@ -92,4 +107,12 @@
targets=['docs-lld-html']
   ))
 
+if libcxx_html:
+f.addStep(NinjaCommand(name=docs-libcxx-html,
+   haltOnFailure=True,
+   description=[Build Libc++ Sphinx HTML 
documentation],
+   workdir=llvm_objdir,
+   targets=['docs-libcxx-html']
+  ))
+
 return f
Index: buildbot/osuosl/master/config/builders.py
===
--- buildbot/osuosl/master/config/builders.py
+++ buildbot/osuosl/master/config/builders.py
@@ -1161,6 +1161,13 @@
'factory': 
SphinxDocsBuilder.getSphinxDocsBuildFactory(lld_html=True),
'category' : 'lld'
  },
+ {
+   'name':libcxx-sphinx-docs,
+   'slavenames':[ericwf-buildslave2],
+   'builddir':libcxx-sphinx-docs,
+   'factory': 
SphinxDocsBuilder.getSphinxDocsBuildFactory(libcxx_html=True),
+   'category' : 'libcxx'
+ }
]
 
 def get_builders():
@@ -1331,7 +1338,7 @@
  'slavenames' :[lab-mini-03],
  'builddir' :clang-x86_64-darwin10-nt-O0-g,
  'factory' : LNTBuilder.getLNTFactory(triple='x86_64-apple-darwin10',
-  nt_flags=['--multisample=3', 
+  nt_flags=['--multisample=3',
 '--optimize-option',
 '-O0', '--cflag', '-g'],
   jobs=2,  use_pty_in_tests=True,


Index: zorg/buildbot/builders/SphinxDocsBuilder.py
===
--- zorg/buildbot/builders/SphinxDocsBuilder.py
+++ zorg/buildbot/builders/SphinxDocsBuilder.py
@@ -6,10 +6,11 @@
 from zorg.buildbot.commands.NinjaCommand import NinjaCommand
 
 def getSphinxDocsBuildFactory(
-llvm_html  = False, # Build LLVM HTML documentation
-llvm_man   = False, # Build LLVM man pages
-clang_html = False, # Build Clang HTML documentation
-lld_html   = False  # Build LLD HTML documentation
+llvm_html   = False, # Build LLVM HTML documentation
+llvm_man= False, # Build LLVM man pages
+clang_html  = False, # Build Clang HTML documentation
+lld_html= False, # Build LLD HTML documentation
+libcxx_html = False # Build Libc++ HTML 

[libcxx] r245788 - [libcxx] Add new Sphinx documentation

2015-08-22 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sat Aug 22 14:40:49 2015
New Revision: 245788

URL: http://llvm.org/viewvc/llvm-project?rev=245788view=rev
Log:
[libcxx] Add new Sphinx documentation

Summary:
This patch adds Sphinx based documentation to libc++. The goal is to make it 
easier to write documentation for libc++ since writing new documentation in 
HTML is cumbersome. This patch rewrites the main page for libc++ along with the 
instructions for using, building and testing libc++. 

The built documentation can be found and reviewed here: 
http://efcs.ca/libcxx-docs

In order to build the sphinx documentation you need to specify the cmake 
options `-DLLVM_ENABLE_SPHINX=ON -DLIBCXX_INCLUDE_DOCS=ON`. This will add the 
makefile rule `docs-libcxx-html`.

Reviewers: chandlerc, mclow.lists, danalbert, jroelofs

Subscribers: silvas, cfe-commits

Differential Revision: http://reviews.llvm.org/D12129

Added:
libcxx/trunk/docs/
libcxx/trunk/docs/BuildingLibcxx.rst
libcxx/trunk/docs/CMakeLists.txt
libcxx/trunk/docs/README.txt
libcxx/trunk/docs/TestingLibcxx.rst
libcxx/trunk/docs/UsingLibcxx.rst
libcxx/trunk/docs/conf.py
libcxx/trunk/docs/index.rst
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
libcxx/trunk/cmake/config-ix.cmake

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=245788r1=245787r2=245788view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Sat Aug 22 14:40:49 2015
@@ -52,6 +52,7 @@ option(LIBCXX_ENABLE_ASSERTIONS Enable
 option(LIBCXX_ENABLE_SHARED Build libc++ as a shared library. ON)
 
 option(LIBCXX_INCLUDE_TESTS Build the libc++ tests. ${LLVM_INCLUDE_TESTS})
+option(LIBCXX_INCLUDE_DOCS Build the libc++ documentation. 
${LLVM_INCLUDE_DOCS})
 set(LIBCXX_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX} CACHE STRING
 Define suffix of library directory name (32/64))
 option(LIBCXX_INSTALL_HEADERS Install the libc++ headers. ON)
@@ -288,6 +289,10 @@ endif()
 include_directories(include)
 add_subdirectory(include)
 add_subdirectory(lib)
+
 if (LIBCXX_INCLUDE_TESTS)
   add_subdirectory(test)
 endif()
+if (LIBCXX_INCLUDE_DOCS)
+  add_subdirectory(docs)
+endif()

Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake?rev=245788r1=245787r2=245788view=diff
==
--- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Sat Aug 22 14:40:49 
2015
@@ -77,6 +77,9 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   if (NOT DEFINED LLVM_INCLUDE_TESTS)
 set(LLVM_INCLUDE_TESTS ${LLVM_FOUND})
   endif()
+  if (NOT DEFINED LLVM_ENABLE_SPHINX)
+set(LLVM_ENABLE_SPHINX OFF)
+  endif()
 
   # Required LIT Configuration 
   # Define the default arguments to use with 'lit', and an option for the user
@@ -95,6 +98,14 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
 set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
   endif()
 
+  # Required doc configuration
+  if (LLVM_ENABLE_SPHINX)
+message(STATUS Sphinx enabled.)
+find_package(Sphinx REQUIRED)
+  else()
+message(STATUS Sphinx disabled.)
+  endif()
+
   # Add LLVM Functions 
   include(AddLLVM OPTIONAL)
 endif()

Modified: libcxx/trunk/cmake/config-ix.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=245788r1=245787r2=245788view=diff
==
--- libcxx/trunk/cmake/config-ix.cmake (original)
+++ libcxx/trunk/cmake/config-ix.cmake Sat Aug 22 14:40:49 2015
@@ -17,4 +17,3 @@ check_library_exists(c printf  LIBCXX_
 check_library_exists(m ccos  LIBCXX_HAS_M_LIB)
 check_library_exists(rt clock_gettime  LIBCXX_HAS_RT_LIB)
 check_library_exists(gcc_s __gcc_personality_v0  LIBCXX_HAS_GCC_S_LIB)
-

Added: libcxx/trunk/docs/BuildingLibcxx.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/BuildingLibcxx.rst?rev=245788view=auto
==
--- libcxx/trunk/docs/BuildingLibcxx.rst (added)
+++ libcxx/trunk/docs/BuildingLibcxx.rst Sat Aug 22 14:40:49 2015
@@ -0,0 +1,279 @@
+
+===
+Building libc++
+===
+
+.. contents::
+  :local:
+
+Getting Started
+===
+
+On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to 
install
+Xcode 4.2 or later.  However if you want to install tip-of-trunk from here
+(getting the bleeding edge), read on.
+
+The basic steps needed to build libc++ are:
+
+#. Checkout LLVM:
+
+   * ``cd where-you-want-llvm-to-live``
+   * ``svn co 

Re: [PATCH] D12265: [ZORG] Add support for libc++ to SphinxDocBuilder.py

2015-08-22 Thread Dan Liew via cfe-commits
delcypher added a comment.

The rest LGTM



Comment at: buildbot/osuosl/master/config/builders.py:1166
@@ +1165,3 @@
+   'name':libcxx-sphinx-docs,
+   'slavenames':[ericwf-buildslave2],
+   'builddir':libcxx-sphinx-docs,

Is there a reason you're using the slave `ericwf-buildslave2` rather than 
`gribozavr4` which is used by the other documentation builders?




Comment at: buildbot/osuosl/master/config/builders.py:1341
@@ -1333,3 +1340,3 @@
  'factory' : LNTBuilder.getLNTFactory(triple='x86_64-apple-darwin10',
-  nt_flags=['--multisample=3', 
+  nt_flags=['--multisample=3',
 '--optimize-option',

This spacing change doesn't really belong in this patch


Comment at: zorg/buildbot/builders/SphinxDocsBuilder.py:13
@@ -13,1 +12,3 @@
+lld_html= False, # Build LLD HTML documentation
+libcxx_html = False # Build Libc++ HTML documentation
 ):

Minor nit, the ``#`` should probably be horizontally aligned with the others


http://reviews.llvm.org/D12265



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r245798 - [WinEH] Update to new EH pad/ret signatures (with tokens required)

2015-08-22 Thread Joseph Tremoulet via cfe-commits
Author: josepht
Date: Sat Aug 22 19:26:48 2015
New Revision: 245798

URL: http://llvm.org/viewvc/llvm-project?rev=245798view=rev
Log:
[WinEH] Update to new EH pad/ret signatures (with tokens required)

Summary:
The signatures of the methods in LLVM for creating EH pads/rets are changing
to require token arguments on rets and assume token return type on pads.
Update creation code accordingly.

Reviewers: majnemer, rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D12109

Modified:
cfe/trunk/lib/CodeGen/CGCleanup.cpp
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp

Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=245798r1=245797r2=245798view=diff
==
--- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Sat Aug 22 19:26:48 2015
@@ -904,8 +904,7 @@ void CodeGenFunction::PopCleanupBlock(bo
 llvm::BasicBlock *NextAction = getEHDispatchBlock(EHParent);
 if (CGM.getCodeGenOpts().NewMSEH 
 EHPersonality::get(*this).isMSVCPersonality())
-  CPI = Builder.CreateCleanupPad(llvm::Type::getTokenTy(getLLVMContext()),
- {});
+  CPI = Builder.CreateCleanupPad({});
 
 // We only actually emit the cleanup code if the cleanup is either
 // active or was used before it was deactivated.
@@ -916,7 +915,7 @@ void CodeGenFunction::PopCleanupBlock(bo
 }
 
 if (CPI)
-  Builder.CreateCleanupRet(NextAction, CPI);
+  Builder.CreateCleanupRet(CPI, NextAction);
 else
   Builder.CreateBr(NextAction);
 

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=245798r1=245797r2=245798view=diff
==
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Sat Aug 22 19:26:48 2015
@@ -887,11 +887,10 @@ static llvm::BasicBlock *emitMSVCCatchDi
 
 if (EHPersonality::get(CGF).isMSVCXXPersonality()) {
   CGF.Builder.CreateCatchPad(
-  llvm::Type::getTokenTy(CGF.getLLVMContext()), Handler.Block,
-  NextBlock, {TypeValue, llvm::Constant::getNullValue(CGF.VoidPtrTy)});
+  Handler.Block, NextBlock,
+  {TypeValue, llvm::Constant::getNullValue(CGF.VoidPtrTy)});
 } else {
-  CGF.Builder.CreateCatchPad(llvm::Type::getTokenTy(CGF.getLLVMContext()),
- Handler.Block, NextBlock, {TypeValue});
+  CGF.Builder.CreateCatchPad(Handler.Block, NextBlock, {TypeValue});
 }
 
 // Otherwise we need to emit and continue at that block.

Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=245798r1=245797r2=245798view=diff
==
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Sat Aug 22 19:26:48 2015
@@ -859,7 +859,7 @@ struct CallEndCatchMSVC final : EHScopeS
   void Emit(CodeGenFunction CGF, Flags flags) override {
 if (CGF.CGM.getCodeGenOpts().NewMSEH) {
   llvm::BasicBlock *BB = CGF.createBasicBlock(catchret.dest);
-  CGF.Builder.CreateCatchRet(BB, CPI);
+  CGF.Builder.CreateCatchRet(CPI, BB);
   CGF.EmitBlock(BB);
 } else {
   CGF.EmitNounwindRuntimeCall(


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r245802 - Cleanup fancy pointer rebinding in list using __rebind_pointer.

2015-08-22 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sat Aug 22 21:34:18 2015
New Revision: 245802

URL: http://llvm.org/viewvc/llvm-project?rev=245802view=rev
Log:
Cleanup fancy pointer rebinding in list using __rebind_pointer.

Currently we need an #ifdef branch every time we use pointer traits to rebind a 
pointer because
it is done differently in C++11 and C++03. This patch introduces the 
__rebind_pointer utility to
clean this up. 

Modified:
libcxx/trunk/include/list
libcxx/trunk/include/memory

Modified: libcxx/trunk/include/list
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/list?rev=245802r1=245801r2=245802view=diff
==
--- libcxx/trunk/include/list (original)
+++ libcxx/trunk/include/list Sat Aug 22 21:34:18 2015
@@ -191,19 +191,10 @@ template class _Tp, class _VoidPtr str
 template class _Tp, class _VoidPtr
 struct __list_node_base
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other pointer;
-#endif
-
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_base __base_pointer;
-#else
-rebind__list_node_base::other __base_pointer;
-#endif
+typedef typename __rebind_pointer_VoidPtr, __list_node_Tp, _VoidPtr 
::type
+pointer;
+typedef typename __rebind_pointer_VoidPtr, __list_node_base::type
+__base_pointer;
 
 pointer __prev_;
 pointer __next_;
@@ -232,12 +223,7 @@ template class _Tp, class _VoidPtr cla
 template class _Tp, class _VoidPtr
 class _LIBCPP_TYPE_VIS_ONLY __list_iterator
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  __node_pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other __node_pointer;
-#endif
+typedef typename __list_node_Tp, _VoidPtr::pointer __node_pointer;
 
 __node_pointer __ptr_;
 
@@ -262,13 +248,7 @@ public:
 typedef bidirectional_iterator_tag   iterator_category;
 typedef _Tp  value_type;
 typedef value_type  reference;
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebindvalue_type
-#else
-rebindvalue_type::other
-#endif
- pointer;
+typedef typename __rebind_pointer_VoidPtr, value_type::type pointer;
 typedef typename pointer_traitspointer::difference_type difference_type;
 
 _LIBCPP_INLINE_VISIBILITY
@@ -365,12 +345,7 @@ public:
 template class _Tp, class _VoidPtr
 class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator
 {
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebind__list_node_Tp, _VoidPtr  __node_pointer;
-#else
-rebind__list_node_Tp, _VoidPtr ::other __node_pointer;
-#endif
+typedef typename __list_node_Tp, _VoidPtr::pointer __node_pointer;
 
 __node_pointer __ptr_;
 
@@ -392,13 +367,7 @@ public:
 typedef bidirectional_iterator_tag   iterator_category;
 typedef _Tp  value_type;
 typedef const value_typereference;
-typedef typename pointer_traits_VoidPtr::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-rebindconst value_type
-#else
-rebindconst value_type::other
-#endif
- pointer;
+typedef typename __rebind_pointer_VoidPtr, const value_type::type 
pointer;
 typedef typename pointer_traitspointer::difference_type difference_type;
 
 _LIBCPP_INLINE_VISIBILITY

Modified: libcxx/trunk/include/memory
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=245802r1=245801r2=245802view=diff
==
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Sat Aug 22 21:34:18 2015
@@ -932,6 +932,15 @@ public:
 {return _VSTD::addressof(__r);}
 };
 
+template class _From, class _To
+struct __rebind_pointer {
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+typedef typename pointer_traits_From::template rebind_Totype;
+#else
+typedef typename pointer_traits_From::template rebind_To::other type;
+#endif
+};
+
 // allocator_traits
 
 namespace __has_pointer_type_imp


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11361: [OpenMP] Target directive host codegen

2015-08-22 Thread Samuel Antao via cfe-commits
sfantao added a comment.

Two more inlined comments that I forgot to integrate in my previous response.

Thanks!
Samuel



Comment at: lib/CodeGen/CGOpenMPRuntime.h:190-204
@@ -180,2 +189,17 @@
+  /// \brief Values for bit flags used to specify the mapping type for
+  /// offloading.
+  enum OpenMPOffloadMappingFlags {
+/// \brief Allocate memory on the device and move data from host to device.
+OMP_MAP_TO = 0x01,
+/// \brief Allocate memory on the device and move data from device to host.
+OMP_MAP_FROM = 0x02,
+  };
+
+  enum OpenMPOffloadingReservedDeviceIDs {
+/// \brief Device ID if the device was not defined, runtime should get it
+/// from environment variables in the spec.
+OMP_DEVICEID_UNDEF = -1,
+  };
+
   CodeGenModule CGM;
   /// \brief Default const ident_t object used for initialization of all other

Got it, not exposed anymore.


Comment at: lib/CodeGen/CGOpenMPRuntime.h:761
@@ -714,2 +760,2 @@
 
 #endif

Unlike the other enums, more than one map types need to be combined. E.g., 
to/from are two different enums. Once the map clause and 4.1 get to be support, 
we will have more combinations. I see two options here: add enums for all 
combinations or use a typedef each time an ineger refer to map types, so the 
code is more readable. Let me know your thoughts. 


http://reviews.llvm.org/D11361



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12247: [libc++] remove possible trailing padding from aligned_storage

2015-08-22 Thread Eric Fiselier via cfe-commits
EricWF added a comment.

I'm not sure I understand the problem. Is it possible to provide a minimal 
reproducer of the bug/behavior you are describing?


http://reviews.llvm.org/D12247



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12244: Implement ACLE 2.0 macros of chapters 6.4 and 6.5 for [ARM] and [Aarch64] targets

2015-08-22 Thread Renato Golin via cfe-commits
rengolin added a comment.

I'm surprised you decided to rearrange the output of the macros. It makes 
reviewing a lot harder. Is there some special reason to have that in any 
specific order?



Comment at: lib/Basic/Targets.cpp:4621
@@ -4586,1 +4620,3 @@
+Builder.defineMacro(__REGISTER_PREFIX__, ); 
+Builder.defineMacro(__ARM_ARCH_ + CPUAttr + __);
 

Is it truly impossible for CPUAttr to be empty? Or just coincidental given our 
tests?


http://reviews.llvm.org/D12244



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits