summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that all module build failures get diagnosedBen Langmuir2014-09-261-2/+11
| | | | | | | | Otherwise we can end up silently skipping an import. If we happen to be building another module at the time, we may build a mysteriously broken module and not know why it seems to be missing symbols. llvm-svn: 218552
* Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.Alexey Samsonov2014-09-261-0/+4
| | | | | | | | | | | It makes no sense to link in sanitizer runtimes in this case: the user probably doesn't want to see any system/toolchain libs in his link if he provides these flags, and the link will most likely fail anyway - as sanitizer runtimes depend on libpthread, libdl, libc etc. Also, see discussion in https://code.google.com/p/address-sanitizer/issues/detail?id=344 llvm-svn: 218541
* Fix an assertion failure trying to emit a trivial destructor in ObjC++Ben Langmuir2014-09-261-20/+14
| | | | | | | | | | | | | | | | | | If a base class declares a destructor, we will add the implicit destructor for the subclass in ActOnFields -> AddImplicitlyDeclaredMembersToClass But in Objective C++, we did not compute whether we have a trivial destructor until after that in CXXRecordDecl::completeDefinition() This was leading to a mismatch between the class, which thought it had no trivial destructor, and the CXXDestructorDecl, which considered itself trivial. It turns out the reason we delayed setting this until completeDefinition() was for a warning that has since been removed as part of -Warc-abi, so we just do it eagerly now. llvm-svn: 218520
* MS ABI: Assert that vftables should have a non-RTTI entryDavid Majnemer2014-09-261-1/+2
| | | | | | No functional change intended. llvm-svn: 218506
* Small fix for bug 18635.Alexander Musman2014-09-261-7/+8
| | | | | | | | (clang crashed in CodeGen in llvm::Module::getNamedValue on thread_local std::unique_ptr<int>). Differential Revision: http://reviews.llvm.org/D5353 llvm-svn: 218503
* Support the assume_aligned function attributeHal Finkel2014-09-264-63/+177
| | | | | | | | | In addition to __builtin_assume_aligned, GCC also supports an assume_aligned attribute which specifies the alignment (and optional offset) of a function's return value. Here we implement support for the assume_aligned attribute by making use of the @llvm.assume intrinsic. llvm-svn: 218500
* CGBuiltin: Use frem instruction rather than libcall to implement fmodJan Vesely2014-09-261-0/+8
| | | | | | | | AFAICT the semantics of frem match libm's fmod. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 218488
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-2621-26/+224
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* Fix PR20886 - enforce CUDA target match in method callsEli Bendersky2014-09-251-0/+21
| | | | | | http://reviews.llvm.org/D5298 llvm-svn: 218482
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-251-6/+36
| | | | llvm-svn: 218468
* Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into ↵Ben Langmuir2014-09-251-5/+30
| | | | | | | | | DefineImplicit* This fixes an assertion failure in CodeGen where we were not resolving an exception specification. llvm-svn: 218466
* MS ABI: Avoid hashing back reference keys in manglerDavid Majnemer2014-09-251-17/+8
| | | | | | | | | | | | | | | | | | | | This patch replaces the back reference StringMap from the MS mangler with a SmallVector of strings. My previous patches reduced the number of hashes involved in back reference lookups, this one removes them completely. The back reference map contains at most 10 entries, which are likely to be of varying sizes and different initial subsequences, and which can easily became huge (due to templates and namespaces). The solution presented is the simplest possible one. Nevertheless, it's enough to reduce compilation times for a particular test case from 11.1s to 9s, versus 8.58s for the Itanium ABI. Possible further improvements include using a sorted vector (carefully to not introduce an extra comparison), storing the string contents in a common arena, and/or keep the string storage in the context for reuse. Patch by Agustín Bergé. llvm-svn: 218461
* Add increment/decrement operators and compound assignment operators to theRichard Trieu2014-09-252-0/+27
| | | | | | uninitialized checkers that did not have them before. llvm-svn: 218435
* Fix handling of preincrement on bit-fields. This gives a bit-field in C++, butRichard Smith2014-09-242-7/+27
| | | | | | | | | | | we were failing to find that bit-field when performing integer promotions. This brings us closer to following the standard, and closer to GCC. In C, this change is technically a regression: we get bit-field promotions completely wrong in C, promoting cases that are categorically not bit-field designators. This change makes us do so slightly more consistently, though. llvm-svn: 218428
* clang-format: Don't let -style=Chromium imply c++03 template formatting.Nico Weber2014-09-241-1/+0
| | | | | | | Chromium's now using some c++11 language features, so it's now fine that clang-format produces vector<vector<int>>. llvm-svn: 218392
* Include debug info for types referenced only via explicit cast expressions.David Blaikie2014-09-243-0/+15
| | | | | | | | | | | | | | | | | | | | | | | Most of the debug info emission is powered essentially from function definitions - if we emit the definition of a function, we emit the types of its parameters, the members of those types, and so on and so forth. For types that aren't referenced even indirectly due to this - because they only appear in temporary expressions, not in any named variable, we need to explicitly emit/add them as is done here. This is not the only case of such code, and we might want to consider handling "void func(void*); ... func(new T());" (currently debug info for T is not emitted) at some point, though GCC doesn't. There's a much broader solution to these issues, but it's a lot of work for possibly marginal gain (but might help us improve the default -fno-standalone-debug behavior to be even more aggressive in some places). See the original review thread for more details. Patch by jyoti allur (jyoti.yalamanchili@gmail.com)! Differential Revision: http://reviews.llvm.org/D2498 llvm-svn: 218390
* Patch to allow mangling of microsoft’s __uuidof expression for the Itanium ↵Fariborz Jahanian2014-09-241-1/+14
| | | | | | | | | ABI when under -fms-extensions. Reviewed by John McCall. //rdar://17784718 llvm-svn: 218384
* Clean up ClangTool's argument adjuster handling a bit with unique_ptr.Benjamin Kramer2014-09-241-18/+5
| | | | | | Make the dtor non-virtual while there. No functionality change. llvm-svn: 218379
* Sema: Inherit the flexible array property from struct fieldsDavid Majnemer2014-09-241-9/+6
| | | | | | | | A record which contains a flexible array member is itself a flexible array member. A struct which contains such a record should also consider itself to be a flexible array member. llvm-svn: 218378
* [x86] Fixed argument types in intrinsics:Robert Khasanov2014-09-241-6/+6
| | | | | | | | | | _addcarryx_u64 _addcarry_u64 _subborrow_u64 Thanks Pasi Parviainen for notice. llvm-svn: 218376
* Fix the argument index error of __builtin___memccpy_chkSteven Wu2014-09-241-1/+3
| | | | | | | memccpy_check should have source and dest size at arg 3 and 4 rdar://18431336 llvm-svn: 218367
* Fix an edge case with BinaryOperator's in -Wuninitialized. Add testcases forRichard Trieu2014-09-241-2/+4
| | | | | | the other visitors as well. llvm-svn: 218366
* Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.Nico Weber2014-09-242-2/+68
| | | | | | | | | 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-231-14/+13
| | | | | | | | | | | 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-231-1/+87
| | | | | | | 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-231-0/+19
| | | | | | | | | 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-232-5/+8
| | | | | | | | | 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-234-12/+2
| | | | | | | | | 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-2313-8/+177
| | | | llvm-svn: 218299
* Reverting r214064 and r215650 while investigating a pesky performance regressionArtyom Skrobov2014-09-236-143/+134
| | | | llvm-svn: 218296
* AST: Mangle cast expression encoding more accuratelyDavid Majnemer2014-09-231-6/+23
| | | | | | | | | | | 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-233-37/+70
| | | | | | Also add a test to make sure that this doesn't break again. Fixes PR21036. llvm-svn: 218292
* Don't use comdats for initializers on platforms that don't support itReid Kleckner2014-09-234-2/+12
| | | | | | | | | 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-221-13/+56
| | | | | | | | | | | | | 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 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 evatuated value of __builtin_object_size according to itsFariborz Jahanian2014-09-221-2/+14
| | | | | | | 'type' argument when it cannot be determined which objects ptr points to at compile time. rdar://18334276 llvm-svn: 218258
* [mips] Correct alignment of vectors passed in varargs for the O32 ABI.Daniel Sanders2014-09-221-1/+2
| | | | | | | | | | | | | | | | | | | 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-223-5/+118
| | | | | | | | | | | 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
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-227-11/+87
| | | | | | | | | | | | | | | | 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-201-15/+13
| | | | | | | | | | | | | | | 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-191-5/+9
| | | | | | | | | | | | | | | | | | 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-193-1/+17
| | | | | | | 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-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-0/+28
| | | | | | | | | | | | | | | | 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-191-0/+3
| | | | | | | | | | 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-191-0/+34
| | | | | | | | 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
OpenPOWER on IntegriCloud