summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Variable names should start with uppercase letters.Rui Ueyama2016-04-021-4/+3
| | | | llvm-svn: 265239
* clang-cl: Don't skip i_group flags other than -include when building pchs.Nico Weber2016-04-022-1/+6
| | | | | | | Before this change, e.g. -isystem flags in front of the /FI corresponding to the pch file would be incorrectly ignored. llvm-svn: 265238
* Rename a variable. NFC.Rui Ueyama2016-04-021-2/+2
| | | | | | We had variables MB and Mb in this function. Rename of one them. llvm-svn: 265237
* Do not return early.Rui Ueyama2016-04-021-11/+10
| | | | | | Early return in this context is a bit confusing, so avoid doing it. llvm-svn: 265236
* Move code to initialize LLVM to one place.Rui Ueyama2016-04-021-12/+19
| | | | llvm-svn: 265235
* Remove DefinedElf class.Rui Ueyama2016-04-023-38/+37
| | | | | | | | | | | | | | | | | | DefinedElf was a superclass of DefinedRegular and SharedSymbol classes and represented the notion of defined symbols created for ELF symbols. It turned out that we didn't use that class often. We had only two occurrences of dyn_cast'ing to DefinedElf, and both were easily rewritten without it. The class was also a bit confusing. The concept of "created for ELF symbol" is orthogonal to defined/undefined types. However, we had two distinct classes, DefinedElf and UndefinedElf. This patch simply removes the class. Now the class hierarchy is one level shallower. llvm-svn: 265234
* Linker: Split mapUnneededSubprograms into two; almost NFCDuncan P. N. Exon Smith2016-04-021-11/+15
| | | | | | | | | | | | | | Split the loop through compile units in mapUnneededSubprograms in two. First, visit imported entities to ensure that we've visited all need subprograms. Second, visit subprograms, and drop the ones we don't need. Hypothetically this protects against a subprogram from one compile unit being referenced from an imported entity in a different compile unit. I don't think that's valid IR (a debug info expert could confirm), but I think the refactor makes the code more clear. llvm-svn: 265233
* Remove redundant assertion after cast, NFCDuncan P. N. Exon Smith2016-04-021-1/+0
| | | | llvm-svn: 265232
* Linker: Avoid unnecessary work when moving named metadataDuncan P. N. Exon Smith2016-04-021-17/+11
| | | | | | | | | | | IRLinker::mapUnneededSubprograms has to be sure that any "needed" subprograms get linked in. Rather than traversing through imported entities using llvm::getSubprogram, call MapMetadata. The latter memoizes the result in the ValueMap (sharing work with IRLinker::linkNamedMDNodes proper), and makes the local SmallPtrSet redundant. llvm-svn: 265231
* Rename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)Mehdi Amini2016-04-021-21/+23
| | | | | | | | The index used to contain only Function, but now contains GlobalValue in general. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265230
* Linker: Remove IRMover::isMetadataUnneeded indirection; almost NFCDuncan P. N. Exon Smith2016-04-023-56/+19
| | | | | | | | | | | | | | | | Instead of checking live during MapMetadata whether a subprogram is needed, seed the ValueMap with `nullptr` up-front. There is a small hypothetical functionality change. Previously, calling MapMetadataOp on a node whose "scope:" chain led to an unneeded subprogram would return nullptr. However, if that were ever called, then the subprogram would be needed; a situation that the IRMover is supposed to avoid a priori! Besides cleaning up the code a little, this restores a nice property: MapMetadataOp returns the same as MapMetadata. llvm-svn: 265229
* ValueMapper: Add support for seeding metadata with nullptrDuncan P. N. Exon Smith2016-04-025-6/+43
| | | | | | | | | | | | | Support seeding a ValueMap with nullptr for Metadata entries, a situation I didn't consider in the Metadata/Value split. I added a ValueMapper::getMappedMD accessor that returns an Optional<Metadata*> with the mapped (possibly null) metadata. IRMover needs to use this to avoid modifying the map when it's checking for unneeded subprograms. I updated a call from bugpoint since I find the new code clearer. llvm-svn: 265228
* Document end of anonymous namespaces, NFCDuncan P. N. Exon Smith2016-04-022-2/+2
| | | | | | Prevent clang-format from deleting the preceding newline. llvm-svn: 265227
* Bitcode: Try to emit metadata in function blocksDuncan P. N. Exon Smith2016-04-024-39/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever metadata is only referenced by a single function, emit the metadata just in that function block. This should improve lazy-loading by reducing the amount of metadata in the global block. For now, this should catch all DILocations, and anything else that happens to be referenced only by a single function. It's also a first step toward a couple of possible future directions (which this commit does *not* implement): 1. Some debug info metadata is only referenced from compile units and individual functions. If we can drop the link from the compile unit, this optimization will get more powerful. 2. Any uniqued metadata that isn't referenced globally can in theory be emitted in every function block that references it (trading off bitcode size and full-parse time vs. lazy-load time). Note: this assumes the new BitcodeReader error checking from r265223. The metadata stored in function blocks gets purged after parsing each function, which means unresolved forward references will get lost. Since all the global metadata should have already been resolved by the time we get to the function metadata blocks we just need to check for that case. (If for some reason we need to handle bitcode that fails the checks in r265223, the fix is to store about-to-be-dropped unresolved nodes in MetadataList::shrinkTo until they can be handled succesfully by a future call to MetadataList::tryToResolveCycles.) llvm-svn: 265226
* Fix doxygen comments from r265224, NFCDuncan P. N. Exon Smith2016-04-021-2/+2
| | | | llvm-svn: 265225
* BitcodeWriter: Further unify function metadata, NFCDuncan P. N. Exon Smith2016-04-023-12/+17
| | | | | | | | | | | | | Further unify the handling of function-local metadata with global metadata, by exposing the same interface in ValueEnumerator. Both contexts use the same accessors: - getMDStrings(): get the strings for this block. - getNonMDStrings(): get the non-strings for this block. A future commit will start adding strings to the function-block. llvm-svn: 265224
* BitcodeReader: Check for unresolved function metadataDuncan P. N. Exon Smith2016-04-021-2/+12
| | | | | | | | | | | | | | A follow-up commit will start using function metadata blocks more heavily. This commit adds some error checking to confirm that metadata is fully resolved before (and after) materializing each function. This is valid even when reading very old bitcode from before the metadata/value split. The global metadata block always came before the function blocks. However, in case somehow this causes a regression (i.e., an old LLVM did produce such bitcode after all) I'm committing separately. llvm-svn: 265223
* [X86][AVX] Added vector float truncation (double2float) testsSimon Pilgrim2016-04-021-0/+168
| | | | llvm-svn: 265222
* Reverts r265219.Mehdi Amini2016-04-021-15/+15
| | | | | | | Unintentionally commited... time to call the day off! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265221
* Fix "warning: variabl 'XX’ set but not used" in release build (variable ↵Mehdi Amini2016-04-022-2/+2
| | | | | | | used in assertion, NFC) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265220
* wipMehdi Amini2016-04-021-15/+15
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265219
* [test] Don't use "UNSUPPORTED" in FileCheck prefixesGreg Parker2016-04-022-8/+8
| | | | | | | lit uses "UNSUPPORTED:" for its own purposes and may be confused if that text appears elsewhere in the test file. llvm-svn: 265218
* constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)Mehdi Amini2016-04-022-3/+3
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265217
* Revert "ThinLTO: add module caching handling."Mehdi Amini2016-04-022-111/+1
| | | | | | | This reverts commit r265214, unintentionally commited. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265216
* Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)Mehdi Amini2016-04-027-41/+50
| | | | | | | | | | | | | Summary: This should make the code more readable, especially all the map declarations. Reviewers: tejohnson Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18721 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265215
* ThinLTO: add module caching handling.Mehdi Amini2016-04-022-1/+111
| | | | | | | | | | | Reviewers: tejohnson Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D18494 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265214
* Call cl::ParseCommandLineOptions from the driver.Sean Silva2016-04-023-5/+4
| | | | | | Thanks to Rui for the suggestion; this simplifies things. llvm-svn: 265213
* 80 lines column after renaming "shouldDiscardValueNames" (NFC)Mehdi Amini2016-04-021-1/+3
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265212
* Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)Mehdi Amini2016-04-024-4/+4
| | | | | | | Suggested by Sean Silva. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265211
* [clang-tidy] Update an example. NFC.Alexander Kornienko2016-04-021-1/+1
| | | | llvm-svn: 265210
* Add Cache Pruning supportMehdi Amini2016-04-023-0/+200
| | | | | | | | | | | | | | | | | | | | Incremental LTO will usea cache to store object files. This patch handles the pruning part of the cache, exposing a few knobs: - Pruning interval: the implementation keeps a "timestamp" file in the directory and will scan it only after a given interval since the last modification of the timestamp file. This is for performance purpose, we don't want to scan continuously the folder. - Entry expiration: this is the time after which a file that hasn't been used is remove from the cache. - Maximum size: expressed in percentage of the available disk space, it helps to avoid that we blow up the disk space. http://reviews.llvm.org/D18422 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265209
* [LTO] Fix symbols which were internalized incorrectly.Davide Italiano2016-04-023-0/+35
| | | | | | | | | | | | | If a symbol is defined in an archive, when we replace its body the isUsedInRegularObj wasn't set correctly. Internalize makes its decision based on that bit so we ended up internalizing symbols that we shouldn't (because they're referenced). This should fix. Thanks to Peter and Rafael for discussion and help diagnosing the issue! Found during LTO of unittests. llvm-svn: 265208
* Fix MSVC build after r265206Sean Silva2016-04-022-1/+2
| | | | | | c:\b\slave\sanitizer-windows\llvm\tools\lld\elf\Config.h(94) : error C2797: 'lld::elf::Configuration::MLlvm': list initialization inside member initializer list or non-static data member initializer is not implemented llvm-svn: 265207
* PR27104: Add -mllvm optionSean Silva2016-04-025-2/+11
| | | | | | The argv[0] is based on the analogous thing in clang. llvm-svn: 265206
* [Clang-tidy] Improve checks documentation consistency.Eugene Zelenko2016-04-0234-124/+85
| | | | | | Differential revision: http://reviews.llvm.org/D18717 llvm-svn: 265205
* Fix -Wpedantic warning about extra semi-colonHans Wennborg2016-04-021-1/+1
| | | | llvm-svn: 265204
* Don't create a plt when LD access is optimized.Rafael Espindola2016-04-022-1/+11
| | | | llvm-svn: 265203
* Don't create a PLT when we optimize out the plt use.Rafael Espindola2016-04-012-1/+25
| | | | llvm-svn: 265202
* [Objective-C] Introduce objc_runtime_visible attribute.Douglas Gregor2016-04-018-0/+126
| | | | | | | | | | | | | | | | | | | | The objc_runtime_visible attribute deals with an odd corner case where a particular Objective-C class is known to the Objective-C runtime (and, therefore, accessible by name) but its symbol has been hidden for some reason. For such classes, teach CodeGen to use objc_lookUpClass to retrieve the Class object, rather than referencing the class symbol directly. Classes annotated with objc_runtime_visible have two major limitations that fall out from places where Objective-C metadata needs to refer to the class (or metaclass) symbol directly: * One cannot implement a subclass of an objc_runtime_visible class. * One cannot implement a category on an objc_runtime_visible class. Implements rdar://problem/25494092. llvm-svn: 265201
* Add some unit tests for ClangASTContext.Zachary Turner2016-04-016-133/+416
| | | | | | | | | | | In doing so, two bugs were uncovered (and fixed). The first bug is that ClangASTContext::RemoveFastQualifiers() was broken, and was not removing fast qualifiers (or doing anything else for that matter). The second bug is that UnifyAccessSpecifiers treated AS_None asymmetrically, which is probably an edge case, but seems like a bug nonetheless. llvm-svn: 265200
* [PGO] Use a helper function to find all indirect call-sitesRong Xu2016-04-012-26/+46
| | | | | | | | | | Use a helper function to find all the direct-calls-sites in a function. Also split the code into a separated file as this will be use by indirect-call-promotion transformation. Differential Revision: http://reviews.llvm.org/D18704 llvm-svn: 265199
* AArch64: avoid clobbering SP for dead MOVimm pseudos.Tim Northover2016-04-014-2/+59
| | | | | | | | We were producing ORR, which actually defines a GPR32sp rather than a GPR32. Should fix PR23209. llvm-svn: 265198
* [CodeGen] Emit lifetime.end intrinsic after objects are destructed inAkira Hatanaka2016-04-015-4/+114
| | | | | | | | | | | | | | | | landing pads. Previously, lifetime.end intrinsics were inserted only on normal control flows. This prevented StackColoring from merging stack slots for objects that were destroyed on the exception handling control flow since it couldn't tell their lifetime ranges were disjoint. This patch fixes code-gen to emit the intrinsic on both control flows. rdar://problem/22181976 Differential Revision: http://reviews.llvm.org/D18196 llvm-svn: 265197
* Fixed an issue where if we have DWARF in an executable that has multiple ↵Greg Clayton2016-04-013-3/+27
| | | | | | | | | | | | | | languages where these languages use different type systems, you can end up trying to find the actualy definition for a forward declaration for a type, you will call: TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &dwarf_decl_ctx); The problem was we might be looking for a type "Foo", and find one from another langauge. Then the DWARFASTParserClang would try to make an AST type using a CompilerType that might return an empty. This fix makes sure that when we create a DWARFDeclContext from a DWARFDIE that the DWARFDeclContext we set the language of the DIE. Then when we go to find matches for DWARFDeclContext, we end up with bunch of DIEs. We check each DWARFDIE that we found by asking it for its language and making sure the language is compatible with the type system that we want to use. This keeps us from using the wrong types to resolve forward declarations. <rdar://problem/25276165> llvm-svn: 265196
* [modules] Start moving the code for encoding AST records out of ASTWriter intoRichard Smith2016-04-014-421/+632
| | | | | | | | a separate class. The goal is for this class to have a separate lifetime from the AST writer so that it can meaningfully track pending statement nodes and context for more compact encoding of various types. llvm-svn: 265195
* Rename a few variables. NFC.Rui Ueyama2016-04-011-13/+15
| | | | | | We had Phdr, PHdr and Phdrs in one line. That was a bit confusing. llvm-svn: 265194
* Make DIASession work if msdia*.dll isn't registered.Nico Weber2016-04-011-9/+34
| | | | | | | | | This fixes various symbolization test failures for me when I build with a hermetic VS2015 without having run the 2015 installer. http://reviews.llvm.org/D18707 llvm-svn: 265193
* Add missing emissionKind flags to the DICompileUnits of several old testcases.Adrian Prantl2016-04-019-9/+9
| | | | llvm-svn: 265192
* ThinLTO: special handling for LinkOnce functionsMehdi Amini2016-04-013-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | These function can be dropped by the compiler if they are no longer referenced in the current module. However there is a change that another module is still referencing them because of the import. Multiple solutions can be used: - Always import LinkOnce when a caller is imported. This ensure that every module with a call to a LinkOnce has the definition and will be able to emit it if it emits the call. - Turn the LinkOnce into Weak, so that it is always emitted. - Turn all LinkOnce into available_externally and come back after all modules are codegen'ed to emit only one copy of the linkonce, when there is still a reference to it. This patch implement the second option, with am optimization that only *one* module will turn the LinkOnce into Weak, while the others will turn it into available_externally, so that there is exactly one copy emitted for the whole compilation. http://reviews.llvm.org/D18346 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265190
* Swift Calling Convention: add swifterror attribute.Manman Ren2016-04-0126-11/+236
| | | | | | | | | | | | A ``swifterror`` attribute can be applied to a function parameter or an AllocaInst. This commit does not include any target-specific change. The target-specific optimization will come as a follow-up patch. Differential Revision: http://reviews.llvm.org/D18092 llvm-svn: 265189
OpenPOWER on IntegriCloud