[llvm-branch-commits] [cfe-branch] r259371 - Merging r259260:
Author: hans Date: Mon Feb 1 11:10:12 2016 New Revision: 259371 URL: http://llvm.org/viewvc/llvm-project?rev=259371&view=rev Log: Merging r259260: r259260 | samsonov | 2016-01-29 15:07:14 -0800 (Fri, 29 Jan 2016) | 1 line [UBSan] Add documentation for runtime issue suppression. Modified: cfe/branches/release_38/ (props changed) cfe/branches/release_38/docs/UndefinedBehaviorSanitizer.rst Propchange: cfe/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 11:10:12 2016 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:257652,257695,257947,258110 +/cfe/trunk:257652,257695,257947,258110,259260 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_38/docs/UndefinedBehaviorSanitizer.rst URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/docs/UndefinedBehaviorSanitizer.rst?rev=259371&r1=259370&r2=259371&view=diff == --- cfe/branches/release_38/docs/UndefinedBehaviorSanitizer.rst (original) +++ cfe/branches/release_38/docs/UndefinedBehaviorSanitizer.rst Mon Feb 1 11:10:12 2016 @@ -168,6 +168,38 @@ UndefinedBehaviorSanitizer supports ``sr :doc:`SanitizerSpecialCaseList`, that can be used to suppress error reports in the specified source files or functions. +Runtime suppressions + + +Sometimes you can suppress UBSan error reports for specific files, functions, +or libraries without recompiling the code. You need to pass a path to +suppression file in a ``UBSAN_OPTIONS`` environment variable. + +.. code-block:: bash + +UBSAN_OPTIONS=suppressions=MyUBSan.supp + +You need to specify a :ref:`check ` you are suppressing and the +bug location. For example: + +.. code-block:: bash + + signed-integer-overflow:file-with-known-overflow.cpp + alignment:function_doing_unaligned_access + vptr:shared_object_with_vptr_failures.so + +There are several limitations: + +* Sometimes your binary must have enough debug info and/or symbol table, so + that the runtime could figure out source file or function name to match + against the suppression. +* It is only possible to suppress recoverable checks. For the example above, + you can additionally pass + ``-fsanitize-recover=signed-integer-overflow,alignment,vptr``, although + most of UBSan checks are recoverable by default. +* Check groups (like ``undefined``) can't be used in suppressions file, only + fine-grained checks are supported. + Supported Platforms === ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [polly] r259372 - Merging r259332:
Author: hans Date: Mon Feb 1 11:14:09 2016 New Revision: 259372 URL: http://llvm.org/viewvc/llvm-project?rev=259372&view=rev Log: Merging r259332: r259332 | grosser | 2016-01-31 12:25:46 -0800 (Sun, 31 Jan 2016) | 17 lines cmake: Add additional libraries to fix the darwin shared library build darwin requires the additional linkages of... LLVMBitReader LLVMMCParser LLVMObject LLVMProfileData LLVMTarget LLVMVectorize as the darwin requires all of the weak undefined symbols in a library to be resolved when linking it against an executable (unless -Wl,-undefined,dynamic_lookup is used to override the default behavior of -Wl,-undefined,error). Contributed-by: Jack Howarth Modified: polly/branches/release_38/ (props changed) polly/branches/release_38/lib/CMakeLists.txt Propchange: polly/branches/release_38/ -- svn:mergeinfo = /polly/trunk:259332 Modified: polly/branches/release_38/lib/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_38/lib/CMakeLists.txt?rev=259372&r1=259371&r2=259372&view=diff == --- polly/branches/release_38/lib/CMakeLists.txt (original) +++ polly/branches/release_38/lib/CMakeLists.txt Mon Feb 1 11:14:09 2016 @@ -66,6 +66,13 @@ if (BUILD_SHARED_LIBS) LLVMAnalysis LLVMipo LLVMMC +# The libraries below are required for darwin: http://PR26392 +LLVMBitReader +LLVMMCParser +LLVMObject +LLVMProfileData +LLVMTarget +LLVMVectorize ) link_directories( ${LLVM_LIBRARY_DIR} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] r259373 - Merging r258684:
Author: hans Date: Mon Feb 1 11:25:24 2016 New Revision: 259373 URL: http://llvm.org/viewvc/llvm-project?rev=259373&view=rev Log: Merging r258684: r258684 | slthakur | 2016-01-25 04:27:46 -0800 (Mon, 25 Jan 2016) | 10 lines [LLDB][MIPS] Fix TestExprsChar.py Patch by Nitesh Jain. Summary: When incorrect type used for 'char' then (at least) one of the expression evaluates to incorrect value. Please refer to bug llvm.org/pr23069 Reviewers: ovyalov, clayborg Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep Differential: reviews.llvm.org/D16132 Modified: lldb/branches/release_38/ (props changed) lldb/branches/release_38/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Propchange: lldb/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 11:25:24 2016 @@ -1,3 +1,3 @@ /lldb/branches/apple/python-GIL:156467-162159 /lldb/branches/iohandler:198360-200250 -/lldb/trunk:257691-257692,259188 +/lldb/trunk:257691-257692,258684,259188 Modified: lldb/branches/release_38/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py?rev=259373&r1=259372&r2=259373&view=diff == --- lldb/branches/release_38/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py (original) +++ lldb/branches/release_38/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Mon Feb 1 11:25:24 2016 @@ -65,5 +65,6 @@ class ExprCharTestCase(TestBase): @expectedFailurei386("llvm.org/pr23069") @expectedFailurex86_64("llvm.org/pr23069") @expectedFailureWindows("llvm.org/pr21765") +@expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*') def test_unsigned_char(self): self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'}) ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] r259374 - Merging r258685:
Author: hans Date: Mon Feb 1 11:26:49 2016 New Revision: 259374 URL: http://llvm.org/viewvc/llvm-project?rev=259374&view=rev Log: Merging r258685: r258685 | slthakur | 2016-01-25 04:33:03 -0800 (Mon, 25 Jan 2016) | 10 lines [LLDB][MIPS] Fix TestPrintStackTraces.py Patch by Nitesh Jain. Summary: The thread_start function in libc doesn't contain any epilogue and prologue instructions. Hence unwinding fail when we are stopped in thread_start. Reviewers: ovyalov, clayborg Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep Differential: reviews.llvm.org/D16136 Modified: lldb/branches/release_38/ (props changed) lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Propchange: lldb/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 11:26:49 2016 @@ -1,3 +1,3 @@ /lldb/branches/apple/python-GIL:156467-162159 /lldb/branches/iohandler:198360-200250 -/lldb/trunk:257691-257692,258684,259188 +/lldb/trunk:257691-257692,258684-258685,259188 Modified: lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py?rev=259374&r1=259373&r2=259374&view=diff == --- lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py (original) +++ lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py Mon Feb 1 11:26:49 2016 @@ -22,6 +22,10 @@ class ThreadsStackTracesTestCase(TestBas self.line = line_number('main.cpp', '// Set break point at this line.') @expectedFailureAll("llvm.org/pr23043", ["linux"], archs=["i386"]) # We are unable to produce a backtrace of the main thread when the thread is blocked in fgets + +#The __thread_start function in libc doesn't contain any epilogue and prologue instructions +#hence unwinding fail when we are stopped in __thread_start +@expectedFailureAll(triple = 'mips*') @expectedFailureWindows("llvm.org/pr24778") @add_test_categories(['pyapi']) def test_stack_traces(self): ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm-branch] r259390 - Merging r259375:
Author: hans Date: Mon Feb 1 13:18:10 2016 New Revision: 259390 URL: http://llvm.org/viewvc/llvm-project?rev=259390&view=rev Log: Merging r259375: r259375 | majnemer | 2016-02-01 09:37:56 -0800 (Mon, 01 Feb 2016) | 6 lines [InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y) This miscompile came about because we tried to use a transform which was only appropriate for xor operators when addition was present. This fixes PR26407. Modified: llvm/branches/release_38/ (props changed) llvm/branches/release_38/lib/Transforms/InstCombine/InstCombineCompares.cpp llvm/branches/release_38/test/Transforms/InstCombine/icmp.ll Propchange: llvm/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 13:18:10 2016 @@ -1,3 +1,3 @@ /llvm/branches/Apple/Pertwee:110850,110961 /llvm/branches/type-system-rewrite:133420-134817 -/llvm/trunk:155241,257645,257648,257730,257775,257791,257875,257886,257902,257905,257925,257929-257930,257940,257942,257977,257979,257997,258168,258184,258207,258221,258273,258325,258406,258416,258428,258436,258471,258690,258729,258891,258971,259228,259236 +/llvm/trunk:155241,257645,257648,257730,257775,257791,257875,257886,257902,257905,257925,257929-257930,257940,257942,257977,257979,257997,258168,258184,258207,258221,258273,258325,258406,258416,258428,258436,258471,258690,258729,258891,258971,259228,259236,259375 Modified: llvm/branches/release_38/lib/Transforms/InstCombine/InstCombineCompares.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=259390&r1=259389&r2=259390&view=diff == --- llvm/branches/release_38/lib/Transforms/InstCombine/InstCombineCompares.cpp (original) +++ llvm/branches/release_38/lib/Transforms/InstCombine/InstCombineCompares.cpp Mon Feb 1 13:18:10 2016 @@ -3560,7 +3560,7 @@ Instruction *InstCombiner::visitICmpInst BO1->getOperand(0)); } - if (CI->isMaxValue(true)) { + if (BO0->getOpcode() == Instruction::Xor && CI->isMaxValue(true)) { ICmpInst::Predicate Pred = I.isSigned() ? I.getUnsignedPredicate() : I.getSignedPredicate(); Modified: llvm/branches/release_38/test/Transforms/InstCombine/icmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/test/Transforms/InstCombine/icmp.ll?rev=259390&r1=259389&r2=259390&view=diff == --- llvm/branches/release_38/test/Transforms/InstCombine/icmp.ll (original) +++ llvm/branches/release_38/test/Transforms/InstCombine/icmp.ll Mon Feb 1 13:18:10 2016 @@ -1672,3 +1672,15 @@ define i1 @cmp_slt_rhs_inc(float %x, i32 %cmp = icmp slt i32 %conv, %inc ret i1 %cmp } + +; CHECK-LABEL: @PR26407 +; CHECK-NEXT: %[[addx:.*]] = add i32 %x, 2147483647 +; CHECK-NEXT: %[[addy:.*]] = add i32 %y, 2147483647 +; CHECK-NEXT: %[[cmp:.*]] = icmp uge i32 %[[addx]], %[[addy]] +; CHECK-NEXT: ret i1 %[[cmp]] +define i1 @PR26407(i32 %x, i32 %y) { + %addx = add i32 %x, 2147483647 + %addy = add i32 %y, 2147483647 + %cmp = icmp uge i32 %addx, %addy + ret i1 %cmp +} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] r259408 - Merging r258621, r258758, r258761:
Author: hans Date: Mon Feb 1 15:21:19 2016 New Revision: 259408 URL: http://llvm.org/viewvc/llvm-project?rev=259408&view=rev Log: Merging r258621, r258758, r258761: r258621 | mohit.bhakkad | 2016-01-23 02:36:06 -0800 (Sat, 23 Jan 2016) | 5 lines [LLDB] Consider only valid symbols while resolving by address Reviewers: clayborg. Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D16397 r258758 | amccarth | 2016-01-25 16:58:09 -0800 (Mon, 25 Jan 2016) | 13 lines Set symbol types for function symbols loaded from PE/COFF This fixes the regression of several tests on Windows after rL258621. The root problem is that ObjectFilePECOFF was not setting type information for the symbols, and the new CL rejects symbols without type information, breaking functionality like thread step-over. The fix sets the type information for functions (and creates a TODO for other types). Along the way, I fixed some typos and formatting that made the code I was debugging harder to understand. In the long run, we should consider replacing most of ObjectFilePECOFF with the COFF parsing code from LLVM. Differential Revision: http://reviews.llvm.org/D16563 r258761 | zturner | 2016-01-25 17:09:38 -0800 (Mon, 25 Jan 2016) | 1 line Remove XFAIL Windows from a test that was fixed by r258758. Modified: lldb/branches/release_38/ (props changed) lldb/branches/release_38/include/lldb/Core/RangeMap.h lldb/branches/release_38/include/lldb/Symbol/Symtab.h lldb/branches/release_38/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py lldb/branches/release_38/source/Core/Module.cpp lldb/branches/release_38/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp lldb/branches/release_38/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h lldb/branches/release_38/source/Symbol/Symtab.cpp Propchange: lldb/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 15:21:19 2016 @@ -1,3 +1,3 @@ /lldb/branches/apple/python-GIL:156467-162159 /lldb/branches/iohandler:198360-200250 -/lldb/trunk:257691-257692,258684-258685,259188 +/lldb/trunk:257691-257692,258621,258684-258685,258758,258761,259188 Modified: lldb/branches/release_38/include/lldb/Core/RangeMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/include/lldb/Core/RangeMap.h?rev=259408&r1=259407&r2=259408&view=diff == --- lldb/branches/release_38/include/lldb/Core/RangeMap.h (original) +++ lldb/branches/release_38/include/lldb/Core/RangeMap.h Mon Feb 1 15:21:19 2016 @@ -1216,6 +1216,25 @@ namespace lldb_private { } return UINT32_MAX; } + +uint32_t +FindEntryIndexesThatContain(B addr, std::vector &indexes) const +{ +#ifdef ASSERT_RANGEMAP_ARE_SORTED +assert (IsSorted()); +#endif + +if (!m_entries.empty()) +{ +typename Collection::const_iterator pos; +for (const auto &entry : m_entries) +{ +if (entry.Contains(addr)) +indexes.push_back(entry.data); +} +} +return indexes.size() ; +} Entry * FindEntryThatContains (B addr) Modified: lldb/branches/release_38/include/lldb/Symbol/Symtab.h URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/include/lldb/Symbol/Symtab.h?rev=259408&r1=259407&r2=259408&view=diff == --- lldb/branches/release_38/include/lldb/Symbol/Symtab.h (original) +++ lldb/branches/release_38/include/lldb/Symbol/Symtab.h Mon Feb 1 15:21:19 2016 @@ -81,6 +81,7 @@ public: Symbol *FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility); Symbol *FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes); Symbol *FindSymbolContainingFileAddress (lldb::addr_t file_addr); +voidForEachSymbolContainingFileAddress(lldb::addr_t file_addr, std::function const &callback); size_t FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list
[llvm-branch-commits] [cfe-branch] r259412 - Merging r257710:
Author: hans Date: Mon Feb 1 15:40:38 2016 New Revision: 259412 URL: http://llvm.org/viewvc/llvm-project?rev=259412&view=rev Log: Merging r257710: r257710 | gbiv | 2016-01-13 15:36:34 -0800 (Wed, 13 Jan 2016) | 8 lines [Sema] Suppress diags in overload resolution. We were emitting diagnostics from our shiny new C-only overload resolution mode. This patch attempts to silence all such diagnostics. This fixes PR26085. Differential Revision: http://reviews.llvm.org/D16159 Added: cfe/branches/release_38/test/SemaObjC/ovl-check.m - copied unchanged from r257710, cfe/trunk/test/SemaObjC/ovl-check.m Modified: cfe/branches/release_38/ (props changed) cfe/branches/release_38/include/clang/Sema/Sema.h cfe/branches/release_38/lib/Sema/SemaDeclCXX.cpp cfe/branches/release_38/lib/Sema/SemaExpr.cpp cfe/branches/release_38/lib/Sema/SemaExprObjC.cpp cfe/branches/release_38/lib/Sema/SemaOverload.cpp Propchange: cfe/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 15:40:38 2016 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:257652,257695,257947,258110,259260 +/cfe/trunk:257652,257695,257710,257947,258110,259260 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_38/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/include/clang/Sema/Sema.h?rev=259412&r1=259411&r2=259412&view=diff == --- cfe/branches/release_38/include/clang/Sema/Sema.h (original) +++ cfe/branches/release_38/include/clang/Sema/Sema.h Mon Feb 1 15:40:38 2016 @@ -2229,7 +2229,8 @@ public: bool CheckPointerConversion(Expr *From, QualType ToType, CastKind &Kind, CXXCastPath& BasePath, - bool IgnoreBaseAccess); + bool IgnoreBaseAccess, + bool Diagnose = true); bool IsMemberPointerConversion(Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType &ConvertedType); @@ -5388,7 +5389,8 @@ public: unsigned AmbigiousBaseConvID, SourceLocation Loc, SourceRange Range, DeclarationName Name, -CXXCastPath *BasePath); +CXXCastPath *BasePath, +bool IgnoreAccess = false); std::string getAmbiguousPathsDisplayString(CXXBasePaths &Paths); @@ -7514,14 +7516,15 @@ public: ObjCMethodDecl *&ClassMethod, ObjCMethodDecl *&InstanceMethod, TypedefNameDecl *&TDNDecl, -bool CfToNs); - +bool CfToNs, bool Diagnose = true); + bool CheckObjCBridgeRelatedConversions(SourceLocation Loc, QualType DestType, QualType SrcType, - Expr *&SrcExpr); - - bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr *&SrcExpr); - + Expr *&SrcExpr, bool Diagnose = true); + + bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr *&SrcExpr, + bool Diagnose = true); + bool checkInitMethod(ObjCMethodDecl *method, QualType receiverTypeIfCall); /// \brief Check whether the given new method is a valid override of the @@ -8613,6 +8616,7 @@ public: ARCConversionResult CheckObjCARCConversion(SourceRange castRange, QualType castType, Expr *&op, CheckedConversionKind CCK, + bool Diagnose = true, bool DiagnoseCFAudited = false, BinaryOperatorKind Opc = BO_PtrMemD ); Modified: cfe/branches/release_38/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/lib/Sema/SemaDeclCXX.cpp?rev=259412&r1=259411&r2=259412&view=diff == --- cfe/branches/release_38/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/branches/release_38/lib/Sema/SemaDeclCXX.cpp Mon Feb 1 15:40:38 2016 @@ -1742,13 +1742,18 @@ void Sema::BuildBa
[llvm-branch-commits] [cfe-branch] r259414 - Merging r258396:
Author: hans Date: Mon Feb 1 15:43:22 2016 New Revision: 259414 URL: http://llvm.org/viewvc/llvm-project?rev=259414&view=rev Log: Merging r258396: r258396 | abataev | 2016-01-21 04:54:48 -0800 (Thu, 21 Jan 2016) | 2 lines Fix crash for typedefs for arrays of runtime bounds in Lambdas/Captured Statements, used in sizeof() expression only. Modified: cfe/branches/release_38/ (props changed) cfe/branches/release_38/lib/Sema/SemaExpr.cpp cfe/branches/release_38/test/CodeGenCXX/lambda-expressions.cpp Propchange: cfe/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 15:43:22 2016 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:257652,257695,257710,257947,258110,259260 +/cfe/trunk:257652,257695,257710,257947,258110,258396,259260 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_38/lib/Sema/SemaExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/lib/Sema/SemaExpr.cpp?rev=259414&r1=259413&r2=259414&view=diff == --- cfe/branches/release_38/lib/Sema/SemaExpr.cpp (original) +++ cfe/branches/release_38/lib/Sema/SemaExpr.cpp Mon Feb 1 15:43:22 2016 @@ -3748,6 +3748,128 @@ bool Sema::CheckVecStepExpr(Expr *E) { return CheckUnaryExprOrTypeTraitOperand(E, UETT_VecStep); } +static void captureVariablyModifiedType(ASTContext &Context, QualType T, +CapturingScopeInfo *CSI) { + assert(T->isVariablyModifiedType()); + assert(CSI != nullptr); + + // We're going to walk down into the type and look for VLA expressions. + do { +const Type *Ty = T.getTypePtr(); +switch (Ty->getTypeClass()) { +#define TYPE(Class, Base) +#define ABSTRACT_TYPE(Class, Base) +#define NON_CANONICAL_TYPE(Class, Base) +#define DEPENDENT_TYPE(Class, Base) case Type::Class: +#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) +#include "clang/AST/TypeNodes.def" + T = QualType(); + break; +// These types are never variably-modified. +case Type::Builtin: +case Type::Complex: +case Type::Vector: +case Type::ExtVector: +case Type::Record: +case Type::Enum: +case Type::Elaborated: +case Type::TemplateSpecialization: +case Type::ObjCObject: +case Type::ObjCInterface: +case Type::ObjCObjectPointer: +case Type::Pipe: + llvm_unreachable("type class is never variably-modified!"); +case Type::Adjusted: + T = cast(Ty)->getOriginalType(); + break; +case Type::Decayed: + T = cast(Ty)->getPointeeType(); + break; +case Type::Pointer: + T = cast(Ty)->getPointeeType(); + break; +case Type::BlockPointer: + T = cast(Ty)->getPointeeType(); + break; +case Type::LValueReference: +case Type::RValueReference: + T = cast(Ty)->getPointeeType(); + break; +case Type::MemberPointer: + T = cast(Ty)->getPointeeType(); + break; +case Type::ConstantArray: +case Type::IncompleteArray: + // Losing element qualification here is fine. + T = cast(Ty)->getElementType(); + break; +case Type::VariableArray: { + // Losing element qualification here is fine. + const VariableArrayType *VAT = cast(Ty); + + // Unknown size indication requires no size computation. + // Otherwise, evaluate and record it. + if (auto Size = VAT->getSizeExpr()) { +if (!CSI->isVLATypeCaptured(VAT)) { + RecordDecl *CapRecord = nullptr; + if (auto LSI = dyn_cast(CSI)) { +CapRecord = LSI->Lambda; + } else if (auto CRSI = dyn_cast(CSI)) { +CapRecord = CRSI->TheRecordDecl; + } + if (CapRecord) { +auto ExprLoc = Size->getExprLoc(); +auto SizeType = Context.getSizeType(); +// Build the non-static data member. +auto Field = +FieldDecl::Create(Context, CapRecord, ExprLoc, ExprLoc, + /*Id*/ nullptr, SizeType, /*TInfo*/ nullptr, + /*BW*/ nullptr, /*Mutable*/ false, + /*InitStyle*/ ICIS_NoInit); +Field->setImplicit(true); +Field->setAccess(AS_private); +Field->setCapturedVLAType(VAT); +CapRecord->addDecl(Field); + +CSI->addVLATypeCapture(ExprLoc, SizeType); + } +} + } + T = VAT->getElementType(); + break; +} +case Type::FunctionProto: +case Type::FunctionNoProto: + T = cast(Ty)->getReturnType(); + break; +case Type::Paren: +case Type::TypeOf: +case Type::UnaryTransform: +case
[llvm-branch-commits] [cfe-branch] r259422 - Merging r257831, r257838, r257853, r257861, r257869, r257870, r257871.
Author: hans Date: Mon Feb 1 16:13:54 2016 New Revision: 259422 URL: http://llvm.org/viewvc/llvm-project?rev=259422&view=rev Log: Merging r257831, r257838, r257853, r257861, r257869, r257870, r257871. r257831 | rtrieu | 2016-01-14 14:56:39 -0800 (Thu, 14 Jan 2016) | 13 lines Refactor template type diffing 1) Instead of using pairs of From/To* fields, combine fields into a struct TemplateArgInfo and have two in each DiffNode. 2) Use default initialization in DiffNode so that the constructor shows the only field that is initialized differently on construction. 3) Use Set and Get functions per each DiffKind to make sure all fields for the diff is set. In one case, the Expr fields were not set. 4) Don't print boolean literals for boolean template arguments. This prevents printing 'false aka 0' Only #3 has a functional change, which is reflected in the test change. r257838 | rtrieu | 2016-01-14 15:30:12 -0800 (Thu, 14 Jan 2016) | 6 lines Change the TSTiterator in Template Type Diffing. Modify the TSTiterator to have two internal iterators, which will walk the provided sugared type and the desugared type. This will provide better access to the template argument information. No functional changes. r257853 | rtrieu | 2016-01-14 17:08:56 -0800 (Thu, 14 Jan 2016) | 11 lines Make template type diffing use the new desguared iterator. If available, use the canonical template argument to fill in information for template type diffing instead of attempting to special case and evaluate Expr's for the value. Since those are the values used in template instantiation, we don't have to worry about difference between our evaluator and theirs. Also move the nullptr template arguments from DiffKind::Expression to DiffKind::Declaration and allow DiffKind::Declaration to set an Expr. The only effect that should result is that a named nullptr will show up as 'ptr aka nullptr' in diagnostics. r257861 | rtrieu | 2016-01-14 18:55:17 -0800 (Thu, 14 Jan 2016) | 7 lines Save the integer type for integral template arguments. Save the integer type when diffing integers in template type diffing. When integers are different sizes, print out the type along with the integer value. Also with the type information, print true and false instead of 1 and 0 for boolean values. r257869 | rtrieu | 2016-01-14 21:01:53 -0800 (Thu, 14 Jan 2016) | 6 lines Add new diff modes to template type diffing. Remove an old assertion that does not hold. It is possible for a template argument to be a declaration in one instantiation and an integer in another. Create two new diff kinds for these (decl vs int and int vs decl). r257870 | rtrieu | 2016-01-14 21:48:38 -0800 (Thu, 14 Jan 2016) | 10 lines Fixing more issues with template type diffing 1) Print qualifiers for templates with zero arguments 2) Add a few more tests for the template type diffing refactoring. Specifically, PR24587 has been fixed and has a test case from http://reviews.llvm.org/D15384 3) Adds asserts to check the DiffTree is in correct state when moving nodes 4) Rename the field FromType and ToType since it is heavily used within member functions. r257871 | jyknight | 2016-01-14 21:57:41 -0800 (Thu, 14 Jan 2016) | 1 line Fix a -Wparentheses warning in ASTDiagnostic.cpp. Modified: cfe/branches/release_38/ (props changed) cfe/branches/release_38/lib/AST/ASTDiagnostic.cpp cfe/branches/release_38/test/Misc/diag-template-diffing-color.cpp cfe/branches/release_38/test/Misc/diag-template-diffing.cpp Propchange: cfe/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 16:13:54 2016 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:257652,257695,257710,257947,258110,258396,259260 +/cfe/trunk:257652,257695,257710,257831,257838,257853,257861,257869-257871,257947,258110,258396,259260 /cfe/trunk/test:170344 /cfe/trunk/test/Sema
[llvm-branch-commits] [lldb] r259423 - Merging r257926:
Author: hans Date: Mon Feb 1 16:17:05 2016 New Revision: 259423 URL: http://llvm.org/viewvc/llvm-project?rev=259423&view=rev Log: Merging r257926: r257926 | ribrdb | 2016-01-15 11:35:48 -0800 (Fri, 15 Jan 2016) | 1 line Implement missing GoASTContext methods Modified: lldb/branches/release_38/ (props changed) lldb/branches/release_38/source/Symbol/GoASTContext.cpp Propchange: lldb/branches/release_38/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Feb 1 16:17:05 2016 @@ -1,3 +1,3 @@ /lldb/branches/apple/python-GIL:156467-162159 /lldb/branches/iohandler:198360-200250 -/lldb/trunk:257691-257692,258621,258684-258685,258758,258761,259188 +/lldb/trunk:257691-257692,257926,258621,258684-258685,258758,258761,259188 Modified: lldb/branches/release_38/source/Symbol/GoASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_38/source/Symbol/GoASTContext.cpp?rev=259423&r1=259422&r2=259423&view=diff == --- lldb/branches/release_38/source/Symbol/GoASTContext.cpp (original) +++ lldb/branches/release_38/source/Symbol/GoASTContext.cpp Mon Feb 1 16:17:05 2016 @@ -13,6 +13,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" +#include "lldb/Core/StreamFile.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/StringPrinter.h" @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( //-- // Dumping types //-- +#define DEPTH_INCREMENT 2 + void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format, -const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, +const DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) { -assert(false); +if (IsTypedefType(type)) +type = GetTypedefedType(type).GetOpaqueQualType(); +if (!type) +return; +GoType *t = static_cast(type); + +if (GoStruct *st = t->GetStruct()) +{ +if (GetCompleteType(type)) +{ +uint32_t field_idx = 0; +for (auto* field = st->GetField(field_idx); field != nullptr; field_idx++) +{ +// Print the starting squiggly bracket (if this is the +// first member) or comma (for member 2 and beyond) for +// the struct/union/class member. +if (field_idx == 0) +s->PutChar('{'); +else +s->PutChar(','); + +// Indent +s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); + +// Print the member type if requested +if (show_types) +{ +ConstString field_type_name = field->m_type.GetTypeName(); +s->Printf("(%s) ", field_type_name.AsCString()); +} +// Print the member name and equal sign +s->Printf("%s = ", field->m_name.AsCString()); + + +// Dump the value of the member +CompilerType field_type = field->m_type; +field_type.DumpValue (exe_ctx, + s, // Stream to dump to + field_type.GetFormat(), // The format with which to display the member + data, // Data buffer containing all bytes for this type + data_byte_offset + field->m_byte_offset,// Offset into "data" where to grab value from + field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), // Size of this type in bytes + 0, // Bitfield bit size + 0, // Bitfield bit offset + show_types, // Boolean indicating if we should show the variable types + show_summary, // Boolean indicating if we should show a summary for the current type +