r244196 - Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.
Author: yrnkrn Date: Thu Aug 6 02:28:36 2015 New Revision: 244196 URL: http://llvm.org/viewvc/llvm-project?rev=244196&view=rev Log: Plug a memory leak in NeonEmitter: Intrinsics allocated were never released. Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.cpp?rev=244196&r1=244195&r2=244196&view=diff == --- cfe/trunk/utils/TableGen/NeonEmitter.cpp (original) +++ cfe/trunk/utils/TableGen/NeonEmitter.cpp Thu Aug 6 02:28:36 2015 @@ -532,6 +532,12 @@ public: ClassMap[NoTestOpI] = ClassNoTest; } + ~NeonEmitter() { +for (auto &P : IntrinsicMap) + for (Intrinsic *I : P.second) +delete I; + } + // run - Emit arm_neon.h.inc void run(raw_ostream &o); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11753: [X86] Add support for _MM_ALIGN16
This revision was automatically updated to reflect the committed changes. Closed by commit rL244201: [X86] Add support for _MM_ALIGN16 (authored by mkuper). Changed prior to commit: http://reviews.llvm.org/D11753?vs=31317&id=31430#toc Repository: rL LLVM http://reviews.llvm.org/D11753 Files: cfe/trunk/lib/Headers/xmmintrin.h cfe/trunk/test/CodeGen/ms-mm-align.c Index: cfe/trunk/test/CodeGen/ms-mm-align.c === --- cfe/trunk/test/CodeGen/ms-mm-align.c +++ cfe/trunk/test/CodeGen/ms-mm-align.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ +// RUN: -triple i686--windows -emit-llvm %s -o - \ +// RUN: | FileCheck %s -check-prefix CHECK + +// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from +// stddef.h. Work around it with this typedef. +typedef __SIZE_TYPE__ size_t; +#include + +void capture_ptr(int* i); +void test_mm_align16(int p) { + _MM_ALIGN16 int i; + capture_ptr(&i); +} + +// CHECK: alloca i32, align 16 Index: cfe/trunk/lib/Headers/xmmintrin.h === --- cfe/trunk/lib/Headers/xmmintrin.h +++ cfe/trunk/lib/Headers/xmmintrin.h @@ -924,6 +924,11 @@ return __builtin_ia32_movmskps(__a); } + +#ifdef _MSC_VER +#define _MM_ALIGN16 __declspec(align(16)) +#endif + #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) #define _MM_EXCEPT_INVALID(0x0001) Index: cfe/trunk/test/CodeGen/ms-mm-align.c === --- cfe/trunk/test/CodeGen/ms-mm-align.c +++ cfe/trunk/test/CodeGen/ms-mm-align.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ +// RUN: -triple i686--windows -emit-llvm %s -o - \ +// RUN: | FileCheck %s -check-prefix CHECK + +// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from +// stddef.h. Work around it with this typedef. +typedef __SIZE_TYPE__ size_t; +#include + +void capture_ptr(int* i); +void test_mm_align16(int p) { + _MM_ALIGN16 int i; + capture_ptr(&i); +} + +// CHECK: alloca i32, align 16 Index: cfe/trunk/lib/Headers/xmmintrin.h === --- cfe/trunk/lib/Headers/xmmintrin.h +++ cfe/trunk/lib/Headers/xmmintrin.h @@ -924,6 +924,11 @@ return __builtin_ia32_movmskps(__a); } + +#ifdef _MSC_VER +#define _MM_ALIGN16 __declspec(align(16)) +#endif + #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) #define _MM_EXCEPT_INVALID(0x0001) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244201 - [X86] Add support for _MM_ALIGN16
Author: mkuper Date: Thu Aug 6 03:24:38 2015 New Revision: 244201 URL: http://llvm.org/viewvc/llvm-project?rev=244201&view=rev Log: [X86] Add support for _MM_ALIGN16 Differential Revision: http://reviews.llvm.org/D11753 Added: cfe/trunk/test/CodeGen/ms-mm-align.c Modified: cfe/trunk/lib/Headers/xmmintrin.h Modified: cfe/trunk/lib/Headers/xmmintrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=244201&r1=244200&r2=244201&view=diff == --- cfe/trunk/lib/Headers/xmmintrin.h (original) +++ cfe/trunk/lib/Headers/xmmintrin.h Thu Aug 6 03:24:38 2015 @@ -924,6 +924,11 @@ _mm_movemask_ps(__m128 __a) return __builtin_ia32_movmskps(__a); } + +#ifdef _MSC_VER +#define _MM_ALIGN16 __declspec(align(16)) +#endif + #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) #define _MM_EXCEPT_INVALID(0x0001) Added: cfe/trunk/test/CodeGen/ms-mm-align.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-mm-align.c?rev=244201&view=auto == --- cfe/trunk/test/CodeGen/ms-mm-align.c (added) +++ cfe/trunk/test/CodeGen/ms-mm-align.c Thu Aug 6 03:24:38 2015 @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ +// RUN: -triple i686--windows -emit-llvm %s -o - \ +// RUN: | FileCheck %s -check-prefix CHECK + +// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from +// stddef.h. Work around it with this typedef. +typedef __SIZE_TYPE__ size_t; +#include + +void capture_ptr(int* i); +void test_mm_align16(int p) { + _MM_ALIGN16 int i; + capture_ptr(&i); +} + +// CHECK: alloca i32, align 16 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11476: Marked call instruction in thunk function with tail attribute when applicable
This revision was automatically updated to reflect the committed changes. Closed by commit rL244207: Mark calls in thunk functions as tail-call optimization candidates (authored by mkuper). Changed prior to commit: http://reviews.llvm.org/D11476?vs=31341&id=31440#toc Repository: rL LLVM http://reviews.llvm.org/D11476 Files: cfe/trunk/lib/CodeGen/CGVTables.cpp cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp Index: cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp === --- cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp +++ cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp @@ -176,7 +176,7 @@ // Do an adjustment from B* to C*. // DTORS2: getelementptr i8, i8* %{{.*}}, i32 -4 // DTORS2: bitcast i8* %{{.*}} to %"struct.dtor_in_second_nvbase::C"* -// DTORS2: %[[CALL:.*]] = call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" +// DTORS2: %[[CALL:.*]] = tail call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" // DTORS2: ret i8* %[[CALL]] } Index: cfe/trunk/lib/CodeGen/CGVTables.cpp === --- cfe/trunk/lib/CodeGen/CGVTables.cpp +++ cfe/trunk/lib/CodeGen/CGVTables.cpp @@ -312,6 +312,8 @@ // Consider return adjustment if we have ThunkInfo. if (Thunk && !Thunk->Return.isEmpty()) RV = PerformReturnAdjustment(*this, ResultType, RV, *Thunk); + else if (llvm::CallInst* Call = dyn_cast(CallOrInvoke)) +Call->setTailCallKind(llvm::CallInst::TCK_Tail); // Emit return. if (!ResultType->isVoidType() && Slot.isNull()) Index: cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp === --- cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp +++ cfe/trunk/test/CodeGenCXX/microsoft-abi-structors.cpp @@ -176,7 +176,7 @@ // Do an adjustment from B* to C*. // DTORS2: getelementptr i8, i8* %{{.*}}, i32 -4 // DTORS2: bitcast i8* %{{.*}} to %"struct.dtor_in_second_nvbase::C"* -// DTORS2: %[[CALL:.*]] = call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" +// DTORS2: %[[CALL:.*]] = tail call x86_thiscallcc i8* @"\01??_GC@dtor_in_second_nvbase@@UAEPAXI@Z" // DTORS2: ret i8* %[[CALL]] } Index: cfe/trunk/lib/CodeGen/CGVTables.cpp === --- cfe/trunk/lib/CodeGen/CGVTables.cpp +++ cfe/trunk/lib/CodeGen/CGVTables.cpp @@ -312,6 +312,8 @@ // Consider return adjustment if we have ThunkInfo. if (Thunk && !Thunk->Return.isEmpty()) RV = PerformReturnAdjustment(*this, ResultType, RV, *Thunk); + else if (llvm::CallInst* Call = dyn_cast(CallOrInvoke)) +Call->setTailCallKind(llvm::CallInst::TCK_Tail); // Emit return. if (!ResultType->isVoidType() && Slot.isNull()) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11761: [PATCH] clang-query quit command
aaron.ballman closed this revision. aaron.ballman added a comment. In http://reviews.llvm.org/D11761#218178, @pcc wrote: > You'd have had to look at the documentation (i.e. the "help" message) anyway > to determine the right way to terminate the program. We can document > Ctrl-{D,Z} there instead of introducing a new command. FWIW (and I should probably be ashamed to admit this in public), but when I first ran clang-query in interactive mode, I tried "quit", then I tried "exit", and then I just went and End Tasked the application. Control codes didn't enter my thought process, and I didn't try "help" for another few sessions. Discoverability isn't just about reading documentation, it's about ecosystem "norms" too. > But this isn't worth arguing about and I am clearly in the minority here, if > you still think that adding a new command here is the way to go, LGTM. Thank you, I've commit in r244206 ~Aaron http://reviews.llvm.org/D11761 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] r244208 - Correcting and adding tests for r244206.
Author: aaronballman Date: Thu Aug 6 07:15:47 2015 New Revision: 244208 URL: http://llvm.org/viewvc/llvm-project?rev=244208&view=rev Log: Correcting and adding tests for r244206. Modified: clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp Modified: clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp?rev=244208&r1=244207&r2=244208&view=diff == --- clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp (original) +++ clang-tools-extra/trunk/unittests/clang-query/QueryParserTest.cpp Thu Aug 6 07:15:47 2015 @@ -131,7 +131,7 @@ TEST_F(QueryParserTest, LetUnlet) { TEST_F(QueryParserTest, Complete) { std::vector Comps = QueryParser::complete("", 0, QS); - ASSERT_EQ(5u, Comps.size()); + ASSERT_EQ(6u, Comps.size()); EXPECT_EQ("help ", Comps[0].TypedText); EXPECT_EQ("help", Comps[0].DisplayText); EXPECT_EQ("let ", Comps[1].TypedText); @@ -142,6 +142,8 @@ TEST_F(QueryParserTest, Complete) { EXPECT_EQ("set", Comps[3].DisplayText); EXPECT_EQ("unlet ", Comps[4].TypedText); EXPECT_EQ("unlet", Comps[4].DisplayText); + EXPECT_EQ("quit", Comps[5].DisplayText); + EXPECT_EQ("quit ", Comps[5].TypedText); Comps = QueryParser::complete("set o", 5, QS); ASSERT_EQ(1u, Comps.size()); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244209 - [OPENMP 4.1] Allow references in init expression for loop-based constructs.
Author: abataev Date: Thu Aug 6 07:30:57 2015 New Revision: 244209 URL: http://llvm.org/viewvc/llvm-project?rev=244209&view=rev Log: [OPENMP 4.1] Allow references in init expression for loop-based constructs. OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms. Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/AST/Stmt.cpp cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp cfe/trunk/lib/Sema/SemaOpenMP.cpp cfe/trunk/lib/Serialization/ASTReaderStmt.cpp cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/test/OpenMP/for_codegen.cpp cfe/trunk/test/OpenMP/for_loop_messages.cpp cfe/trunk/test/OpenMP/for_simd_loop_messages.cpp cfe/trunk/test/OpenMP/parallel_for_loop_messages.cpp cfe/trunk/test/OpenMP/parallel_for_simd_loop_messages.cpp cfe/trunk/test/OpenMP/simd_loop_messages.cpp Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=244209&r1=244208&r2=244209&view=diff == --- cfe/trunk/include/clang/AST/StmtOpenMP.h (original) +++ cfe/trunk/include/clang/AST/StmtOpenMP.h Thu Aug 6 07:30:57 2015 @@ -311,11 +311,18 @@ class OMPLoopDirective : public OMPExecu return MutableArrayRef(Storage, CollapsedNum); } + /// \brief Get the private counters storage. + MutableArrayRef getPrivateCounters() { +Expr **Storage = reinterpret_cast(&*std::next( +child_begin(), getArraysOffset(getDirectiveKind()) + CollapsedNum)); +return MutableArrayRef(Storage, CollapsedNum); + } + /// \brief Get the updates storage. MutableArrayRef getUpdates() { Expr **Storage = reinterpret_cast( &*std::next(child_begin(), -getArraysOffset(getDirectiveKind()) + CollapsedNum)); +getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); return MutableArrayRef(Storage, CollapsedNum); } @@ -323,7 +330,7 @@ class OMPLoopDirective : public OMPExecu MutableArrayRef getFinals() { Expr **Storage = reinterpret_cast( &*std::next(child_begin(), -getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); +getArraysOffset(getDirectiveKind()) + 3 * CollapsedNum)); return MutableArrayRef(Storage, CollapsedNum); } @@ -358,7 +365,7 @@ protected: static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind) { return getArraysOffset(Kind) + - 3 * CollapsedNum; // Counters, Updates and Finals + 4 * CollapsedNum; // Counters, PrivateCounters, Updates and Finals } void setIterationVariable(Expr *IV) { @@ -414,6 +421,7 @@ protected: *std::next(child_begin(), NextUpperBoundOffset) = NUB; } void setCounters(ArrayRef A); + void setPrivateCounters(ArrayRef A); void setUpdates(ArrayRef A); void setFinals(ArrayRef A); @@ -453,6 +461,8 @@ public: Expr *NUB; /// \brief Counters Loop counters. SmallVector Counters; +/// \brief PrivateCounters Loop counters. +SmallVector PrivateCounters; /// \brief Expressions for loop counters update for CodeGen. SmallVector Updates; /// \brief Final loop counter values for GodeGen. @@ -484,10 +494,12 @@ public: NLB = nullptr; NUB = nullptr; Counters.resize(Size); + PrivateCounters.resize(Size); Updates.resize(Size); Finals.resize(Size); for (unsigned i = 0; i < Size; ++i) { Counters[i] = nullptr; +PrivateCounters[i] = nullptr; Updates[i] = nullptr; Finals[i] = nullptr; } @@ -584,6 +596,12 @@ public: return const_cast(this)->getCounters(); } + ArrayRef private_counters() { return getPrivateCounters(); } + + ArrayRef private_counters() const { +return const_cast(this)->getPrivateCounters(); + } + ArrayRef updates() { return getUpdates(); } ArrayRef updates() const { Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=244209&r1=244208&r2=244209&view=diff == --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Aug 6 07:30:57 2015 @@ -7545,8 +7545,8 @@ def err_omp_aligned_twice : Error< def err_omp_local_var_in_threadprivate_init : Error< "variable with local storage in initial value of threadprivate variable">; def err_omp_loop_not_canonical_init : Error< - "initialization clause of OpenMP for loop must be of the form " - "'var = init' or 'T var = init'">; + "initialization clause of OpenMP for loop is no
Re: [PATCH] D11781: Refactored pthread usage in libcxx
theraven added inline comments. Comment at: include/__mutex_base:246 @@ -266,3 +245,3 @@ -class _LIBCPP_TYPE_VIS condition_variable +class _LIBCPP_TYPE_VIS condition_variable : private __libcxx_support::condition_variable { Does this change the ABI for a mutex on *NIX platforms? We can't change the class layout for existing platforms (though we can indirect things via typedefs). Comment at: include/mutex:182 @@ -181,2 +181,3 @@ #endif -#include +#ifndef _WIN32 +#include As above, there should probably be in a cross-platform support file that includes these. In particular, not-win32 is not the correct condition for uses-pthreads. We should probably have something in __config that determines the thread library to use. It would be quite nice to have a C11 thread back end, for example (though most implementations currently wrap pthreads). Comment at: include/mutex:269 @@ -285,3 +268,3 @@ bool recursive_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) { I didn't realise this idiocy made it into C++11, I thought it was confined to C11. Locking a mutex using anything other than time intervals on the monotonic time source is a great way of producing non-working programs. We should probably warn if anyone actually calls this... Repository: rL LLVM http://reviews.llvm.org/D11781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D10933: Add new IdentifierNaming check
alexfh added inline comments. Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:178 @@ +177,3 @@ +if (NamingStyles[Typedef].isSet()) { + KindName = "typedef"; + Style = NamingStyles[Typedef]; berenm wrote: > alexfh wrote: > > berenm wrote: > > > alexfh wrote: > > > > Would it be better to have these in a single array next to > > > > `StyleNames`? Also, this code could return a `StyleKind` (now > > > > `StyleConst`), and you would need to get the corresponding > > > > `NamingStyle` and `KindName` once. > > > > > > > > This code would suddenly become much leaner. > > > The problem is that sometimes, the current code falls back to a more > > > generic naming style, but the "kind name" is still trying to describe the > > > original declaration. > > > > > > For example, if no style is defined for methods, then it will try to use > > > a more generic "function" style, but the warning will still be "invalid > > > case style for method xxx". > > > > > > Maybe this is superfluous and I can drop it. It don't see many cases > > > anyway (my original code was covering more cases - too many - and it > > > seemed sensible at that time). > > > The problem is that sometimes, the current code falls back to a more > > > generic naming style, but the "kind name" is still trying to describe the > > > original declaration. > > > > I see. It might be possible to split the mapping of types to style kinds > > and handling missing styles. E.g. a function can return "Method" (which > > should be SK_Method according to [1], btw) and then a caller would check > > whether the corresponding `NamingStyle` is configured, and if needed fall > > back to a more generic category. WDYT? > > > > > > [1] > > http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly > I think it would be difficult to map the declaration types to style kinds > without checking the styles that have been provided and falling back to > another style at the same time. > > For example, a constexpr method is currently selecting the styles in this > preferred order : > constexpr method > [public/protected/private] method > method > function. > > The order is debatable, but we cannot have the //constexpr method// to > //public/protected/private method// fallback, if there is no style for > constexpr methods, without reading again the method declaration. > > It might be OK that the warning message do not use the exact identifier kind > name, and one can even think it is better to have a warning message that > tells the user which style it used instead of which kind of identifier was > checked. > we cannot have the constexpr method to public/protected/private method > fallback, if there is no style for > constexpr methods, without reading again the method declaration. So the issue is caused by the fact that the categories are partially overlapping and don't form a hierarchy. Not sure whether this is convenient for the end-user and if it's a good model, but this can fit into the approach: the function can return an ordered list of `StyleKind`s that could then be looked up in the configured `NamingStyle`s. I don't insist on this specific implementation, but it might end up being more elegant solution. http://reviews.llvm.org/D10933 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D10933: Add new IdentifierNaming check
berenm updated this revision to Diff 31447. berenm added a comment. Here is an updated version with some style fixes, and function splits. The styles are still selected the same way as before (no split between finding the best type style and falling back to available style), but there is only the StyleKind returned and the warning message is deduced from the StyleNames (lower case conversion and underscores replaced with spaces). I can still implement the mechanism suggested in comment #218645 if you find it is cleaner. http://reviews.llvm.org/D10933 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IdentifierNamingCheck.cpp clang-tidy/readability/IdentifierNamingCheck.h clang-tidy/readability/ReadabilityTidyModule.cpp test/clang-tidy/readability-identifier-naming.cpp Index: test/clang-tidy/readability-identifier-naming.cpp === --- /dev/null +++ test/clang-tidy/readability-identifier-naming.cpp @@ -0,0 +1,261 @@ +// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-identifier-naming %t \ +// RUN: -config='{CheckOptions: [ \ +// RUN: {key: readability-identifier-naming.AbstractClassCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.AbstractClassPrefix, value: 'A'}, \ +// RUN: {key: readability-identifier-naming.ClassCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.ClassPrefix, value: 'C'}, \ +// RUN: {key: readability-identifier-naming.ClassConstantCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.ClassConstantPrefix, value: 'k'}, \ +// RUN: {key: readability-identifier-naming.ClassMemberCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.ClassMethodCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.ConstantCase, value: UPPER_CASE}, \ +// RUN: {key: readability-identifier-naming.ConstantSuffix, value: '_CST'}, \ +// RUN: {key: readability-identifier-naming.ConstexprFunctionCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.ConstexprMethodCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.ConstexprVariableCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.EnumCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.EnumPrefix, value: 'E'}, \ +// RUN: {key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE}, \ +// RUN: {key: readability-identifier-naming.FunctionCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE}, \ +// RUN: {key: readability-identifier-naming.GlobalFunctionCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.GlobalVariableCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.GlobalVariablePrefix, value: 'g_'}, \ +// RUN: {key: readability-identifier-naming.InlineNamespaceCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.LocalConstantCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.LocalConstantPrefix, value: 'k'}, \ +// RUN: {key: readability-identifier-naming.LocalVariableCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.MemberCase, value: CamelCase}, \ +// RUN: {key: readability-identifier-naming.MemberPrefix, value: 'm_'}, \ +// RUN: {key: readability-identifier-naming.ConstantMemberCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.PrivateMemberPrefix, value: '__'}, \ +// RUN: {key: readability-identifier-naming.ProtectedMemberPrefix, value: '_'}, \ +// RUN: {key: readability-identifier-naming.PublicMemberCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.MethodCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.PrivateMethodPrefix, value: '__'}, \ +// RUN: {key: readability-identifier-naming.ProtectedMethodPrefix, value: '_'}, \ +// RUN: {key: readability-identifier-naming.NamespaceCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.ParameterCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.ParameterPrefix, value: 'a_'}, \ +// RUN: {key: readability-identifier-naming.ConstantParameterCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.ConstantParameterPrefix, value: 'i_'}, \ +// RUN: {key: readability-identifier-naming.ParameterPackCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.PureFunctionCase, value: lower_case}, \ +// RUN: {key: readability-identifier-naming.PureMethodCase, value: camelBack}, \ +// RUN: {key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE}, \ +// RUN: {key: readability-identifier-naming.StaticVariableCase, value: camelBack}, \ +// RUN: {key: readabili
Re: [PATCH] D11781: Refactored pthread usage in libcxx
theraven added inline comments. Comment at: include/__mutex_base:246 @@ -266,3 +245,3 @@ -class _LIBCPP_TYPE_VIS condition_variable +class _LIBCPP_TYPE_VIS condition_variable : private __libcxx_support::condition_variable { espositofulvio wrote: > theraven wrote: > > Does this change the ABI for a mutex on *NIX platforms? We can't change > > the class layout for existing platforms (though we can indirect things via > > typedefs). > My hunch is that it doesn't, std::condition_variable has no data member now > and the first base class (__libcxx_support::condition_variable) contains only > pthread_cond_t which will be effectively laid out at the starting address of > the object, as it was previously for std::condition_variable,. I will check > this out later in the evening though. I *think* that it's correct, but it's worth compiling a program that has one compilation unit using the old header and another using the new one and check that it's able to interoperate correctly. Also check whether this depends on the implementation of the condition variable. On FreeBSD, the pthread types are all pointers (currently - we're going to have some painful ABI breakage at some point when we move them to being something that can live in shared memory). In glibc, they're structures. I don't think that you'll end up with different padding in the ABI from wrapping them in a class, but it's worth checking. Comment at: include/mutex:182 @@ -181,2 +181,3 @@ #endif -#include +#ifndef _WIN32 +#include espositofulvio wrote: > theraven wrote: > > As above, there should probably be in a cross-platform support file that > > includes these. In particular, not-win32 is not the correct condition for > > uses-pthreads. We should probably have something in __config that > > determines the thread library to use. It would be quite nice to have a C11 > > thread back end, for example (though most implementations currently wrap > > pthreads). > In this case having a series of #ifdef __FreeBSD__ (or _WIN32, etc.) doesn't > quite cut it as we want to be able to select C11 or pthread on most of them > and on Windows one day it might even be C11, pthread or the win32 api. I > guess the alternative is to provide a cmake variable that default to > something different on each platform? > We'll probably end up with a set of #ifdef FreeBSD (or whatever) things, but making sure that they're all in a single file will help. If you're doing bring-up of a new platform, just having to set #define __LIBCXX_THREAD_API __LIBCXX_PTHREAD, or __LIBCXX_C11_THREADS, (or Haiku threads, or whatever) in one place makes life a bit easier. One of the annoyances with trying to port asan was that the original developers used #ifdef __APPLE__ to mean 'is not Linux' and 'is Darwin' in various places, so we needed to look at every single change and determine whether they were shared between multiple non-GNU platforms or whether they were specific to OS X / iOS. Repository: rL LLVM http://reviews.llvm.org/D11781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r244193 - [ObjC] Circular containers: add support of subclasses
Ah, you were referring to http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134471.html Sorry, email is hard to keep up with sometimes :-) On Thu, Aug 6, 2015 at 9:15 AM, Hans Wennborg wrote: > Hi Alex, > > What crash is that? I don't see any PR number in the commit. > > Richard, what's your owner's opinion? > > On Wed, Aug 5, 2015 at 9:54 PM, AlexDenisov <1101.deb...@gmail.com> wrote: >> Hi, Hans. >> The patch fixes crash reported by Argyrios. >> Might be a candidate for release_37. >> -- >> AlexDenisov >> Software Engineer, http://lowlevelbits.org >> >>> On 06 Aug 2015, at 06:51, Alex Denisov <1101.deb...@gmail.com> wrote: >>> >>> Author: alexdenisov >>> Date: Wed Aug 5 23:51:14 2015 >>> New Revision: 244193 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=244193&view=rev >>> Log: >>> [ObjC] Circular containers: add support of subclasses ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D5102: [analyzer][Bugfix/improvement] Fix for PR16833
jordan_rose added a comment. I guess the regular pings didn't work, so it was worth trying the gentle one? Sorry! This seems mostly ready to me, but I still have a few comments. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:1646-1650 @@ -1644,2 +1645,7 @@ DefinedOrUnknownSVal CondV = CondV_untested.castAs(); + if (CondV.isUnknown()) { +CondV = state->getStateManager().getSValBuilder().conjureSymbolVal(nullptr, + CondE, LCtx, builder.getBuilderContext()->blockCount()); +state = state->BindExpr(CondE, LCtx, CondV); + } What's the purpose of this? As I understand it, a switch condition value will never be reused in later states, so there's no point in adding constraints to it unless it's already symbolic. (And not bothering to do this would remove the need to pass the NodeBuilderContext through.) Comment at: lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp:199-200 @@ +198,4 @@ +// Just add the constraint to the expression without trying to simplify. +SymbolRef Sym = Value.getAsSymExpr(); +return assumeSymWithinInclusiveRange(State, Sym, From, To, InRange); + } Will this ever return a null symbol? Maybe add an assertion? Comment at: lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp:215-220 @@ +214,8 @@ + return assumeSymWithinInclusiveRange(State, Sym, From, To, InRange); +return State; + } // end switch + + case nonloc::ConcreteIntKind: { +const llvm::APSInt &IntVal = Value.castAs().getValue(); +bool IsInRange = IntVal >= From && IntVal <= To; +bool isFeasible = (IsInRange == InRange); This is still relevant. Comment at: test/Analysis/switch-case.c:1 @@ +1,2 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=debug.ExprInspection -verify %s + All tests should include the "core" checkers. At some point we'll probably make that implicit, but for now please add that to the -analyzer-checker list. Comment at: test/Analysis/switch-case.c:24-25 @@ +23,4 @@ + case 3 ... 10: +clang_analyzer_eval(t > 1);// expected-warning{{TRUE}} +clang_analyzer_eval(t + 2 <= 11); // expected-warning{{TRUE}} +clang_analyzer_eval(t + 1 == 3); // expected-warning{{UNKNOWN}} Can you include at least one more check here: `clang_analyzer_eval(t > 2)`? (Which should be unknown.) Comment at: test/Analysis/switch-case.c:122 @@ +121,3 @@ + +void testDefaultBrachRange(int arg) { + switch (arg) { Typo: "Brach" http://reviews.llvm.org/D5102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r244193 - [ObjC] Circular containers: add support of subclasses
> Ah, you were referring to > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134471.html Yes, that is correct :) > Sorry, email is hard to keep up with sometimes :-) No worries, I do understand ;) -- AlexDenisov Software Engineer, http://lowlevelbits.org > On 06 Aug 2015, at 18:17, Hans Wennborg wrote: > > Ah, you were referring to > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134471.html > > Sorry, email is hard to keep up with sometimes :-) > > On Thu, Aug 6, 2015 at 9:15 AM, Hans Wennborg wrote: >> Hi Alex, >> >> What crash is that? I don't see any PR number in the commit. >> >> Richard, what's your owner's opinion? >> >> On Wed, Aug 5, 2015 at 9:54 PM, AlexDenisov <1101.deb...@gmail.com> wrote: >>> Hi, Hans. >>> The patch fixes crash reported by Argyrios. >>> Might be a candidate for release_37. >>> -- >>> AlexDenisov >>> Software Engineer, http://lowlevelbits.org >>> On 06 Aug 2015, at 06:51, Alex Denisov <1101.deb...@gmail.com> wrote: Author: alexdenisov Date: Wed Aug 5 23:51:14 2015 New Revision: 244193 URL: http://llvm.org/viewvc/llvm-project?rev=244193&view=rev Log: [ObjC] Circular containers: add support of subclasses signature.asc Description: Message signed with OpenPGP using GPGMail ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11437: Correct x86_64 fp128 calling convention
rnk added a comment. In http://reviews.llvm.org/D11437#211165, @chh wrote: > I tried to make X86_64ABIInfo::classify to return (Lo=SSE, Hi=NoClass) for > fp128 long double type, or (Lo=SSE, Hi=SSEUp). That is not enough, although > making fp128 Complex type to "Memory" worked. > > X86_64ABIInfo::classifyArgumentType and classifyReturnType > will classify fp128 type as "double" through the help of GetSSETypeAtOffset. > These two or three functions still need more changes to handle fp128. > So I used the special cases for fp128, which seemed simpler with lower risk. > > The mapping to register classes is quite complicated to decide converted > parameter or return types. Although AMD64 spec has lengthy rules written this > way, the rules are quite difficult to understand the mapping of fp128 type. > > Is there other way to simplify these classification functions? I think the right approach is to classify as SSE+SSEUp. It didn't work for you because GetByteVectorType was turning fp128 types into <2 x double>, which will correctly use XMM registers, but is not the IR you wanted. I have a patch that fixes the TODOs and simplifies the code, do you mind if I land that? http://reviews.llvm.org/D11437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11437: Correct x86_64 fp128 calling convention
rnk commandeered this revision. rnk added a reviewer: chh. rnk added a comment. Comandeering so I can upload my diff. http://reviews.llvm.org/D11437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11437: Correct x86_64 fp128 calling convention
rnk updated this revision to Diff 31457. rnk updated the summary for this revision. rnk added a comment. - Update classify and GetByteVectorType http://reviews.llvm.org/D11437 Files: lib/CodeGen/TargetInfo.cpp test/CodeGen/x86_64-fp128.c Index: test/CodeGen/x86_64-fp128.c === --- /dev/null +++ test/CodeGen/x86_64-fp128.c @@ -0,0 +1,116 @@ +// RUN: %clang_cc1 -triple x86_64-linux-android -emit-llvm -O -o - %s \ +// RUN:| FileCheck %s --check-prefix=ANDROID --check-prefix=CHECK +// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -O -o - %s \ +// RUN:| FileCheck %s --check-prefix=GNU --check-prefix=CHECK +// RUN: %clang_cc1 -triple x86_64 -emit-llvm -O -o - %s \ +// RUN:| FileCheck %s --check-prefix=GNU --check-prefix=CHECK + +// Android uses fp128 for long double but other x86_64 targets use x86_fp80. + +long double dataLD = 1.0L; +// ANDROID: @dataLD = global fp128 0xL3FFF, align 16 +// GNU: @dataLD = global x86_fp80 0xK3FFF8000, align 16 + +long double _Complex dataLDC = {1.0L, 1.0L}; +// ANDROID: @dataLDC = global { fp128, fp128 } { fp128 0xL3FFF, fp128 0xL3FFF }, align 16 +// GNU: @dataLDC = global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000, x86_fp80 0xK3FFF8000 }, align 16 + +long double TestLD(long double x) { + return x * x; +// ANDROID: define fp128 @TestLD(fp128 %x) +// GNU: define x86_fp80 @TestLD(x86_fp80 %x) +} + +long double _Complex TestLDC(long double _Complex x) { + return x * x; +// ANDROID: define void @TestLDC({ fp128, fp128 }* {{.*}}, { fp128, fp128 }* {{.*}} %x) +// GNU: define { x86_fp80, x86_fp80 } @TestLDC({ x86_fp80, x86_fp80 }* {{.*}} %x) +} + +typedef __builtin_va_list va_list; + +int TestGetVarInt(va_list ap) { + return __builtin_va_arg(ap, int); +// Since int can be passed in memory or in register there is a branch and a phi. +// CHECK: define i32 @TestGetVarInt( +// CHECK: br +// CHECK: load {{.*}} %overflow_arg_area_p +// CHECK: = phi +// CHECK: ret i32 +} + +double TestGetVarDouble(va_list ap) { + return __builtin_va_arg(ap, double); +// Since double can be passed in memory or in register there is a branch and a phi. +// CHECK: define double @TestGetVarDouble( +// CHECK: br +// CHECK: load {{.*}} %overflow_arg_area_p +// CHECK: = phi +// CHECK: ret double +} + +long double TestGetVarLD(va_list ap) { + return __builtin_va_arg(ap, long double); +// fp128 can be passed in memory or in register, but x86_fp80 is in memory. +// ANDROID: define fp128 @TestGetVarLD( +// GNU: define x86_fp80 @TestGetVarLD( +// ANDROID: br +// GNU-NOT: br +// CHECK: load {{.*}} %overflow_arg_area_p +// ANDROID: = phi +// GNU-NOT: = phi +// ANDROID: ret fp128 +// GNU: ret x86_fp80 +} + +long double _Complex TestGetVarLDC(va_list ap) { + return __builtin_va_arg(ap, long double _Complex); +// Pair of fp128 or x86_fp80 are passed as struct in memory. +// ANDROID: define void @TestGetVarLDC({ fp128, fp128 }* {{.*}}, %struct.__va_list_tag* +// GNU: define { x86_fp80, x86_fp80 } @TestGetVarLDC( +// CHECK-NOT: br +// CHECK: load {{.*}} %overflow_arg_area_p +// CHECK-NOT: phi +// ANDROID: ret void +// GNU: ret { x86_fp80, x86_fp80 } +} + +void TestVarArg(const char *s, ...); + +void TestPassVarInt(int x) { + TestVarArg("A", x); +// CHECK: define void @TestPassVarInt(i32 %x) +// CHECK: call {{.*}} @TestVarArg(i8* {{.*}}, i32 %x) +} + +void TestPassVarFloat(float x) { + TestVarArg("A", x); +// CHECK: define void @TestPassVarFloat(float %x) +// CHECK: call {{.*}} @TestVarArg(i8* {{.*}}, double % +} + +void TestPassVarDouble(double x) { + TestVarArg("A", x); +// CHECK: define void @TestPassVarDouble(double %x) +// CHECK: call {{.*}} @TestVarArg(i8* {{.*}}, double %x +} + +void TestPassVarLD(long double x) { + TestVarArg("A", x); +// ANDROID: define void @TestPassVarLD(fp128 %x) +// ANDROID: call {{.*}} @TestVarArg(i8* {{.*}}, fp128 %x +// GNU: define void @TestPassVarLD(x86_fp80 %x) +// GNU: call {{.*}} @TestVarArg(i8* {{.*}}, x86_fp80 %x +} + +void TestPassVarLDC(long double _Complex x) { + TestVarArg("A", x); +// ANDROID: define void @TestPassVarLDC({ fp128, fp128 }* {{.*}} %x) +// ANDROID: store fp128 %x.{{.*}}, fp128* % +// ANDROID-NEXT: store fp128 %x.{{.*}}, fp128* % +// ANDROID-NEXT: call {{.*}} @TestVarArg(i8* {{.*}}, { fp128, fp128 }* {{.*}} % +// GNU: define void @TestPassVarLDC({ x86_fp80, x86_fp80 }* {{.*}} %x) +// GNU: store x86_fp80 %x.{{.*}}, x86_fp80* % +// GNU-NEXT: store x86_fp80 %x.{{.*}}, x86_fp80* % +// GNGNU-NEXT: call {{.*}} @TestVarArg(i8* {{.*}}, { x86_fp80, x86_fp80 }* {{.*}} % +} Index: lib/CodeGen/TargetInfo.cpp === --- lib/CodeGen/TargetInfo.cpp +++ lib/CodeGen/TargetInfo.cpp @@ -1862,13 +1862,20 @@ Hi = Integer;
Re: [PATCH] D9924: Ignore report when the argument to malloc is assigned known value
zaks.anna added a comment. Thanks! See the comments inline. Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:182 @@ +181,3 @@ + if (rhs->isEvaluatable(Context)) +eraseAssign = true; + // Erase if the multiplicand was assigned a value, In this case, the size will be a multiplication os two constants, which we will assume cannot be exploitable, so seems legitimate. (Maybe spell this out in the comment?) Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:186 @@ +185,3 @@ + // is a division operator and the denominator is > other multiplicand. + const Expr *rhse = rhs->IgnoreParenImpCasts(); + if (const BinaryOperator *BOp = dyn_cast(rhse)) { I am not sure about this one. We are saying that if the size expression in malloc was a multiplication of an expression and a constant (maxVal), than we should not warn if the expression was a devision of something unknown by another constant (val) that is greater or equal to the first constant (maxVal). We don't know what that expression is and what the lhs of the devision is... Other comments in regards to this check: the names used to represent the constants are not very expressive and there is quite a bit of copy and paste from the function above. The test only tests the case where val is equal to maxVal. Comment at: lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp:319 @@ -245,3 +318,3 @@ if (!FD) -return; +continue; Could you add a test case for this change and the one below? This should probably be bart of a separate commit as this is unrelated to the other change. http://reviews.llvm.org/D9924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11658: [Sema] main can't be declared as global variable
davide added a comment. Hi Richard, do you have any comments on the new patch? http://reviews.llvm.org/D11658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D11808: Driver: Fix include and lib dirs when not using gcc under mingw
martell created this revision. martell added a reviewer: yaron.keren. martell added a subscriber: cfe-commits. When gcc is not installed we fail to set the correct include and lib directory. In some cases base is set and we might want to use clang without gcc being installed http://reviews.llvm.org/D11808 Files: lib/Driver/MinGWToolChain.cpp Index: lib/Driver/MinGWToolChain.cpp === --- lib/Driver/MinGWToolChain.cpp +++ lib/Driver/MinGWToolChain.cpp @@ -47,7 +47,7 @@ Archs.emplace_back(getTriple().getArchName()); Archs[0] += "-w64-mingw32"; Archs.emplace_back("mingw32"); - Arch = "unknown"; + Arch = Archs[0].str(); // lib: Arch Linux, Ubuntu, Windows // lib64: openSUSE Linux for (StringRef CandidateLib : {"lib", "lib64"}) { Index: lib/Driver/MinGWToolChain.cpp === --- lib/Driver/MinGWToolChain.cpp +++ lib/Driver/MinGWToolChain.cpp @@ -47,7 +47,7 @@ Archs.emplace_back(getTriple().getArchName()); Archs[0] += "-w64-mingw32"; Archs.emplace_back("mingw32"); - Arch = "unknown"; + Arch = Archs[0].str(); // lib: Arch Linux, Ubuntu, Windows // lib64: openSUSE Linux for (StringRef CandidateLib : {"lib", "lib64"}) { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r244192 - [modules] Defer setting up the lookup table for a DeclContext until we can
On Thu, Aug 6, 2015 at 11:29 AM, Richard Smith wrote: > On Aug 6, 2015 11:01 AM, "David Blaikie" wrote: > > > > > > > > On Wed, Aug 5, 2015 at 9:23 PM, Richard Smith < > richard-l...@metafoo.co.uk> wrote: > >> > >> Author: rsmith > >> Date: Wed Aug 5 23:23:48 2015 > >> New Revision: 244192 > >> > >> URL: http://llvm.org/viewvc/llvm-project?rev=244192&view=rev > >> Log: > >> [modules] Defer setting up the lookup table for a DeclContext until we > can > >> determine the primary context, rather than sometimes registering the > lookup > >> table on the wrong context. > >> > >> This exposed a couple of bugs: > >> * the odr violation check didn't deal properly with mergeable > declarations > >>if the declaration retained by name lookup wasn't in the canonical > >>definition of the class > >> * the (broken) RewriteDecl mechanism would emit two name lookup tables > for > >>the same DeclContext into the same module file (one as part of the > >>rewritten declaration and one as a visible update for the old > declaration) > > > > > > Is it practical to provide test cases for these? (I guess the second one > is perhaps just a perf problem? The first one sounds like a possible > functional bug, though?) > > The existing test suite failed without these fixes, after the other change > described above. > Ah, OK, I get it now. Thanks! > >> These are both fixed too. > >> > >> Modified: > >> cfe/trunk/include/clang/Serialization/ASTReader.h > >> cfe/trunk/lib/Serialization/ASTReader.cpp > >> cfe/trunk/lib/Serialization/ASTReaderDecl.cpp > >> cfe/trunk/lib/Serialization/ASTWriter.cpp > >> > >> Modified: cfe/trunk/include/clang/Serialization/ASTReader.h > >> URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=244192&r1=244191&r2=244192&view=diff > >> > == > >> --- cfe/trunk/include/clang/Serialization/ASTReader.h (original) > >> +++ cfe/trunk/include/clang/Serialization/ASTReader.h Wed Aug 5 > 23:23:48 2015 > >> @@ -495,19 +495,21 @@ private: > >>llvm::DenseMap FileDeclIDs; > >> > >>// Updates for visible decls can occur for other contexts than just > the > >> - // TU, and when we read those update records, the actual context > will not > >> - // be available yet (unless it's the TU), so have this pending map > using the > >> - // ID as a key. It will be realized when the context is actually > loaded. > >> - typedef > >> - > SmallVector *, > >> - ModuleFile*>, 1> DeclContextVisibleUpdates; > >> - typedef llvm::DenseMap DeclContextVisibleUpdates> > >> - DeclContextVisibleUpdatesPending; > >> + // TU, and when we read those update records, the actual context may > not > >> + // be available yet, so have this pending map using the ID as a key. > It > >> + // will be realized when the context is actually loaded. > >> + struct PendingVisibleUpdate { > >> +ModuleFile *Mod; > >> +const unsigned char *Data; > >> +unsigned BucketOffset; > >> + }; > >> + typedef SmallVector > DeclContextVisibleUpdates; > >> > >>/// \brief Updates to the visible declarations of declaration > contexts that > >>/// haven't been loaded yet. > >> - DeclContextVisibleUpdatesPending PendingVisibleUpdates; > >> - > >> + llvm::DenseMap > >> + PendingVisibleUpdates; > >> + > >>/// \brief The set of C++ or Objective-C classes that have forward > >>/// declarations that have not yet been linked to their definitions. > >>llvm::SmallPtrSet PendingDefinitions; > >> @@ -524,11 +526,14 @@ private: > >>/// performed deduplication. > >>llvm::SetVector PendingMergedDefinitionsToDeduplicate; > >> > >> - /// \brief Read the records that describe the contents of > declcontexts. > >> - bool ReadDeclContextStorage(ModuleFile &M, > >> - llvm::BitstreamCursor &Cursor, > >> - const std::pair > &Offsets, > >> - serialization::DeclContextInfo &Info); > >> + /// \brief Read the record that describes the lexical contents of a > DC. > >> + bool ReadLexicalDeclContextStorage(ModuleFile &M, > >> + llvm::BitstreamCursor &Cursor, > >> + uint64_t Offset, DeclContext *DC); > >> + /// \brief Read the record that describes the visible contents of a > DC. > >> + bool ReadVisibleDeclContextStorage(ModuleFile &M, > >> + llvm::BitstreamCursor &Cursor, > >> + uint64_t Offset, > serialization::DeclID ID); > >> > >>/// \brief A vector containing identifiers that have already been > >>/// loaded. > >> > >> Modified: cfe/trunk/lib/Serialization/ASTReader.cpp > >> URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=244192&r1=244191&r2=244192&view=diff > >> > =
r244241 - Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise)
Author: dblaikie Date: Thu Aug 6 13:29:32 2015 New Revision: 244241 URL: http://llvm.org/viewvc/llvm-project?rev=244241&view=rev Log: Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise) Improvement to the memory leak fix in 244196. Address validity is required for the Intrinsic objects, but since the collections only ever grow (no elements are removed), deque provides sufficient guarantees (that the objects will never be reallocated/moved around) for this use case. Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.cpp?rev=244241&r1=244240&r2=244241&view=diff == --- cfe/trunk/utils/TableGen/NeonEmitter.cpp (original) +++ cfe/trunk/utils/TableGen/NeonEmitter.cpp Thu Aug 6 13:29:32 2015 @@ -36,6 +36,7 @@ #include "llvm/TableGen/SetTheory.h" #include "llvm/TableGen/TableGenBackend.h" #include +#include #include #include #include @@ -393,7 +394,7 @@ public: /// Return true if the prototype has a scalar argument. /// This does not return true for the "splat" code ('a'). - bool protoHasScalar(); + bool protoHasScalar() const; /// Return the index that parameter PIndex will sit at /// in a generated function call. This is often just PIndex, @@ -431,9 +432,9 @@ public: /// Return the name, mangled with type information. /// If ForceClassS is true, use ClassS (u32/s32) instead /// of the intrinsic's own type class. - std::string getMangledName(bool ForceClassS = false); + std::string getMangledName(bool ForceClassS = false) const; /// Return the type code for a builtin function call. - std::string getInstTypeCode(Type T, ClassKind CK); + std::string getInstTypeCode(Type T, ClassKind CK) const; /// Return the type string for a BUILTIN() macro in Builtins.def. std::string getBuiltinTypeStr(); @@ -444,7 +445,7 @@ public: void indexBody(); private: - std::string mangleName(std::string Name, ClassKind CK); + std::string mangleName(std::string Name, ClassKind CK) const; void initVariables(); std::string replaceParamsIn(std::string S); @@ -494,7 +495,7 @@ private: class NeonEmitter { RecordKeeper &Records; DenseMap ClassMap; - std::map> IntrinsicMap; + std::map> IntrinsicMap; unsigned UniqueNumber; void createIntrinsic(Record *R, SmallVectorImpl &Out); @@ -507,7 +508,7 @@ class NeonEmitter { public: /// Called by Intrinsic - this attempts to get an intrinsic that takes /// the given types as arguments. - Intrinsic *getIntrinsic(StringRef Name, ArrayRef Types); + Intrinsic &getIntrinsic(StringRef Name, ArrayRef Types); /// Called by Intrinsic - returns a globally-unique number. unsigned getUniqueNumber() { return UniqueNumber++; } @@ -532,12 +533,6 @@ public: ClassMap[NoTestOpI] = ClassNoTest; } - ~NeonEmitter() { -for (auto &P : IntrinsicMap) - for (Intrinsic *I : P.second) -delete I; - } - // run - Emit arm_neon.h.inc void run(raw_ostream &o); @@ -960,7 +955,7 @@ void Type::applyModifier(char Mod) { // Intrinsic implementation //===--===// -std::string Intrinsic::getInstTypeCode(Type T, ClassKind CK) { +std::string Intrinsic::getInstTypeCode(Type T, ClassKind CK) const { char typeCode = '\0'; bool printNumber = true; @@ -1055,7 +1050,7 @@ std::string Intrinsic::getBuiltinTypeStr return S; } -std::string Intrinsic::getMangledName(bool ForceClassS) { +std::string Intrinsic::getMangledName(bool ForceClassS) const { // Check if the prototype has a scalar operand with the type of the vector // elements. If not, bitcasting the args will take care of arg checking. // The actual signedness etc. will be taken care of with special enums. @@ -1066,7 +1061,7 @@ std::string Intrinsic::getMangledName(bo return mangleName(Name, ForceClassS ? ClassS : LocalCK); } -std::string Intrinsic::mangleName(std::string Name, ClassKind LocalCK) { +std::string Intrinsic::mangleName(std::string Name, ClassKind LocalCK) const { std::string typeCode = getInstTypeCode(BaseType, LocalCK); std::string S = Name; @@ -1284,7 +1279,7 @@ void Intrinsic::emitShadowedArgs() { // We don't check 'a' in this function, because for builtin function the // argument matching to 'a' uses a vector type splatted from a scalar type. -bool Intrinsic::protoHasScalar() { +bool Intrinsic::protoHasScalar() const { return (Proto.find('s') != std::string::npos || Proto.find('z') != std::string::npos || Proto.find('r') != std::string::npos || @@ -1497,15 +1492,14 @@ std::pair Intrinsic:: N = SI->getAsUnquotedString(); else N = emitDagArg(DI->getArg(0), "").second; - Intrinsic *Callee = Intr.Emitter.getIntrinsic(N, Types); - assert(C
[PATCH] D11815: Pass subtarget feature "force-align-stack"
ahatanak created this revision. ahatanak added reviewers: echristo, dexonsmith. ahatanak added a subscriber: cfe-commits. This patch makes changes to pass subtarget feature "force-align-stack" instead of passing a backend-option when users provide "-mstackrealign" on the command line. The llvm-side change is here: http://reviews.llvm.org/D11814 http://reviews.llvm.org/D11815 Files: lib/Driver/Tools.cpp test/Driver/stackrealign.c Index: test/Driver/stackrealign.c === --- test/Driver/stackrealign.c +++ test/Driver/stackrealign.c @@ -1,12 +1,12 @@ // RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NORMAL -// NORMAL-NOT: -force-align-stack +// NORMAL-NOT: "-target-feature" "+force-align-stack" // NORMAL: -mstackrealign // RUN: %clang -### -mstackrealign %s 2>&1 | FileCheck %s -check-prefix=MREALIGN -// MREALIGN: -force-align-stack +// MREALIGN: "-target-feature" "+force-align-stack" // MREALIGN: -mstackrealign // RUN: %clang -### -mno-stackrealign %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=MNOREALIGN -// MNOREALIGN-NOT: -force-align-stack +// MNOREALIGN-NOT: "-target-feature" "+force-align-stack" // MNOREALIGN-NOT: -mstackrealign Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -2116,6 +2116,11 @@ break; } + // Add generic features. + if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, + false)) +Features.push_back("+force-align-stack"); + // Find the last of each feature. llvm::StringMap LastOpt; for (unsigned I = 0, N = Features.size(); I < N; ++I) { @@ -4225,11 +4230,6 @@ } // Translate -mstackrealign - if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, - false)) { -CmdArgs.push_back("-backend-option"); -CmdArgs.push_back("-force-align-stack"); - } if (!Args.hasFlag(options::OPT_mno_stackrealign, options::OPT_mstackrealign, false)) { CmdArgs.push_back(Args.MakeArgString("-mstackrealign")); Index: test/Driver/stackrealign.c === --- test/Driver/stackrealign.c +++ test/Driver/stackrealign.c @@ -1,12 +1,12 @@ // RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NORMAL -// NORMAL-NOT: -force-align-stack +// NORMAL-NOT: "-target-feature" "+force-align-stack" // NORMAL: -mstackrealign // RUN: %clang -### -mstackrealign %s 2>&1 | FileCheck %s -check-prefix=MREALIGN -// MREALIGN: -force-align-stack +// MREALIGN: "-target-feature" "+force-align-stack" // MREALIGN: -mstackrealign // RUN: %clang -### -mno-stackrealign %s 2>&1 | \ // RUN: FileCheck %s -check-prefix=MNOREALIGN -// MNOREALIGN-NOT: -force-align-stack +// MNOREALIGN-NOT: "-target-feature" "+force-align-stack" // MNOREALIGN-NOT: -mstackrealign Index: lib/Driver/Tools.cpp === --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -2116,6 +2116,11 @@ break; } + // Add generic features. + if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, + false)) +Features.push_back("+force-align-stack"); + // Find the last of each feature. llvm::StringMap LastOpt; for (unsigned I = 0, N = Features.size(); I < N; ++I) { @@ -4225,11 +4230,6 @@ } // Translate -mstackrealign - if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign, - false)) { -CmdArgs.push_back("-backend-option"); -CmdArgs.push_back("-force-align-stack"); - } if (!Args.hasFlag(options::OPT_mno_stackrealign, options::OPT_mstackrealign, false)) { CmdArgs.push_back(Args.MakeArgString("-mstackrealign")); ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [Patch][LoopVectorize]Late evaluation of vectorization requirements
I’ve updated the patches a bit. I am going post another pair of patches to add another late diagnostic soon as well.Please review,Tyler LLVM-Late-evaluation-of-vectorization-requirements.patch Description: Binary data LLVM-Removed-unused-and-incorrectly-implemented-classof-o.patch Description: Binary data Clang-Add-diagnostic-to-append-fp-commute-clang-options-to.patch Description: Binary data On Aug 5, 2015, at 1:57 PM, Tyler Nowickiwrote:Hi,Could I get a review of these patches?Thanks,TylerOn Jul 27, 2015, at 4:45 PM, Tyler Nowicki wrote:Please ignore the debug line in the LLVM late-evaluation patch. It won’t be part of the commit.+ DEBUG(dbgs() << "LV: Emitting analysis message.\n”);TylerOn Jul 27, 2015, at 3:23 PM, Tyler Nowicki wrote:Hi Hal,Thanks for the review! No worries about the delay.Could I get a review of these patches for cfe and llvm?Hi Tyler,I'm apologize for the delay. I think this generally looks good, but I don't understand the motivation for introducing the additional FrontendOptions member. Why not just make a subclass of DiagnosticInfoOptimizationRemarkAnalysis that the frontend can handle specially (and detect using the normal isa/dyn_cast mechanism?\The diagnostic handling code doesn’t use isa or dyn_cast, rather it uses switches to select between different types. I modified the patch to use a subclass rather than a member variable. Let me know what patch you think would work out better?I should have also said in my previous email that I am not thrilledby the need to use O3 in the clang-side test.So using -O2 or using -fvectorize does not help?Using -O1 with -fvectorize seems to work, at least it is a smaller set of passes than O3.I attached the updated patches. I also noticed that DiagnosticInfoOptimizationBase::classof() was incorrectly implemented. It would need its own diagnostic kind, but that doesn’t make sense because you would never instantiate the base class. I thought it was best just to remove it. See the third patch.Tyler___cfe-commits mailing listcfe-comm...@cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[Patch][LoopVectorize] Late evaluate of runtime pointer check's threshold
Hi,This patch extends the patches in 'Late evaluation of vectorization requirements’ (still in review). This makes the num runtime pointer checks test into a late diagnostic so we can give the user a better diagnostic message. Clang appends the diagnostic with options for getting the loop vectorized. Here is an example of the diagnostic the user will see:"remark: loop not vectorized: cannot prove pointers refer to independent arrays in memory. The loop requires 9 runtime independence checks to safely vectorize the loop, but that would exceed the limit of 8 checks; increase the number of runtime pointer checks with the compiler option ‘-mllvm -runtime-memory-check-threshold=’. To avoid runtime pointer checking when you know the arrays will always be independent specify ‘#pragma clang loop vectorize(assume_safety)’ before the loop or specify ‘restrict’ on the array arguments. Erroneous results will occur if these options are incorrectly applied."The diagnostic is produced when the command line option -Rpass-analysis=loop-vectorize is provided.Reviews/comments are much appreciated!Tyler LLVM-Extend-late-diagnostics-to-include-late-test-for-run.patch Description: Binary data Clang-Extended-late-diagnostics-to-ammend-options-related-.patch Description: Binary data ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11298: Convert a few classes over to use the new TrailingObjects helper.
jyknight marked 2 inline comments as done. Comment at: lib/AST/Decl.cpp:3122 @@ +3121,3 @@ + void *Buffer = Context.Allocate( + totalSizeToAlloc( + TArgs.size(), Ts.size())); rsmith wrote: > OK, I guessed that might be the reason. Seems like a reasonable safety > measure. (Do you get an error if you specify the wrong types?) Yep, the function has an enable_if to ensure you call it with the right types. Repository: rL LLVM http://reviews.llvm.org/D11298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244266 - [ItaniumCXXABI] Don't import RTTI data for classes with key functions
Author: majnemer Date: Thu Aug 6 15:56:55 2015 New Revision: 244266 URL: http://llvm.org/viewvc/llvm-project?rev=244266&view=rev Log: [ItaniumCXXABI] Don't import RTTI data for classes with key functions MinGW has some pretty strange behvaior around RTTI and dllimport/dllexport: - RTTI data is never imported - RTTI data is only exported if the class has no key function. Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=244266&r1=244265&r2=244266&view=diff == --- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original) +++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Thu Aug 6 15:56:55 2015 @@ -2450,10 +2450,13 @@ static bool ShouldUseExternalRTTIDescrip // FIXME: this may need to be reconsidered if the key function // changes. +// N.B. We must always emit the RTTI data ourselves if there exists a key +// function. +bool IsDLLImport = RD->hasAttr(); if (CGM.getVTables().isVTableExternal(RD)) - return true; + return IsDLLImport ? false : true; -if (RD->hasAttr()) +if (IsDLLImport) return true; } @@ -2683,8 +2686,15 @@ static llvm::GlobalVariable::LinkageType const CXXRecordDecl *RD = cast(Record->getDecl()); if (RD->hasAttr()) return llvm::GlobalValue::WeakODRLinkage; - if (RD->isDynamicClass()) -return CGM.getVTableLinkage(RD); + if (RD->isDynamicClass()) { +llvm::GlobalValue::LinkageTypes LT = CGM.getVTableLinkage(RD); +// MinGW won't export the RTTI information when there is a key function. +// Make sure we emit our own copy instead of attempting to dllimport it. +if (RD->hasAttr() && +llvm::GlobalValue::isAvailableExternallyLinkage(LT)) + LT = llvm::GlobalValue::LinkOnceODRLinkage; +return LT; + } } return llvm::GlobalValue::LinkOnceODRLinkage; Modified: cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp?rev=244266&r1=244265&r2=244266&view=diff == --- cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp (original) +++ cfe/trunk/test/CodeGenCXX/dllimport-rtti.cpp Thu Aug 6 15:56:55 2015 @@ -15,3 +15,10 @@ struct __declspec(dllimport) S { struct U : S { } u; + +struct __declspec(dllimport) V { + virtual void f(); +} v; +// GNU-DAG: @_ZTV1V = available_externally dllimport +// GNU-DAG: @_ZTS1V = linkonce_odr +// GNU-DAG: @_ZTI1V = linkonce_odr ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11666: [CUDA] Make sure we emit all templated __global__ functions on device side.
tra added a comment. Ping. http://reviews.llvm.org/D11666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11666: [CUDA] Make sure we emit all templated __global__ functions on device side.
LGTM On Thursday, August 6, 2015, Artem Belevich wrote: > tra added a comment. > > Ping. > > > http://reviews.llvm.org/D11666 > > > > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D10018: C11 _Bool bitfield diagnostic
rcraik marked 2 inline comments as done. rcraik added a comment. http://reviews.llvm.org/D10018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244286 - Continue the work from r243908 by adding a Features field to Builtin::Info
Author: echristo Date: Thu Aug 6 17:11:54 2015 New Revision: 244286 URL: http://llvm.org/viewvc/llvm-project?rev=244286&view=rev Log: Continue the work from r243908 by adding a Features field to Builtin::Info so that we can populate it on a per-target basis with required features. Future commits will start using this information for warnings. Modified: cfe/trunk/include/clang/Basic/Builtins.h cfe/trunk/lib/Basic/Targets.cpp Modified: cfe/trunk/include/clang/Basic/Builtins.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244286&r1=244285&r2=244286&view=diff == --- cfe/trunk/include/clang/Basic/Builtins.h (original) +++ cfe/trunk/include/clang/Basic/Builtins.h Thu Aug 6 17:11:54 2015 @@ -51,6 +51,7 @@ enum ID { struct Info { const char *Name, *Type, *Attributes, *HeaderName; LanguageID Langs; + const char *Features; }; /// \brief Holds information about both target-independent and @@ -166,6 +167,10 @@ public: return strchr(getRecord(ID).Attributes, 'e') != nullptr; } + const char *getRequiredFeatures(unsigned ID) const { +return getRecord(ID).Features; + } + private: const Info &getRecord(unsigned ID) const; Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244286&r1=244285&r2=244286&view=diff == --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 6 17:11:54 2015 @@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(co // Namespace for x86 abstract base class const Builtin::Info BuiltinInfo[] = { #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ - ALL_LANGUAGES }, +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES }, +#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \ + { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE }, #include "clang/Basic/BuiltinsX86.def" }; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244288 - [modules] Fix use-after-iterator-invalidation bug.
Author: rsmith Date: Thu Aug 6 17:14:12 2015 New Revision: 244288 URL: http://llvm.org/viewvc/llvm-project?rev=244288&view=rev Log: [modules] Fix use-after-iterator-invalidation bug. Modified: cfe/trunk/lib/Serialization/ASTReader.cpp Modified: cfe/trunk/lib/Serialization/ASTReader.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=244288&r1=244287&r2=244288&view=diff == --- cfe/trunk/lib/Serialization/ASTReader.cpp (original) +++ cfe/trunk/lib/Serialization/ASTReader.cpp Thu Aug 6 17:14:12 2015 @@ -6185,7 +6185,7 @@ void ASTReader::FindExternalLexicalDecls SmallVectorImpl &Decls) { bool PredefsVisited[NUM_PREDEF_DECL_IDS] = {}; - auto Visit = [&] (ModuleFile *M, const LexicalContents &LexicalDecls) { + auto Visit = [&] (ModuleFile *M, LexicalContents LexicalDecls) { assert(LexicalDecls.size() % 2 == 0 && "expected an even number of entries"); for (int I = 0, N = LexicalDecls.size(); I != N; I += 2) { auto K = (Decl::Kind)+LexicalDecls[I]; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244289 - [modules] Remove unused ModuleManager::visitDepthFirst function.
Author: rsmith Date: Thu Aug 6 17:14:35 2015 New Revision: 244289 URL: http://llvm.org/viewvc/llvm-project?rev=244289&view=rev Log: [modules] Remove unused ModuleManager::visitDepthFirst function. Modified: cfe/trunk/include/clang/Serialization/ModuleManager.h cfe/trunk/lib/Serialization/ModuleManager.cpp Modified: cfe/trunk/include/clang/Serialization/ModuleManager.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ModuleManager.h?rev=244289&r1=244288&r2=244289&view=diff == --- cfe/trunk/include/clang/Serialization/ModuleManager.h (original) +++ cfe/trunk/include/clang/Serialization/ModuleManager.h Thu Aug 6 17:14:35 2015 @@ -277,36 +277,6 @@ public: void visit(llvm::function_ref Visitor, llvm::SmallPtrSetImpl *ModuleFilesHit = nullptr); - /// \brief Control DFS behavior during preorder visitation. - enum DFSPreorderControl { -Continue,/// Continue visiting all nodes. -Abort, /// Stop the visitation immediately. -SkipImports, /// Do not visit imports of the current node. - }; - - /// \brief Visit each of the modules with a depth-first traversal. - /// - /// This routine visits each of the modules known to the module - /// manager using a depth-first search, starting with the first - /// loaded module. The traversal invokes one callback before - /// traversing the imports (preorder traversal) and one after - /// traversing the imports (postorder traversal). - /// - /// \param PreorderVisitor A visitor function that will be invoked with each - /// module before visiting its imports. The visitor can control how to - /// continue the visitation through its return value. - /// - /// \param PostorderVisitor A visitor function taht will be invoked with each - /// module after visiting its imports. The visitor may return true at any time - /// to abort the depth-first visitation. - /// - /// \param UserData User data ssociated with the visitor object, - /// which will be passed along to the user. - void visitDepthFirst(DFSPreorderControl (*PreorderVisitor)(ModuleFile &M, - void *UserData), - bool (*PostorderVisitor)(ModuleFile &M, void *UserData), - void *UserData); - /// \brief Attempt to resolve the given module file name to a file entry. /// /// \param FileName The name of the module file. Modified: cfe/trunk/lib/Serialization/ModuleManager.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ModuleManager.cpp?rev=244289&r1=244288&r2=244289&view=diff == --- cfe/trunk/lib/Serialization/ModuleManager.cpp (original) +++ cfe/trunk/lib/Serialization/ModuleManager.cpp Thu Aug 6 17:14:35 2015 @@ -417,71 +417,6 @@ void ModuleManager::visit(llvm::function returnVisitState(State); } -static void markVisitedDepthFirst(ModuleFile &M, - SmallVectorImpl &Visited) { - for (llvm::SetVector::iterator IM = M.Imports.begin(), - IMEnd = M.Imports.end(); - IM != IMEnd; ++IM) { -if (Visited[(*IM)->Index]) - continue; -Visited[(*IM)->Index] = true; -if (!M.DirectlyImported) - markVisitedDepthFirst(**IM, Visited); - } -} - -/// \brief Perform a depth-first visit of the current module. -static bool visitDepthFirst( -ModuleFile &M, -ModuleManager::DFSPreorderControl (*PreorderVisitor)(ModuleFile &M, - void *UserData), -bool (*PostorderVisitor)(ModuleFile &M, void *UserData), void *UserData, -SmallVectorImpl &Visited) { - if (PreorderVisitor) { -switch (PreorderVisitor(M, UserData)) { -case ModuleManager::Abort: - return true; -case ModuleManager::SkipImports: - markVisitedDepthFirst(M, Visited); - return false; -case ModuleManager::Continue: - break; -} - } - - // Visit children - for (llvm::SetVector::iterator IM = M.Imports.begin(), -IMEnd = M.Imports.end(); - IM != IMEnd; ++IM) { -if (Visited[(*IM)->Index]) - continue; -Visited[(*IM)->Index] = true; - -if (visitDepthFirst(**IM, PreorderVisitor, PostorderVisitor, UserData, Visited)) - return true; - } - - if (PostorderVisitor) -return PostorderVisitor(M, UserData); - - return false; -} - -void ModuleManager::visitDepthFirst( -ModuleManager::DFSPreorderControl (*PreorderVisitor)(ModuleFile &M, - void *UserData), -bool (*PostorderVisitor)(ModuleFile &M, void *UserData), void *UserData) { - SmallVector Visited(size(), false); - for (unsigned I = 0, N = Roots.size(); I != N; ++I) { -if (Visited[Roots[I]->Index]) - c
r244290 - Range-forify a loop, delete trailing whitespace. NFC
Author: dougk Date: Thu Aug 6 17:36:24 2015 New Revision: 244290 URL: http://llvm.org/viewvc/llvm-project?rev=244290&view=rev Log: Range-forify a loop, delete trailing whitespace. NFC Modified: cfe/trunk/lib/Driver/ToolChain.cpp Modified: cfe/trunk/lib/Driver/ToolChain.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=244290&r1=244289&r2=244290&view=diff == --- cfe/trunk/lib/Driver/ToolChain.cpp (original) +++ cfe/trunk/lib/Driver/ToolChain.cpp Thu Aug 6 17:36:24 2015 @@ -313,7 +313,7 @@ std::string ToolChain::ComputeLLVMTriple std::string CPU = Triple.isOSBinFormatMachO() ? tools::arm::getARMCPUForMArch(MArch, Triple) : tools::arm::getARMTargetCPU(MCPU, MArch, Triple); -StringRef Suffix = +StringRef Suffix = tools::arm::getLLVMArchSuffixForARM(CPU, tools::arm::getARMArch(MArch, Triple)); bool ThumbDefault = Suffix.startswith("v6m") || Suffix.startswith("v7m") || @@ -344,7 +344,7 @@ std::string ToolChain::ComputeLLVMTriple } } -std::string ToolChain::ComputeEffectiveClangTriple(const ArgList &Args, +std::string ToolChain::ComputeEffectiveClangTriple(const ArgList &Args, types::ID InputType) const { return ComputeLLVMTriple(Args, InputType); } @@ -424,10 +424,9 @@ void ToolChain::addExternCSystemIncludeI /*static*/ void ToolChain::addSystemIncludes(const ArgList &DriverArgs, ArgStringList &CC1Args, ArrayRef Paths) { - for (ArrayRef::iterator I = Paths.begin(), E = Paths.end(); - I != E; ++I) { + for (StringRef Path : Paths) { CC1Args.push_back("-internal-isystem"); -CC1Args.push_back(DriverArgs.MakeArgString(*I)); +CC1Args.push_back(DriverArgs.MakeArgString(Path)); } } @@ -496,4 +495,3 @@ SanitizerMask ToolChain::getSupportedSan return (Undefined & ~Vptr & ~Function) | CFI | CFICastStrict | UnsignedIntegerOverflow | LocalBounds; } - ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11572: [Static Analyzer] Checker for OS X / iOS localizability issues
kulpreet updated this revision to Diff 31481. kulpreet marked an inline comment as done. kulpreet added a comment. - By default (non-aggressive mode) the UnlocalizedStringChecker will ignore strings that are less than two characters long to avoid false positives such as @"-" - Added UIAlertView APIs to add coverage to methods that require localized strings. - Added in test case for EmptyLocalizationContext checker to show that it doesn't produce a false positive in the case that Anna pointed out. http://reviews.llvm.org/D11572 Files: lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp test/Analysis/localization-aggressive.m test/Analysis/localization.m Index: test/Analysis/localization.m === --- /dev/null +++ test/Analysis/localization.m @@ -0,0 +1,86 @@ +// RUN: %clang_cc1 -analyze -fblocks -analyzer-store=region -analyzer-checker=alpha.osx.cocoa.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.EmptyLocalizationContextChecker -verify %s + +// The larger set of tests in located in localization.m. These are tests +// specific for non-aggressive reporting. + +// These declarations were reduced using Delta-Debugging from Foundation.h +// on Mac OS X. + +#define nil ((id)0) +#define NSLocalizedString(key, comment)\ + [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil] +#define NSLocalizedStringFromTable(key, tbl, comment) \ + [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)] +#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \ + [bundle localizedStringForKey:(key) value:@"" table:(tbl)] +#define NSLocalizedStringWithDefaultValue(key, tbl, bundle, val, comment) \ + [bundle localizedStringForKey:(key) value:(val) table:(tbl)] +@interface NSObject ++ (id)alloc; +- (id)init; +@end +@interface NSString : NSObject +@end +@interface NSBundle : NSObject ++ (NSBundle *)mainBundle; +- (NSString *)localizedStringForKey:(NSString *)key + value:(NSString *)value + table:(NSString *)tableName; +@end +@interface UILabel : NSObject +@property(nullable, nonatomic, copy) NSString *text; +@end +@interface TestObject : NSObject +@property(strong) NSString *text; +@end + +@interface LocalizationTestSuite : NSObject +int random(); +@end + +// Test cases begin here +@implementation LocalizationTestSuite + +// An object passed in as an parameter's string member +// should not be considered unlocalized +- (void)testObjectAsArgument:(TestObject *)argumentObject { + UILabel *testLabel = [[UILabel alloc] init]; + + [testLabel setText:[argumentObject text]]; // no-warning + [testLabel setText:argumentObject.text]; // no-warning +} + +- (void)testLocalizationErrorDetectedOnPathway { + UILabel *testLabel = [[UILabel alloc] init]; + NSString *bar = NSLocalizedString(@"Hello", @"Comment"); + + if (random()) { +bar = @"Unlocalized string"; + } + + [testLabel setText:bar]; // expected-warning {{String should be localized}} +} + +- (void)testOneCharacterStringsDoNotGiveAWarning { + UILabel *testLabel = [[UILabel alloc] init]; + NSString *bar = NSLocalizedString(@"Hello", @"Comment"); + + if (random()) { +bar = @"-"; + } + + [testLabel setText:bar]; // no-warning +} + +- (void)testOneCharacterUTFStringsDoNotGiveAWarning { + UILabel *testLabel = [[UILabel alloc] init]; + NSString *bar = NSLocalizedString(@"Hello", @"Comment"); + + if (random()) { +bar = @"—"; + } + + [testLabel setText:bar]; // no-warning +} + +@end Index: test/Analysis/localization-aggressive.m === --- /dev/null +++ test/Analysis/localization-aggressive.m @@ -0,0 +1,243 @@ +// RUN: %clang_cc1 -analyze -fblocks -analyzer-store=region -analyzer-checker=alpha.osx.cocoa.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.EmptyLocalizationContextChecker -verify -analyzer-config AggressiveReport=true %s + +// These declarations were reduced using Delta-Debugging from Foundation.h +// on Mac OS X. + +#define nil ((id)0) +#define NSLocalizedString(key, comment)\ + [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil] +#define NSLocalizedStringFromTable(key, tbl, comment) \ + [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)] +#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \ + [bundle localizedStringForKey:(key) value:@"" table:(tbl)] +#define NSLocalizedStringWithDefaultValue(key, tbl, bundle, val, comment) \ + [bundle localizedStringForKey:(key) value:(val) table:(tbl)] +#define CGFLOAT_TYPE double +typedef CGFLOAT_TYPE CGFloat; +struct CGPoint { + CGFloat x; +
Re: [PATCH] D11572: [Static Analyzer] Checker for OS X / iOS localizability issues
kulpreet added a comment. Updated diff to include Anna's suggestions. http://reviews.llvm.org/D11572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
nwilson updated this revision to Diff 31488. nwilson added a comment. Updated Patch based on comments; fix diagnostic spacing and phrasing, add getExceptionSpecRange, check FunctionTypeInfo exists, use PartialDiagnostic, add static_assert test for function concept being treated as noexcept(true) http://reviews.llvm.org/D11789 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DeclSpec.h lib/Parse/ParseDecl.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/DeclSpec.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaType.cpp test/SemaCXX/cxx-concept-declaration.cpp Index: test/SemaCXX/cxx-concept-declaration.cpp === --- test/SemaCXX/cxx-concept-declaration.cpp +++ test/SemaCXX/cxx-concept-declaration.cpp @@ -6,6 +6,9 @@ template concept bool C2 = true; } +template concept bool C3() { return true; } +static_assert(noexcept(C3()), "function concept should be treated as if noexcept(true) specified"); + template concept bool D1(); // expected-error {{function concept declaration must be a definition}} struct B { @@ -23,3 +26,5 @@ template concept bool D6; // expected-error {{variable concept declaration must be initialized}} +template +concept bool D7() throw(int) { return true; } // expected-error {{function concept cannot have exception specification}} Index: lib/Sema/SemaType.cpp === --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -700,7 +700,7 @@ /*VolatileQualifierLoc=*/NoLoc, /*RestrictQualifierLoc=*/NoLoc, /*MutableLoc=*/NoLoc, EST_None, - /*ESpecLoc=*/NoLoc, + /*ESpecRange=*/SourceRange(), /*Exceptions=*/nullptr, /*ExceptionRanges=*/nullptr, /*NumExceptions=*/0, @@ -3833,7 +3833,7 @@ // Exception specs are not allowed in typedefs. Complain, but add it // anyway. if (IsTypedefName && FTI.getExceptionSpecType()) -S.Diag(FTI.getExceptionSpecLoc(), diag::err_exception_spec_in_typedef) +S.Diag(FTI.getExceptionSpecLocBeg(), diag::err_exception_spec_in_typedef) << (D.getContext() == Declarator::AliasDeclContext || D.getContext() == Declarator::AliasTemplateContext); Index: lib/Sema/SemaDecl.cpp === --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -7442,6 +7442,25 @@ NewFD->setInvalidDecl(); } + // C++ Concepts TS [dcl.spec.concept]p1: [...] A function concept shall + // have no exception-specification and is treated as if it were specified + // with noexcept(true) (15.4). [...] + if (const FunctionProtoType *FPT = R->getAs()) { +SourceRange Range; +if (FPT->hasExceptionSpec() && D.isFunctionDeclarator()) { + Range = D.getFunctionTypeInfo().getExceptionSpecRange(); + PartialDiagnostic PD = + PDiag(diag::err_function_concept_exception_spec); + if (Range.isValid()) { +PD << FixItHint::CreateRemoval(Range); + } + Diag(NewFD->getLocation(), PD); + NewFD->setInvalidDecl(); +} else { + Context.adjustExceptionSpec(NewFD, EST_BasicNoexcept); +} + } + // C++ Concepts TS [dcl.spec.concept]p2: Every concept definition is // implicity defined to be a constexpr declaration (implicitly inline) NewFD->setImplicitlyInline(); @@ -11075,7 +11094,7 @@ /*RestrictQualifierLoc=*/NoLoc, /*MutableLoc=*/NoLoc, EST_None, - /*ESpecLoc=*/NoLoc, + /*ESpecRange=*/SourceRange(), /*Exceptions=*/nullptr, /*ExceptionRanges=*/nullptr, /*NumExceptions=*/0, Index: lib/Sema/DeclSpec.cpp === --- lib/Sema/DeclSpec.cpp +++ lib/Sema/DeclSpec.cpp @@ -177,7 +177,7 @@ SourceLocation MutableLoc, ExceptionSpecificationType ESpecType, - SourceLocation ESpecLoc, + SourceRange ESpecRange, ParsedType *Exceptions, SourceRange *ExceptionRanges, unsigned NumExceptions, @@ -212,7 +212,8 @@ I.Fun.RestrictQualifierLoc= RestrictQualifierLoc.getRawEncoding(); I.Fun.MutableLoc = MutableLoc.getRawEncoding(); I.F
Re: [PATCH] D11437: Correct x86_64 fp128 calling convention
chh added a comment. Reid, thanks a lot for fixing my hacks! I tried your new diff 31457 and it worked for Android libm and all my other tests. I am still waiting for some review of the back end changes in http://reviews.llvm.org/D11438. This patch can be submitted now or later with http://reviews.llvm.org/D11438. Would you like to submit this one? http://reviews.llvm.org/D11437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D11824: Make target feature 'arm' cover both 32 and 64 bit architecutres
benlangmuir created this revision. benlangmuir added a reviewer: rsmith. benlangmuir added a subscriber: cfe-commits. benlangmuir set the repository for this revision to rL LLVM. Herald added subscribers: rengolin, aemerson. ... and add aarch32 to specifically refer to the 32-bit ones. Previously, 'arm' meant only 32-bit architectures and there was no way for a module to build with both 32 and 64 bit ARM architectures. Now a module that is intended to work on both architectures can specify requires arm whereas a module only for 32-bit platforms can say requires aarch32 and just like before, 64-bit only can say requires aarch64 Repository: rL LLVM http://reviews.llvm.org/D11824 Files: lib/Basic/Targets.cpp test/Modules/Inputs/module.map test/Modules/compiler_builtins_aarch64.m test/Modules/target-features.m Index: test/Modules/target-features.m === --- /dev/null +++ test/Modules/target-features.m @@ -0,0 +1,61 @@ +// REQUIRES: x86-registered-target +// REQUIRES: arm-registered-target +// REQUIRES: aarch64-registered-target + +// RUN: rm -rf %t + +// Sanity check one of the compilations. +// RUN: %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s -verify -DSANITY_CHECK +// expected-no-diagnostics + +// Check all the targets: +// RUN: not %clang_cc1 -triple armv7-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch32 +// RUN: FileCheck %s -check-prefix=AARCH32 < %t.aarch32 +// RUN: not %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch64 +// RUN: FileCheck %s -check-prefix=AARCH64 < %t.aarch64 +// RUN: not %clang_cc1 -triple i386-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_32 +// RUN: FileCheck %s -check-prefix=X86_32 < %t.x86_32 +// RUN: not %clang_cc1 -triple x86_64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_64 +// RUN: FileCheck %s -check-prefix=X86_64 < %t.x86_64 + +#ifndef SANITY_CHECK +@import TargetFeatures; +// AARCH32-NOT: module 'TargetFeatures' requires +// AARCH64-NOT: module 'TargetFeatures' requires +// X86_32-NOT: module 'TargetFeatures' requires +// X86_64-NOT: module 'TargetFeatures' requires +@import TargetFeatures.arm; +// AARCH32-NOT: module 'TargetFeatures.arm' requires +// AARCH64-NOT: module 'TargetFeatures.arm' requires +// X86_32: module 'TargetFeatures.arm' requires feature 'arm' +// X86_64: module 'TargetFeatures.arm' requires feature 'arm' +@import TargetFeatures.arm.aarch32; +// AARCH32-NOT: module 'TargetFeatures.arm.aarch32' requires +// AARCH64: module 'TargetFeatures.arm.aarch32' requires feature 'aarch32' +// X86_32: module 'TargetFeatures.arm.aarch32' requires feature +// X86_64: module 'TargetFeatures.arm.aarch32' requires feature +#endif + +@import TargetFeatures.arm.aarch64; +// AARCH32: module 'TargetFeatures.arm.aarch64' requires feature 'aarch64' +// AARCH64-NOT: module 'TargetFeatures.arm.aarch64' requires +// X86_32: module 'TargetFeatures.arm.aarch64' requires feature +// X86_64: module 'TargetFeatures.arm.aarch64' requires feature + +#ifndef SANITY_CHECK +@import TargetFeatures.x86; +// AARCH32: module 'TargetFeatures.x86' requires feature 'x86' +// AARCH64: module 'TargetFeatures.x86' requires feature 'x86' +// X86_32-NOT: module 'TargetFeatures.x86' requires +// X86_64-NOT: module 'TargetFeatures.x86' requires +@import TargetFeatures.x86.x86_32; +// AARCH32: module 'TargetFeatures.x86.x86_32' requires feature +// AARCH64: module 'TargetFeatures.x86.x86_32' requires feature +// X86_32-NOT: module 'TargetFeatures.x86.x86_32' requires +// X86_64: module 'TargetFeatures.x86.x86_32' requires feature 'x86_32' +@import TargetFeatures.x86.x86_64; +// AARCH32: module 'TargetFeatures.x86.x86_64' requires feature +// AARCH64: module 'TargetFeatures.x86.x86_64' requires feature +// X86_32: module 'TargetFeatures.x86.x86_64' requires feature 'x86_64' +// X86_64-NOT: module 'TargetFeatures.x86.x86_64' requires +#endif Index: test/Modules/compiler_builtins_aarch64.m === --- /dev/null +++ test/Modules/compiler_builtins_aarch64.m @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fsyntax-only -triple aarch64-unknown-unknown -target-feature +neon -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify %s +// expected-no-diagnostics +// REQUIRES: aarch64-registered-target +@import _Builtin_intrinsics.arm; +@import _Builtin_intrinsics.arm.neon; Index: test/Modules/Inputs/module.map === --- test/Modules/Inputs/module.map +++ test/Mo
Re: [PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
rsmith added inline comments. Comment at: include/clang/Sema/DeclSpec.h:1262 @@ +1261,3 @@ + +/// \brief The end location of the keyword introducing the spec, if any. +unsigned ExceptionSpecLocEnd; Drop bogus "keyword introducing the" here, and drop either the same words from the previous comment or the word "beginning". Comment at: lib/Sema/SemaDecl.cpp:7450 @@ +7449,3 @@ +SourceRange Range; +if (FPT->hasExceptionSpec() && D.isFunctionDeclarator()) { + Range = D.getFunctionTypeInfo().getExceptionSpecRange(); The `D.isFunctionDeclarator()` check should be nested within this, as should the `Range` variable: if (FPT->hasExceptionSpec()) { SourceRange Range; if (D.isFunctionDeclarator()) Range = D.getFunctionTypeInfo().getExceptionSpecRange(); PartialDiagnostic PD = ... Comment at: lib/Sema/SemaDecl.cpp:7454-7456 @@ +7453,5 @@ + PDiag(diag::err_function_concept_exception_spec); + if (Range.isValid()) { +PD << FixItHint::CreateRemoval(Range); + } + Diag(NewFD->getLocation(), PD); You don't need this `if`; a `FixItHint` with an invalid range has no effect. Comment at: test/SemaCXX/cxx-concept-declaration.cpp:9-10 @@ -8,1 +8,4 @@ +template concept bool C3() { return true; } +static_assert(noexcept(C3()), "function concept should be treated as if noexcept(true) specified"); + This isn't quite enough; `noexcept` will also return `true` if the expression is a constant expression. Maybe replace the `return true` with `return (throw 0, true)`. http://reviews.llvm.org/D11789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r244296 - Test commit
Author: tbrethou Date: Thu Aug 6 18:30:28 2015 New Revision: 244296 URL: http://llvm.org/viewvc/llvm-project?rev=244296&view=rev Log: Test commit Modified: libunwind/trunk/CMakeLists.txt Modified: libunwind/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=244296&r1=244295&r2=244296&view=diff == --- libunwind/trunk/CMakeLists.txt (original) +++ libunwind/trunk/CMakeLists.txt Thu Aug 6 18:30:28 2015 @@ -1,5 +1,5 @@ #=== -# Setup Project +# Setup Project #=== cmake_minimum_required(VERSION 2.8.8) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] r244297 - Revert test commit.
Author: tbrethou Date: Thu Aug 6 18:31:37 2015 New Revision: 244297 URL: http://llvm.org/viewvc/llvm-project?rev=244297&view=rev Log: Revert test commit. Modified: libunwind/trunk/CMakeLists.txt Modified: libunwind/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=244297&r1=244296&r2=244297&view=diff == --- libunwind/trunk/CMakeLists.txt (original) +++ libunwind/trunk/CMakeLists.txt Thu Aug 6 18:31:37 2015 @@ -1,5 +1,5 @@ #=== -# Setup Project +# Setup Project #=== cmake_minimum_required(VERSION 2.8.8) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11781: Refactored pthread usage in libcxx
espositofulvio added inline comments. Comment at: include/__mutex_base:19 @@ +18,3 @@ +#ifndef _WIN32 +#include +#endif jroelofs wrote: > I think it might make sense to create a file: `` where the > contents are just: > > ``` > #ifndef _WIN32 > #include > #endif > ``` > > And include that file here so that the platform decision of "which mutex > implementation should we use" doesn't have these #ifndef guards spread > everywhere. > > Maybe you could also add some defines & guards to enforce the idea that > `` is never included directly, but rather only via > ``. > > Same should go for thread.hpp, too. A very good idea indeed. I'll make the change and update the patch. Comment at: include/__mutex_base:246 @@ -266,3 +245,3 @@ -class _LIBCPP_TYPE_VIS condition_variable +class _LIBCPP_TYPE_VIS condition_variable : private __libcxx_support::condition_variable { theraven wrote: > Does this change the ABI for a mutex on *NIX platforms? We can't change the > class layout for existing platforms (though we can indirect things via > typedefs). My hunch is that it doesn't, std::condition_variable has no data member now and the first base class (__libcxx_support::condition_variable) contains only pthread_cond_t which will be effectively laid out at the starting address of the object, as it was previously for std::condition_variable,. I will check this out later in the evening though. Comment at: include/mutex:182 @@ -181,2 +181,3 @@ #endif -#include +#ifndef _WIN32 +#include theraven wrote: > As above, there should probably be in a cross-platform support file that > includes these. In particular, not-win32 is not the correct condition for > uses-pthreads. We should probably have something in __config that determines > the thread library to use. It would be quite nice to have a C11 thread back > end, for example (though most implementations currently wrap pthreads). In this case having a series of #ifdef __FreeBSD__ (or _WIN32, etc.) doesn't quite cut it as we want to be able to select C11 or pthread on most of them and on Windows one day it might even be C11, pthread or the win32 api. I guess the alternative is to provide a cmake variable that default to something different on each platform? Repository: rL LLVM http://reviews.llvm.org/D11781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11781: Refactored pthread usage in libcxx
espositofulvio added inline comments. Comment at: include/__mutex_base:246 @@ -266,3 +245,3 @@ -class _LIBCPP_TYPE_VIS condition_variable +class _LIBCPP_TYPE_VIS condition_variable : private __libcxx_support::condition_variable { theraven wrote: > espositofulvio wrote: > > theraven wrote: > > > Does this change the ABI for a mutex on *NIX platforms? We can't change > > > the class layout for existing platforms (though we can indirect things > > > via typedefs). > > My hunch is that it doesn't, std::condition_variable has no data member now > > and the first base class (__libcxx_support::condition_variable) contains > > only pthread_cond_t which will be effectively laid out at the starting > > address of the object, as it was previously for std::condition_variable,. > > I will check this out later in the evening though. > I *think* that it's correct, but it's worth compiling a program that has one > compilation unit using the old header and another using the new one and check > that it's able to interoperate correctly. > > Also check whether this depends on the implementation of the condition > variable. On FreeBSD, the pthread types are all pointers (currently - we're > going to have some painful ABI breakage at some point when we move them to > being something that can live in shared memory). In glibc, they're > structures. I don't think that you'll end up with different padding in the > ABI from wrapping them in a class, but it's worth checking. > it's worth compiling a program that has one compilation unit using the old > header and another using the new one and check that it's able to interoperate > correctly Unfortunately this isn't going to work, some simbols are now defined in __libcxx_support and not in std (they are just made available through using), so an object file that includes the old header won't link against the new library (unreferenced symbols). The alternative is to create inline forwarding methods. Repository: rL LLVM http://reviews.llvm.org/D11781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11824: Make target feature 'arm' cover both 32 and 64 bit architecutres
benlangmuir added inline comments. Comment at: lib/Basic/Targets.cpp:4552 @@ -4551,2 +4551,3 @@ .Case("arm", true) +.Case("aarch32", true) .Case("softfloat", SoftFloat) rsmith wrote: > Should we also recognize "arm32" to better mirror the 64-bit case? Kristof convinced me it was better to stick with aarch32 since it had a defined meaning unlike arm32 (and unlike arm64 there is no compatibility or historical reason for it). Repository: rL LLVM http://reviews.llvm.org/D11824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11824: Make target feature 'arm' cover both 32 and 64 bit architecutres
On Thu, Aug 6, 2015 at 4:49 PM, Ben Langmuir wrote: > benlangmuir added inline comments. > > > Comment at: lib/Basic/Targets.cpp:4552 > @@ -4551,2 +4551,3 @@ > .Case("arm", true) > +.Case("aarch32", true) > .Case("softfloat", SoftFloat) > > rsmith wrote: > > Should we also recognize "arm32" to better mirror the 64-bit case? > Kristof convinced me it was better to stick with aarch32 since it had a > defined meaning unlike arm32 (and unlike arm64 there is no compatibility or > historical reason for it). OK, SGTM ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244306 - Make 'arm' cover both 32 and 64 bit architecutres
Author: benlangmuir Date: Thu Aug 6 20:59:56 2015 New Revision: 244306 URL: http://llvm.org/viewvc/llvm-project?rev=244306&view=rev Log: Make 'arm' cover both 32 and 64 bit architecutres ... and add aarch32 to specifically refer to the 32-bit ones. Previously, 'arm' meant only 32-bit architectures and there was no way for a module to build with both 32 and 64 bit ARM architectures. Now a module that is intended to work on both architectures can specify requires arm whereas a module only for 32-bit platforms can say requires aarch32 and just like before, 64-bit only can say requires aarch64 Added: cfe/trunk/test/Modules/compiler_builtins_aarch64.m cfe/trunk/test/Modules/target-features.m Modified: cfe/trunk/lib/Basic/Targets.cpp cfe/trunk/test/Modules/Inputs/module.map Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244306&r1=244305&r2=244306&view=diff == --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 6 20:59:56 2015 @@ -4551,6 +4551,7 @@ public: bool hasFeature(StringRef Feature) const override { return llvm::StringSwitch(Feature) .Case("arm", true) +.Case("aarch32", true) .Case("softfloat", SoftFloat) .Case("thumb", isThumb()) .Case("neon", (FPU & NeonFPU) && !SoftFloat) @@ -5198,6 +5199,7 @@ public: bool hasFeature(StringRef Feature) const override { return Feature == "aarch64" || Feature == "arm64" || + Feature == "arm" || (Feature == "neon" && FPU == NeonMode); } Modified: cfe/trunk/test/Modules/Inputs/module.map URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=244306&r1=244305&r2=244306&view=diff == --- cfe/trunk/test/Modules/Inputs/module.map (original) +++ cfe/trunk/test/Modules/Inputs/module.map Thu Aug 6 20:59:56 2015 @@ -347,3 +347,16 @@ module RequiresWithMissingHeader { header "RequiresWithMissingHeader-Missing2.h" } } + +module TargetFeatures { + module arm { +requires arm +module aarch32 { requires aarch32 } +module aarch64 { requires aarch64 } + } + module x86 { +requires x86 +module x86_32 { requires x86_32 } +module x86_64 { requires x86_64 } + } +} Added: cfe/trunk/test/Modules/compiler_builtins_aarch64.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins_aarch64.m?rev=244306&view=auto == --- cfe/trunk/test/Modules/compiler_builtins_aarch64.m (added) +++ cfe/trunk/test/Modules/compiler_builtins_aarch64.m Thu Aug 6 20:59:56 2015 @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fsyntax-only -triple aarch64-unknown-unknown -target-feature +neon -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify %s +// expected-no-diagnostics +// REQUIRES: aarch64-registered-target +@import _Builtin_intrinsics.arm; +@import _Builtin_intrinsics.arm.neon; Added: cfe/trunk/test/Modules/target-features.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/target-features.m?rev=244306&view=auto == --- cfe/trunk/test/Modules/target-features.m (added) +++ cfe/trunk/test/Modules/target-features.m Thu Aug 6 20:59:56 2015 @@ -0,0 +1,61 @@ +// REQUIRES: x86-registered-target +// REQUIRES: arm-registered-target +// REQUIRES: aarch64-registered-target + +// RUN: rm -rf %t + +// Sanity check one of the compilations. +// RUN: %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s -verify -DSANITY_CHECK +// expected-no-diagnostics + +// Check all the targets: +// RUN: not %clang_cc1 -triple armv7-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch32 +// RUN: FileCheck %s -check-prefix=AARCH32 < %t.aarch32 +// RUN: not %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch64 +// RUN: FileCheck %s -check-prefix=AARCH64 < %t.aarch64 +// RUN: not %clang_cc1 -triple i386-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_32 +// RUN: FileCheck %s -check-prefix=X86_32 < %t.x86_32 +// RUN: not %clang_cc1 -triple x86_64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_64 +// RUN: FileCheck %s -check-prefix=X86_64 < %t.x86_64 + +#ifndef SANITY_CHECK +@import TargetFeatures; +// AARCH32-NOT: module 'TargetFeatures' requires +// AARCH64-NOT: module 'TargetFeatures' requires +// X86_32-NOT: module 'Targe
Re: [PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
nwilson added inline comments. Comment at: lib/Sema/SemaDecl.cpp:7454-7456 @@ +7453,5 @@ + PDiag(diag::err_function_concept_exception_spec); + if (Range.isValid()) { +PD << FixItHint::CreateRemoval(Range); + } + Diag(NewFD->getLocation(), PD); rsmith wrote: > You don't need this `if`; a `FixItHint` with an invalid range has no effect. Ahhh, okay. I misunderstood the original comment about an empty SourceRange apparently. I'll go back to using Diagnostic rather than PartialDiagnostic as well. http://reviews.llvm.org/D11789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
nwilson added inline comments. Comment at: include/clang/Sema/DeclSpec.h:1262 @@ -1260,1 +1261,3 @@ +/// \brief The end location of the exception specifier, if any. +unsigned ExceptionSpecLocEnd; Please let me know if there is still an issue with the wording here. http://reviews.llvm.org/D11789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11824: Make target feature 'arm' cover both 32 and 64 bit architecutres
benlangmuir closed this revision. benlangmuir added a comment. r244306 Repository: rL LLVM http://reviews.llvm.org/D11824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r244307 - Make sure the Features field of the Builtin Info struct is always initialized. Silences -Wmissing-field-initializers.
Author: ctopper Date: Fri Aug 7 00:14:44 2015 New Revision: 244307 URL: http://llvm.org/viewvc/llvm-project?rev=244307&view=rev Log: Make sure the Features field of the Builtin Info struct is always initialized. Silences -Wmissing-field-initializers. While there convert 0 in the BUILTIN macros to nullptr. Modified: cfe/trunk/lib/Basic/Builtins.cpp cfe/trunk/lib/Basic/Targets.cpp Modified: cfe/trunk/lib/Basic/Builtins.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Builtins.cpp?rev=244307&r1=244306&r2=244307&view=diff == --- cfe/trunk/lib/Basic/Builtins.cpp (original) +++ cfe/trunk/lib/Basic/Builtins.cpp Fri Aug 7 00:14:44 2015 @@ -19,14 +19,13 @@ using namespace clang; static const Builtin::Info BuiltinInfo[] = { - { "not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES}, -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, + { "not a builtin function", nullptr, nullptr, nullptr, ALL_LANGUAGES,nullptr}, +#define BUILTIN(ID, TYPE, ATTRS) \ + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr }, #define LANGBUILTIN(ID, TYPE, ATTRS, LANGS) \ - { #ID, TYPE, ATTRS, 0, LANGS } \ - , + { #ID, TYPE, ATTRS, nullptr, LANGS, nullptr }, #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, LANGS) \ - { #ID, TYPE, ATTRS, HEADER, LANGS } \ - , + { #ID, TYPE, ATTRS, HEADER, LANGS, nullptr }, #include "clang/Basic/Builtins.def" }; Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244307&r1=244306&r2=244307&view=diff == --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Fri Aug 7 00:14:44 2015 @@ -1009,9 +1009,10 @@ public: }; const Builtin::Info PPCTargetInfo::BuiltinInfo[] = { -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ - ALL_LANGUAGES }, +#define BUILTIN(ID, TYPE, ATTRS) \ + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr }, +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr }, #include "clang/Basic/BuiltinsPPC.def" }; @@ -1682,9 +1683,10 @@ public: }; const Builtin::Info NVPTXTargetInfo::BuiltinInfo[] = { -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ - ALL_LANGUAGES }, +#define BUILTIN(ID, TYPE, ATTRS) \ +{ #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr }, +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ +{ #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr }, #include "clang/Basic/BuiltinsNVPTX.def" }; @@ -1936,7 +1938,7 @@ public: const Builtin::Info AMDGPUTargetInfo::BuiltinInfo[] = { #define BUILTIN(ID, TYPE, ATTRS)\ - { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr }, #include "clang/Basic/BuiltinsAMDGPU.def" }; const char * const AMDGPUTargetInfo::GCCRegNames[] = { @@ -2000,11 +2002,12 @@ void AMDGPUTargetInfo::getGCCRegNames(co // Namespace for x86 abstract base class const Builtin::Info BuiltinInfo[] = { -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, +#define BUILTIN(ID, TYPE, ATTRS) \ + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr }, #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ - { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES }, + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr }, #define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \ - { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE }, + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, FEATURE }, #include "clang/Basic/BuiltinsX86.def" }; @@ -4886,15 +4889,18 @@ void ARMTargetInfo::getGCCRegAliases(con } const Builtin::Info ARMTargetInfo::BuiltinInfo[] = { -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ - ALL_LANGUAGES }, +#define BUILTIN(ID, TYPE, ATTRS) \ + { #ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr}, +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \ + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr }, #include "clang/Basic/BuiltinsNEON.def" -#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, -#define LANGBUILTIN(ID, TYPE, ATTRS, LANG) { #ID, TYPE, ATTRS, 0, LAN
Re: r244286 - Continue the work from r243908 by adding a Features field to Builtin::Info
This was causing -Wmissing-field-initializers to fire due to Features not being assigned in BUILTIN or LIBBUILTIN macro expansions. Fixed it in r244307. On Thu, Aug 6, 2015 at 3:11 PM, Eric Christopher via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: echristo > Date: Thu Aug 6 17:11:54 2015 > New Revision: 244286 > > URL: http://llvm.org/viewvc/llvm-project?rev=244286&view=rev > Log: > Continue the work from r243908 by adding a Features field to Builtin::Info > so that we can populate it on a per-target basis with required features. > > Future commits will start using this information for warnings. > > Modified: > cfe/trunk/include/clang/Basic/Builtins.h > cfe/trunk/lib/Basic/Targets.cpp > > Modified: cfe/trunk/include/clang/Basic/Builtins.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244286&r1=244285&r2=244286&view=diff > > == > --- cfe/trunk/include/clang/Basic/Builtins.h (original) > +++ cfe/trunk/include/clang/Basic/Builtins.h Thu Aug 6 17:11:54 2015 > @@ -51,6 +51,7 @@ enum ID { > struct Info { >const char *Name, *Type, *Attributes, *HeaderName; >LanguageID Langs; > + const char *Features; > }; > > /// \brief Holds information about both target-independent and > @@ -166,6 +167,10 @@ public: > return strchr(getRecord(ID).Attributes, 'e') != nullptr; >} > > + const char *getRequiredFeatures(unsigned ID) const { > +return getRecord(ID).Features; > + } > + > private: >const Info &getRecord(unsigned ID) const; > > > Modified: cfe/trunk/lib/Basic/Targets.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244286&r1=244285&r2=244286&view=diff > > == > --- cfe/trunk/lib/Basic/Targets.cpp (original) > +++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 6 17:11:54 2015 > @@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(co > // Namespace for x86 abstract base class > const Builtin::Info BuiltinInfo[] = { > #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, > -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ > - ALL_LANGUAGES }, > +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) > \ > + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES }, > +#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) > \ > + { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE }, > #include "clang/Basic/BuiltinsX86.def" > }; > > > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > -- ~Craig ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r244286 - Continue the work from r243908 by adding a Features field to Builtin::Info
Ah thanks Craig. Perhaps we should turn that one on by default? On Thu, Aug 6, 2015, 10:17 PM Craig Topper wrote: > This was causing -Wmissing-field-initializers to fire due to Features not > being assigned in BUILTIN or LIBBUILTIN macro expansions. Fixed it in > r244307. > > On Thu, Aug 6, 2015 at 3:11 PM, Eric Christopher via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: echristo >> Date: Thu Aug 6 17:11:54 2015 >> New Revision: 244286 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=244286&view=rev >> Log: >> Continue the work from r243908 by adding a Features field to Builtin::Info >> so that we can populate it on a per-target basis with required features. >> >> Future commits will start using this information for warnings. >> >> Modified: >> cfe/trunk/include/clang/Basic/Builtins.h >> cfe/trunk/lib/Basic/Targets.cpp >> >> Modified: cfe/trunk/include/clang/Basic/Builtins.h >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244286&r1=244285&r2=244286&view=diff >> >> == >> --- cfe/trunk/include/clang/Basic/Builtins.h (original) >> +++ cfe/trunk/include/clang/Basic/Builtins.h Thu Aug 6 17:11:54 2015 >> @@ -51,6 +51,7 @@ enum ID { >> struct Info { >>const char *Name, *Type, *Attributes, *HeaderName; >>LanguageID Langs; >> + const char *Features; >> }; >> >> /// \brief Holds information about both target-independent and >> @@ -166,6 +167,10 @@ public: >> return strchr(getRecord(ID).Attributes, 'e') != nullptr; >>} >> >> + const char *getRequiredFeatures(unsigned ID) const { >> +return getRecord(ID).Features; >> + } >> + >> private: >>const Info &getRecord(unsigned ID) const; >> >> >> Modified: cfe/trunk/lib/Basic/Targets.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244286&r1=244285&r2=244286&view=diff >> >> == >> --- cfe/trunk/lib/Basic/Targets.cpp (original) >> +++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 6 17:11:54 2015 >> @@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(co >> // Namespace for x86 abstract base class >> const Builtin::Info BuiltinInfo[] = { >> #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, >> -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ >> - ALL_LANGUAGES }, >> +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) >> \ >> + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES }, >> +#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) >>\ >> + { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE }, >> #include "clang/Basic/BuiltinsX86.def" >> }; >> >> >> >> ___ >> cfe-commits mailing list >> cfe-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >> > > > > -- > ~Craig > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r244286 - Continue the work from r243908 by adding a Features field to Builtin::Info
I think it is on by default for clang builds # Turn off missing field initializer warnings for gcc to avoid noise from # false positives with empty {}. Turn them on otherwise (they're off by # default for clang). check_cxx_compiler_flag("-Wmissing-field-initializers" CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG) if (CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG) if (CMAKE_COMPILER_IS_GNUCXX) append("-Wno-missing-field-initializers" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) else() append("-Wmissing-field-initializers" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() endif() On Thu, Aug 6, 2015 at 10:35 PM, Eric Christopher wrote: > Ah thanks Craig. Perhaps we should turn that one on by default? > > On Thu, Aug 6, 2015, 10:17 PM Craig Topper wrote: > >> This was causing -Wmissing-field-initializers to fire due to Features not >> being assigned in BUILTIN or LIBBUILTIN macro expansions. Fixed it in >> r244307. >> >> On Thu, Aug 6, 2015 at 3:11 PM, Eric Christopher via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> Author: echristo >>> Date: Thu Aug 6 17:11:54 2015 >>> New Revision: 244286 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=244286&view=rev >>> Log: >>> Continue the work from r243908 by adding a Features field to >>> Builtin::Info >>> so that we can populate it on a per-target basis with required features. >>> >>> Future commits will start using this information for warnings. >>> >>> Modified: >>> cfe/trunk/include/clang/Basic/Builtins.h >>> cfe/trunk/lib/Basic/Targets.cpp >>> >>> Modified: cfe/trunk/include/clang/Basic/Builtins.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.h?rev=244286&r1=244285&r2=244286&view=diff >>> >>> == >>> --- cfe/trunk/include/clang/Basic/Builtins.h (original) >>> +++ cfe/trunk/include/clang/Basic/Builtins.h Thu Aug 6 17:11:54 2015 >>> @@ -51,6 +51,7 @@ enum ID { >>> struct Info { >>>const char *Name, *Type, *Attributes, *HeaderName; >>>LanguageID Langs; >>> + const char *Features; >>> }; >>> >>> /// \brief Holds information about both target-independent and >>> @@ -166,6 +167,10 @@ public: >>> return strchr(getRecord(ID).Attributes, 'e') != nullptr; >>>} >>> >>> + const char *getRequiredFeatures(unsigned ID) const { >>> +return getRecord(ID).Features; >>> + } >>> + >>> private: >>>const Info &getRecord(unsigned ID) const; >>> >>> >>> Modified: cfe/trunk/lib/Basic/Targets.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244286&r1=244285&r2=244286&view=diff >>> >>> == >>> --- cfe/trunk/lib/Basic/Targets.cpp (original) >>> +++ cfe/trunk/lib/Basic/Targets.cpp Thu Aug 6 17:11:54 2015 >>> @@ -2001,8 +2001,10 @@ void AMDGPUTargetInfo::getGCCRegNames(co >>> // Namespace for x86 abstract base class >>> const Builtin::Info BuiltinInfo[] = { >>> #define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES }, >>> -#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) { #ID, TYPE, ATTRS, HEADER,\ >>> - ALL_LANGUAGES }, >>> +#define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) >>> \ >>> + { #ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES }, >>> +#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) >>>\ >>> + { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES, FEATURE }, >>> #include "clang/Basic/BuiltinsX86.def" >>> }; >>> >>> >>> >>> ___ >>> cfe-commits mailing list >>> cfe-commits@lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >>> >> >> >> >> -- >> ~Craig >> > -- ~Craig ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11572: [Static Analyzer] Checker for OS X / iOS localizability issues
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Thank you! LGTM. I'll commit this tomorrow. http://reviews.llvm.org/D11572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits