summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Fix an edge case with BinaryOperator's in -Wuninitialized. Add testcases forRichard Trieu2014-09-242-2/+20
| | | | | | the other visitors as well. llvm-svn: 218366
* Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.Nico Weber2014-09-244-6/+168
| | | | | | | | | r218292 reverted r197496 because it broke things. In addition to breaking things, r197496 also made all traits starting with __is_ revertible. Reinstantiate that part of r197496 because code out there (e.g. libc++) depends on this behavior. Fixes PR21045. llvm-svn: 218365
* MS ABI: Pure virtual functions don't contribute to vtordispsDavid Majnemer2014-09-232-14/+39
| | | | | | | | | | | Usually, overriding a virtual function defined in a virtual base required emission of a vtordisp slot in the record. However no vtordisp is needed if the overriding function is pure; it should be impossible to observe the pure virtual method. This fixes PR21046. llvm-svn: 218340
* Improve -Wuninitialized to take into account field ordering with initializerRichard Trieu2014-09-234-4/+142
| | | | | | | lists. Since the fields are inititalized one at a time, using a field with lower index to initialize a higher indexed field should not be warned on. llvm-svn: 218339
* PR18793: If we try to EnterTokenStream when our current lexer is a cachingRichard Smith2014-09-233-0/+25
| | | | | | | | | lexer, add the token buffer underneath the caching lexer where possible and push the tokens directly into the caching lexer otherwise. We previously put the lexer into a corrupted state where we could not guarantee to provide the tokens in the right order and would sometimes assert. llvm-svn: 218333
* Don't perform ADL when looking up operator=; there is no non-member form ofRichard Smith2014-09-234-9/+24
| | | | | | | | | that function, and apart from being slow, this is unnecessary: ADL can trigger instantiations that are not permitted here. The standard isn't *completely* clear here, but this seems like the intent, and in any case this approach is permitted by [temp.inst]p7. llvm-svn: 218330
* Revert "Don't use comdats for initializers on platforms that don't support it"Reid Kleckner2014-09-236-21/+5
| | | | | | | | | On further investigation, COMDATs should work with .ctors, and the issue I was hitting probably reproduces with .init_array. This reverts commit r218287. llvm-svn: 218313
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-2342-10/+4162
| | | | llvm-svn: 218299
* [mips] Fix r218248's testcase to use -O1 instead of -O3.Daniel Sanders2014-09-231-3/+3
| | | | llvm-svn: 218298
* Reverting r214064 and r215650 while investigating a pesky performance regressionArtyom Skrobov2014-09-239-216/+138
| | | | llvm-svn: 218296
* Fix a typo in comment in ASTBitCodes.hAlexander Musman2014-09-231-1/+1
| | | | llvm-svn: 218294
* AST: Mangle cast expression encoding more accuratelyDavid Majnemer2014-09-232-9/+45
| | | | | | | | | | | Don't mangle all casts in expressions as "cv", use the appropriate encoding which corresponds to a specific cast. This fixes PR21034. Differential Revision: http://reviews.llvm.org/D5453 llvm-svn: 218293
* Revert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.Nico Weber2014-09-236-51/+85
| | | | | | Also add a test to make sure that this doesn't break again. Fixes PR21036. llvm-svn: 218292
* Attempt to fix Sema/builtin-object-size.c after r218258Hans Wennborg2014-09-231-1/+1
| | | | | | The type of size_t varies between targets. llvm-svn: 218288
* Don't use comdats for initializers on platforms that don't support itReid Kleckner2014-09-236-5/+21
| | | | | | | | | In particular, pre-.init_array ELF uses the .ctors section mechanism. MinGW COFF also uses .ctors, now that I think about it. Therefore, restrict this optimization to the two platforms that are currently known to work: ELF with .init_array and COFF with .CRT$XCU. llvm-svn: 218287
* Fix a vftable mangling bugReid Kleckner2014-09-222-19/+95
| | | | | | | | | | | | | We need to walk the class hierarchy twice: once in depth-first base specifier order for mangling and again in depth-first layout order for vftable layout. Vftable layout seems to depend on the full path from the most derived class to the base containing the vfptr. Fixes PR21031. llvm-svn: 218285
* ms-inline-asm: Add a test case for the usage of labels in bracket expressionsEhsan Akhgari2014-09-221-0/+9
| | | | | | | | | | | | Summary: This is a test for this patch: http://reviews.llvm.org/D5445. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5446 llvm-svn: 218271
* MS ABI: Remove a FIXME that has been fixedDavid Majnemer2014-09-221-4/+3
| | | | | | We've implemented MSVC-style RTTI for quite some time. llvm-svn: 218269
* Return true from UnifySection when emitting a diagnosticEhsan Akhgari2014-09-221-1/+1
| | | | | | | | | | | | Test Plan: I noticed this through code inspection. The callers use the return value to remove the SectionAttr if a diagnostic is emitted, but I don't think the failure to do so is observable right now. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5438 llvm-svn: 218265
* Fix test/CodeGen/mips-varargs.c to use %clang_cc1Kaelyn Takata2014-09-221-3/+3
| | | | | | | Only tests under test/Driver should use %clang, and test/CodeGen in particular must always use %clang_cc1. llvm-svn: 218260
* Fix evatuated value of __builtin_object_size according to itsFariborz Jahanian2014-09-222-2/+31
| | | | | | | 'type' argument when it cannot be determined which objects ptr points to at compile time. rdar://18334276 llvm-svn: 218258
* clang/test/CodeGen/mips-varargs.c: Fixup for -Asserts.NAKAMURA Takumi2014-09-221-21/+20
| | | | llvm-svn: 218256
* [mips] Correct alignment of vectors passed in varargs for the O32 ABI.Daniel Sanders2014-09-222-1/+55
| | | | | | | | | | | | | | | | | | | Summary: Vectors are normally 16-byte aligned, however the O32 ABI enforces a maximum alignment of 8-bytes since the base of the stack is 8-byte aligned. Previously, this was enforced on the caller side, but not on the callee side. This fixes the output of OpenCL's printf when given vectors. Reviewers: atanasyan Reviewed By: atanasyan Subscribers: llvm-commits, pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D5433 llvm-svn: 218248
* removed unicode symbols from comments.Alexey Bataev2014-09-222-13/+13
| | | | llvm-svn: 218244
* [OPENMP] Codegen for 'omp critical' directive.Alexey Bataev2014-09-224-5/+156
| | | | | | | | | | | This patch adds codegen for constructs: #pragma omp critical [name] <body> It generates global variable ".gomp_critical_user_[name].var" of type int32[8]. Then it generates library call "kmpc_critical(loc, gtid, .gomp_critical_user_[name].var)", code for <body> statement and final call "kmpc_end_critical(loc, gtid, .gomp_critical_user_[name].var)". Differential Revision: http://reviews.llvm.org/D5202 llvm-svn: 218239
* Add some documentation stating that the memory allocated by the ASTContext.h ↵Ehsan Akhgari2014-09-221-6/+6
| | | | | | | | | | | | placement new does not need to be explicitly freed Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5392 llvm-svn: 218232
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-2215-24/+205
| | | | | | | | | | | | | | | | Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
* Fix bugs in cpuid.h.Akira Hatanaka2014-09-202-15/+31
| | | | | | | | | | | | | | | This commit makes two changes: - Remove the push and pop instructions that were saving and restoring %ebx before and after cpuid in 32-bit pic mode. We were doing this to ensure we don't lose the GOT address in pic register %ebx, but this isn't necessary because the GOT address is kept in a virtual register. - In 64-bit mode, preserve base register %rbx around cpuid. This fixes PR20311 and rdar://problem/17686779. llvm-svn: 218173
* Follow-up to r214408: Warn on other callee-cleanup functions without ↵Nico Weber2014-09-196-11/+46
| | | | | | | | | | | | | | | | | | prototype too. According to lore, we used to verifier-fail on: void __thiscall f(); int main() { f(1); } So that's fixed now. System headers use prototype-less __stdcall functions, so make that a warning that's DefaultError -- then it fires on regular code but is suppressed in system headers. Since it's used in system headers, we have codegen tests for this; massage them slightly so that they still compile. llvm-svn: 218166
* Fix ctor/dtor aliases losing 'dllexport' (for Itanium ABI)Dario Domizioli2014-09-194-1/+35
| | | | | | | This patch makes sure that the dllexport attribute is transferred to the alias when such alias is created. It only affects the Itanium ABI because for the MSVC ABI a workaround is in place to not generate aliases of dllexport ctors/dtors. A new CodeGenModule function is provided, CodeGenModule::setAliasAttributes, to factor the code for transferring attributes to aliases. llvm-svn: 218159
* In the Itanium ABI, move stuff to the comdat of variables with static init.Rafael Espindola2014-09-193-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang can already handle ------------------------------------------- struct S { static const int x; }; template<typename T> struct U { static const int k; }; template<typename T> const int U<T>::k = T::x; const int S::x = 42; extern const int *f(); const int *g() { return &U<S>::k; } int main() { return *f() + U<S>::k; } const int *f() { return &U<S>::k; } ------------------------------------------- since r217264 which puts the .inint_array section in the same COMDAT as the variable. This patch allows the linker to more easily delete some dead code and data by putting the guard variable and init function in the same COMDAT. This is a fixed version of r218089. llvm-svn: 218141
* Silence MSVC warnings from r218127 about not returning a valueReid Kleckner2014-09-191-0/+3
| | | | llvm-svn: 218128
* Make DynTypedNode have the dynamic type of the object, instead of its static ↵Samuel Benzaquen2014-09-192-1/+36
| | | | | | | | | | | | | | | | type. Summary: Make DynTypedNode have the dynamic type of the object, instead of its static type. Some optimizations that are in the works require that the nodes have the right type. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5411 llvm-svn: 218127
* Silence a signed/unsigned mismatch warning from MSVC; NFC.Aaron Ballman2014-09-191-1/+1
| | | | llvm-svn: 218121
* clang-format: [JS] add space before operator 'in'.Daniel Jasper2014-09-192-0/+4
| | | | | | | | | | Before: return ('aaa')in bbbb; After: return ('aaa') in bbbb; llvm-svn: 218119
* [x86] Add _addcarry_u{32|64} and _subborrow_u{32|64}.Robert Khasanov2014-09-193-0/+69
| | | | | | | | They are added to adxintrin.h but outside __ADX__ block. These intrinics generates adc and sbb correspondingly that were available before ADX llvm-svn: 218118
* [x86] Added _addcarryx_u32, _addcarryx_u64 intrinsicsRobert Khasanov2014-09-195-0/+75
| | | | llvm-svn: 218117
* [x86] Enable broadwell target in clang.Robert Khasanov2014-09-194-5/+111
| | | | | | Added -madx option llvm-svn: 218116
* clang-format: Prevent column layout if elements aren't uniform enough.Daniel Jasper2014-09-192-11/+15
| | | | | | | | | | | | | | | | | | | | | | | This patch only considers the difference between the length of the shortest and longest element, but we might want to look at other features (token count, etc.) in future. Before: std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{ aaaaaaa, aaaaaaaaaa, aaaaa, aaaaaaaaaaaaaaa, aaa, aaaaaaaaaa, a, aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa, aaaaaaa, a}; After: std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{ aaaaaaa, aaaaaaaaaa, aaaaa, aaaaaaaaaaaaaaa, aaa, aaaaaaaaaa, a, aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa, aaaaaaa, a}; llvm-svn: 218111
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-1927-39/+783
| | | | llvm-svn: 218110
* clang-format: Undo r216377.Daniel Jasper2014-09-192-8/+4
| | | | | | It has proven to not be a food idea in many case. llvm-svn: 218107
* Don't use the third field of llvm.global_ctors for MachO.Rafael Espindola2014-09-194-55/+84
| | | | | | | | | | The field is defined as: If the third field is present, non-null, and points to a global variable or function, the initializer function will only run if the associated data from the current module is not discarded. And without COMDATs we can't implement that. llvm-svn: 218097
* Revert "Put more stuff in the comdat used for variables with static init."Rafael Espindola2014-09-195-32/+3
| | | | | | | This reverts commit r218089. It looks like it was causing issues on COFF. llvm-svn: 218094
* Put more stuff in the comdat used for variables with static init.Rafael Espindola2014-09-185-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang can already handle ------------------------------------------- struct S { static const int x; }; template<typename T> struct U { static const int k; }; template<typename T> const int U<T>::k = T::x; const int S::x = 42; extern const int *f(); const int *g() { return &U<S>::k; } int main() { return *f() + U<S>::k; } const int *f() { return &U<S>::k; } ------------------------------------------- since r217264 which puts the .inint_array section in the same COMDAT as the variable. This patch allows the linker to more easily delete some dead code and data by putting the guard variable and init function in the same COMDAT. llvm-svn: 218089
* Thread Safety Analysis: add new warning flag, -Wthread-safety-reference, whichDeLesley Hutchins2014-09-186-19/+226
| | | | | | | | warns when a guarded variable is passed by reference as a function argument. This is released as a separate warning flag, because it could potentially break existing code that uses thread safety analysis. llvm-svn: 218087
* MS ABI: Don't ICE for pointers to pointers to members of incomplete classesDavid Majnemer2014-09-186-20/+47
| | | | | | | | | | | | | | | | | | | CodeGen would try to come up with an LLVM IR type for a pointer to member type on the way to forming an LLVM IR type for a pointer to pointer to member type. However, if the pointer to member representation has not been locked in yet, we would not be able to come up with a pointer to member IR type. In these cases, make the pointer to member type an incomplete type. This will make the pointer to pointer to member type a pointer to an incomplete type. If the class eventually obtains an inheritance model, we will make the pointer to member type represent the actual inheritance model. Differential Revision: http://reviews.llvm.org/D5373 llvm-svn: 218084
* [X86, inlineasm] Do not allow using constraint 'x' for a variable larger thanAkira Hatanaka2014-09-182-3/+11
| | | | | | | | 128-bit unless the target CPU supports AVX. rdar://problem/11846140 llvm-svn: 218082
* [X86, inline-asm] Allow 256-bit wide operands for the 'x' constraintsHans Wennborg2014-09-182-1/+8
| | | | | | | The 'x' constraint is for "any SSE register", and GCC seems to include the 256-bit ymm registers in that concept. llvm-svn: 218073
* [X86, inlineasm] Check that the output size is correct for the given constraint.Akira Hatanaka2014-09-186-5/+60
| | | | llvm-svn: 218064
* Patch to check at compile time for overflow whenFariborz Jahanian2014-09-186-7/+80
| | | | | | | | __builtin___memcpy_chk and similar builtins are being used. Patch by Jacques Fortier (with added clang tests). rdar://11076881 llvm-svn: 218063
OpenPOWER on IntegriCloud