summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Revert r218616, "Refactor Matcher<T> and DynTypedMatcher to reduce overhead ↵NAKAMURA Takumi2014-09-296-307/+214
| | | | | | | | | | | | of casts." MSC17, aka VS2012, cannot compile it. clang/include/clang/ASTMatchers/ASTMatchersInternal.h(387) : error C4519: default template arguments are only allowed on a class template clang/include/clang/ASTMatchers/ASTMatchersInternal.h(443) : see reference to class template instantiation 'clang::ast_matchers::internal::Matcher<T>' being compiled llvm-svn: 218648
* clang/test/CodeGenCXX/vararg-non-pod-ms-compat.cpp: Appease -Asserts to skip ↵NAKAMURA Takumi2014-09-291-0/+2
| | | | | | 1st alloca. llvm-svn: 218647
* Try to fix non-asserts CodeGenCXX/vararg-non-pod-ms-compat.cppHans Wennborg2014-09-291-2/+2
| | | | | | | There are two GEP's in the function, and it seems the X64 CHECK was matching the wrong one. llvm-svn: 218645
* Don't trap when passing non-POD arguments to variadic functions in ↵Hans Wennborg2014-09-295-0/+35
| | | | | | | | | | | | | | | | | | MS-compatibility mode Clang warns (treated as error by default, but still ignored in system headers) when passing non-POD arguments to variadic functions, and generates a trap instruction to crash the program if that code is ever run. Unfortunately, MSVC happily generates code for such calls without a warning, and there is code in system headers that use it. This makes Clang not insert the trap instruction when in -fms-compatibility mode, while still generating the warning/error message. Differential Revision: http://reviews.llvm.org/D5492 llvm-svn: 218640
* Use ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC.Alexey Samsonov2014-09-292-183/+200
| | | | | | | | | | | This is the last piece of CGCall code that had implicit assumptions about the order in which Clang arguments are translated to LLVM ones (positions of inalloca argument, sret, this, padding arguments etc.) Now all of this data is encapsulated in ClangToLLVMArgsMapping. If this information would be required somewhere else, this class can be moved to a separate header or pulled into CGFunctionInfo. llvm-svn: 218634
* Test commit. Fix a whitespace in ToolChains.cpp.Rafael Auler2014-09-291-1/+1
| | | | llvm-svn: 218630
* AST: Fix a typo in RecordLayoutBuilderDavid Majnemer2014-09-291-1/+1
| | | | | | No functional change intended. llvm-svn: 218628
* Introduce CGFunctionInfo::getNumRequiredArgs(). NFC.Alexey Samsonov2014-09-293-23/+14
| | | | | | Save the callers from necessity to special-case on variadic functions. llvm-svn: 218625
* CUDA: Fix incorrect target inference for implicit members.Eli Bendersky2014-09-299-18/+665
| | | | | | | | | | | | As PR20495 demonstrates, Clang currenlty infers the CUDA target (host/device, etc) for implicit members (constructors, etc.) incorrectly. This causes errors and even assertions in Clang when compiling code (assertions in C++11 mode where implicit move constructors are added into the mix). Fix the problem by inferring the target from the methods the implicit member should call (depending on its base classes and fields). llvm-svn: 218624
* Speedup ClangToLLVMArgMapping construction. NFC.Alexey Samsonov2014-09-291-6/+18
| | | | | | | | Add a method to calculate the number of arguments given QualType expnads to. Use this method in ClangToLLVMArgMapping calculation. This number may be cached in CodeGenTypes for efficiency, if needed. llvm-svn: 218623
* Objective-C [qoi] - provide group name forFariborz Jahanian2014-09-292-3/+3
| | | | | | warn_property_types_are_incompatible. rdar://18487506 llvm-svn: 218621
* Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.Samuel Benzaquen2014-09-296-214/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change introduces DynMatcherInterface and changes the internal representation of DynTypedMatcher and Matcher<T> to use a generic interface instead. It removes unnecessary indirections and virtual function calls when converting matchers by implicit and dynamic casts. DynTypedMatcher now remembers the stricter type in the chain of casts and checks it before calling into DynMatcherInterface. This change improves our clang-tidy related benchmark by ~14%. Also, it opens the door for more optimizations of this kind that are coming in future changes. As a side effect of removing these template instantiations, it also speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of symbols generated by ~30%. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5485 llvm-svn: 218616
* Refactor ABIArgInfo::Expand implementation (NFC).Alexey Samsonov2014-09-291-120/+155
| | | | | | | | Hoist the logic which determines the way QualType is expanded into a separate method. Remove a bunch of copy-paste and simplify getTypesFromArgs() / ExpandTypeFromArgs() / ExpandTypeToArgs() methods. llvm-svn: 218615
* Update modules documentation now that C++ support is working pretty well.Richard Smith2014-09-291-6/+3
| | | | llvm-svn: 218614
* Fix bug 20116 - http://llvm.org/bugs/show_bug.cgi?id=20116Alexey Bataev2014-09-292-13/+15
| | | | | | | | Fixes incorrect codegen when devirtualization is aborted due to covariant return types. Differential Revision: http://reviews.llvm.org/D5321 llvm-svn: 218602
* clang-format: Fix GCC warning about implicit bool pointer conversion.Daniel Jasper2014-09-291-6/+6
| | | | | | Introduced in r217880. llvm-svn: 218597
* clang-format: [JS] Improve formatting of function literals in chainsDaniel Jasper2014-09-292-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before: getSomeLongPromise(.....) .then( function(value) { body(); body(); }) .thenCatch(function(error) { body(); body(); }); After: getSomeLongPromise(.....) .then(function(value) { body(); body(); }) .thenCatch(function(error) { body(); body(); }); llvm-svn: 218595
* Remove dead code from DIBuilderJyoti Allur2014-09-291-3/+3
| | | | llvm-svn: 218593
* testing commit access to clang repoJyoti Allur2014-09-291-1/+0
| | | | llvm-svn: 218592
* Tests for DR600-640.Richard Smith2014-09-292-34/+381
| | | | llvm-svn: 218591
* Fix "unsupported friend" diagnostic to also appear for friend functions with ↵Richard Smith2014-09-292-5/+9
| | | | | | dependent scopes. llvm-svn: 218590
* Add the tests for __super that I forgot to commit in as part of r218484.Nikola Smiljanic2014-09-291-0/+147
| | | | llvm-svn: 218587
* Run DR tests in C++17 mode too.Richard Smith2014-09-2812-12/+24
| | | | llvm-svn: 218580
* CodeGen: Don't crash when initializing pointer-to-member fields in basesDavid Majnemer2014-09-284-13/+42
| | | | | | | | | | | | | | | | | Clang uses two types to talk about a C++ class, the NonVirtualBaseLLVMType and the LLVMType. Previously, we would allow one of these to be packed and the other not. This is problematic. If both don't agree on a common subset of fields, then routines like getLLVMFieldNo will point to the wrong field. Solve this by copying the 'packed'-ness of the complete type to the non-virtual subobject. For this to work, we need to take into account the non-virtual subobject's size and alignment when we are computing the layout of the complete object. This fixes PR21089. llvm-svn: 218577
* Add back checking for condition of conditional operator for -WuninitializedRichard Trieu2014-09-262-1/+12
| | | | llvm-svn: 218556
* Ensure that all module build failures get diagnosedBen Langmuir2014-09-262-2/+13
| | | | | | | | 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-262-0/+11
| | | | | | | | | | | 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-262-20/+64
| | | | | | | | | | | | | | | | | | 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
* clang/test/CodeGen/builtin-assume-aligned.c: Fix for -Asserts.NAKAMURA Takumi2014-09-261-9/+9
| | | | llvm-svn: 218507
* 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-262-7/+30
| | | | | | | | (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-2611-65/+324
| | | | | | | | | 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-262-0/+24
| | | | | | | | 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-2632-33/+307
| | | | | | | | | 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-252-0/+92
| | | | | | http://reviews.llvm.org/D5298 llvm-svn: 218482
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-253-7/+86
| | | | llvm-svn: 218468
* Move calls to ResolveExceptionSpec out of SetDeclDefaulted and into ↵Ben Langmuir2014-09-253-10/+49
| | | | | | | | | 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-254-4/+67
| | | | | | 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-244-8/+79
| | | | | | | | | | | 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
* Thread Safety Analysis: Update to documentation.DeLesley Hutchins2014-09-241-265/+394
| | | | | | | | | | The attribute documentation now conforms to Aaron Ballman's renaming of the thread safety attributes, as well as the new paper that is due to be published in the conference on Source Code Analysis and Manipulation (SCAM 2014) later this week. In addition, recent changes to the analysis, such as checking of references and negative capabilities, are now documented. llvm-svn: 218420
* pass environment when invoking llvm-config and clang from lit.cfgScott Douglass2014-09-241-2/+4
| | | | | | | | Use the same environment when invoking llvm-config from lit.cfg as will be used when running tests, so that ASAN_OPTIONS, INCLUDE, etc. are present. llvm-svn: 218404
* Simplify tests.Nico Weber2014-09-243-16/+2
| | | | | | | This reverts bits of r218166 that are no longer necessary now that r218394 made -Wmissing-prototype-for-cc a regular warning. llvm-svn: 218400
* Downgrade error about stdcall decls with no prototype to a warningReid Kleckner2014-09-245-13/+13
| | | | | | | | | | | | | | | | | | Fixes PR21027. The MIDL compiler produces code that does this. If we wanted to improve the warning, I think we could do this: void __stdcall f(); // Don't warn without -Wstrict-prototypes. void g() { f(); // Might warn, the user probably meant for f to take no args. f(1, 2, 3); // Warn, we have no idea what args f takes. f(1); // Error, this is insane, one of these calls is broken. } Reviewers: thakis Differential Revision: http://reviews.llvm.org/D5481 llvm-svn: 218394
* clang-format: Don't let -style=Chromium imply c++03 template formatting.Nico Weber2014-09-242-1/+2
| | | | | | | 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
* Constify a functor's function call operator because it can/should be.David Blaikie2014-09-241-1/+1
| | | | | | Patch by Graham Lee (graham@iamleeg.com)! llvm-svn: 218385
* Patch to allow mangling of microsoft’s __uuidof expression for the Itanium ↵Fariborz Jahanian2014-09-243-3/+64
| | | | | | | | | 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-242-30/+13
| | | | | | Make the dtor non-virtual while there. No functionality change. llvm-svn: 218379
* Sema: Inherit the flexible array property from struct fieldsDavid Majnemer2014-09-242-9/+12
| | | | | | | | 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
OpenPOWER on IntegriCloud