summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Use a function_ref now that it works (r221753).Rafael Espindola2014-11-121-2/+2
| | | | llvm-svn: 221756
* Remove the now unused StringRefMemoryObject.h.Rafael Espindola2014-11-121-41/+0
| | | | llvm-svn: 221755
* Ensure function_refs are copyable even from non-const referencesDavid Blaikie2014-11-121-2/+5
| | | | | | | | | | | | | | | | | | A subtle bug was found where attempting to copy a non-const function_ref lvalue would actually invoke the generic forwarding constructor (as it was a closer match - being T& rather than the const T& of the implicit copy constructor). In the particular case this lead to a dangling function_ref member (since it had referenced the function_ref passed by value to its ctor, rather than the outer function_ref that was still alive) SFINAE the converting constructor to not be considered if the copy constructor is available and demonstrate that this causes the copy to refer to the original functor, not to the function_ref it was copied from. (without the code change, the test would fail as Y would be referencing X and Y() would see the result of the mutation to X, ie: 2) llvm-svn: 221753
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-121-3/+3
| | | | | | | | | | | | With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
* Remove a bit of dead code.Rafael Espindola2014-11-121-1/+1
| | | | | | Every "real" object file implements this an ptx doesn't use it. llvm-svn: 221746
* libLTO: Allow linker to choose context of modules and codegenDuncan P. N. Exon Smith2014-11-111-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add API for specifying which `LLVMContext` each `lto_module_t` and `lto_code_gen_t` is in. In particular, this enables the following flow: for (auto &File : Files) { lto_module_t M = lto_module_create_in_local_context(File...); querySymbols(M); lto_module_dispose(M); } lto_code_gen_t CG = lto_codegen_create_in_local_context(); for (auto &File : FilesToLink) { lto_module_t M = lto_module_create_in_codegen_context(File..., CG); lto_codegen_add_module(CG, M); lto_module_dispose(M); } lto_codegen_compile(CG); lto_codegen_write_merged_modules(CG, ...); lto_codegen_dispose(CG); This flow has a few benefits. - Only one module (two if you count the combined module in the code generator) is in memory at a time. - Metadata (and constants) from files that are parsed to query symbols but not linked into the code generator don't pollute the global context. - The first for loop can be parallelized, since each module is in its own context. - When the code generator is disposed, the memory from LTO gets freed. rdar://problem/18767512 llvm-svn: 221733
* libLTO: Allow LTOModule to own a contextDuncan P. N. Exon Smith2014-11-112-1/+16
| | | | llvm-svn: 221728
* libLTO: Allow LTOCodeGenerator to own a contextDuncan P. N. Exon Smith2014-11-111-0/+3
| | | | llvm-svn: 221726
* Move asan-coverage into a separate phase.Kostya Serebryany2014-11-112-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change moves asan-coverage instrumentation into a separate Module pass. The other part of the change in clang introduces a new flag -fsanitize-coverage=N. Another small patch will update tests in compiler-rt. With this patch no functionality change is expected except for the flag name. The following changes will make the coverage instrumentation work with tsan/msan Test Plan: Run regression tests, chromium. Reviewers: nlewycky, samsonov Reviewed By: nlewycky, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6152 llvm-svn: 221718
* Revert "IR: MDNode => Value"Duncan P. N. Exon Smith2014-11-113-42/+19
| | | | | | | | | | | | | | | | | Instead, we're going to separate metadata from the Value hierarchy. See PR21532. This reverts commit r221375. This reverts commit r221373. This reverts commit r221359. This reverts commit r221167. This reverts commit r221027. This reverts commit r221024. This reverts commit r221023. This reverts commit r220995. This reverts commit r220994. llvm-svn: 221711
* Totally forget deallocated SDNodes in SDDbgInfo.Frederic Riss2014-11-111-0/+4
| | | | | | | | | | | | | | | | What would happen before that commit is that the SDDbgValues associated with a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep a map entry keyed by the SDNode pointer pointing to this list of invalidated SDDbgNodes. As the memory gets reused, the list might get wrongly associated with another new SDNode. As the SDDbgValues are cloned when they are transfered, this can lead to an exponential number of SDDbgValues being produced during DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893 Note that the previous behavior wasn't really buggy as the invalidation made sure that the SDDbgValues won't be used. This commit can be considered a memory optimization and as such is really hard to validate in a unit-test. llvm-svn: 221709
* Add Forward Control-Flow Integrity.Tom Roeder2014-11-118-18/+248
| | | | | | | | | | | | | | | | | | | | This commit adds a new pass that can inject checks before indirect calls to make sure that these calls target known locations. It supports three types of checks and, at compile time, it can take the name of a custom function to call when an indirect call check fails. The default failure function ignores the error and continues. This pass incidentally moves the function JumpInstrTables::transformType from private to public and makes it static (with a new argument that specifies the table type to use); this is so that the CFI code can transform function types at call sites to determine which jump-instruction table to use for the check at that site. Also, this removes support for jumptables in ARM, pending further performance analysis and discussion. Review: http://reviews.llvm.org/D4167 llvm-svn: 221708
* MC, COFF: Use relocations for function references inside the sectionDavid Majnemer2014-11-111-1/+3
| | | | | | | | | | | | | | | | | | Referencing one symbol from another in the same section does not generally require a relocation. However, the MS linker has a feature called /INCREMENTAL which enables incremental links. It achieves this by creating thunks to the actual function and redirecting all relocations to point to the thunk. This breaks down with the old scheme if you have a function which references, say, itself. On x86_64, we would use %rip relative addressing to reference the start of the function from out current position. This would lead to miscompiles because other references might reference the thunk instead, breaking function pointer equality. This fixes PR21520. llvm-svn: 221678
* Add const. NFC.Rafael Espindola2014-11-113-2/+14
| | | | | | | This adds const to a few methods that already return const references or creates a const version when they reterun non-const references. llvm-svn: 221666
* Don't duplicate names in comments. NFC.Rafael Espindola2014-11-111-35/+31
| | | | llvm-svn: 221665
* Don't repeat name in comment. NFC.Rafael Espindola2014-11-111-20/+20
| | | | llvm-svn: 221664
* Fix variable names and comment style. NFC.Rafael Espindola2014-11-101-16/+14
| | | | llvm-svn: 221608
* SelectionDAG: Assert if we truncate SDNode's NumOperands or NumValuesDavid Majnemer2014-11-071-1/+10
| | | | | | | No functionality change intended, this just stops us early if we created a bad SDNode. llvm-svn: 221560
* Transform: add SymbolRewriter passSaleem Abdulrasool2014-11-074-2/+170
| | | | | | | | | | | | | | | | This introduces the symbol rewriter. This is an IR->IR transformation that is implemented as a CodeGenPrepare pass. This allows for the transparent adjustment of the symbols during compilation. It provides a clean, simple, elegant solution for symbol inter-positioning. This technique is often used, such as in the various sanitizers and performance analysis. The control of this is via a custom YAML syntax map file that indicates source to destination mapping, so as to avoid having the compiler to know the exact details of the source to destination transformations. llvm-svn: 221548
* Don't redeclare a pure virtual method.Rafael Espindola2014-11-072-39/+0
| | | | | | | | | | | I.E., there is no value is having void foo() override = 0; If it is override it is already present in a base class. Since it is pure, some other class will have to implement it. llvm-svn: 221537
* [mips] Remove MipsCC::analyzeCallOperands in favour of ↵Daniel Sanders2014-11-071-0/+3
| | | | | | | | | | | | | | | | | | CCState::AnalyzeCallOperands. NFC Summary: In addition to the usual f128 workaround, it was also necessary to provide a means of accessing ArgListEntry::IsFixed. Reviewers: theraven, vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6111 llvm-svn: 221518
* llvm-symbolizer: teach it about PowerPC64 ELF function descriptorsJay Foad2014-11-071-0/+11
| | | | | | | | | | | | | | | | | Summary: Teach llvm-symbolizer about PowerPC64 ELF function descriptors. Symbols in the .opd section point to function descriptors, the first word of which is a pointer to the real function. For the purposes of symbolizing we pretend that the symbol points directly to the function. This is enough to get decent function names in stack traces for unoptimized binaries, which fixes the sanitizer print-stack-trace test on PowerPC64 Linux. Reviewers: kcc, willschm, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6110 llvm-svn: 221514
* Add Position-independent Code model Module API.Justin Hibbits2014-11-072-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This makes PIC levels a Module flag attribute, which can be queried by the backend. The flag is named `PIC Level`, and can have a value of: 0 - Backend-default 1 - Small-model (-fpic) 2 - Large-model (-fPIC) These match the `-pic-level' command line argument for clang, and the value of the preprocessor macro `__PIC__'. Test Plan: New flags tests specific for the 'PIC Level' module flag. Tests to be added as part of a future commit for PowerPC, which will use this new API. Reviewers: rafael, echristo Reviewed By: rafael, echristo Subscribers: rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D5882 llvm-svn: 221510
* Don't repeat names in comments. NFC.Rafael Espindola2014-11-061-70/+56
| | | | llvm-svn: 221495
* [ELF][yaml2obj] Handle additional MIPS specific st_other field flagsSimon Atanasyan2014-11-061-1/+7
| | | | | | | | The ELF symbol `st_other` field might contain additional flags besides visibility ones. This patch implements support for some MIPS specific flags. llvm-svn: 221491
* Change DIBuilder::createImportedDeclaration from taking a DIScope to a ↵Frederic Riss2014-11-061-1/+1
| | | | | | | | | | DIDescriptor. Imported declarations can be DIGlobalVariables which aren't a DIScope. Today clang (unknowingly I believe) shoehorns these into a DIScope and it all works just because we never access the fields. llvm-svn: 221466
* Remove obsolete ARM intrinsics vclz and vcntSteven Wu2014-11-051-4/+0
| | | | | | | Both of the intrinsics get autoupgraded to target independent intrinsics. llvm-svn: 221396
* Add accessor to get 'visibility' part of st_other fieldSimon Atanasyan2014-11-051-0/+4
| | | | | | This new `getVisibility()` function will also be used in the LLD code. llvm-svn: 221392
* IR: MDNode => Value: NamedMDNode::getOperator()Duncan P. N. Exon Smith2014-11-051-6/+9
| | | | | | | | | | | | | Change `NamedMDNode::getOperator()` from returning `MDNode *` to returning `Value *`. To reduce boilerplate at some call sites, add a `getOperatorAsMDNode()` for named metadata that's expected to only return `MDNode` -- for now, that's everything, but debug node named metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change. This is part of PR21433. Note that there's a follow-up patch to clang for the API change. llvm-svn: 221375
* IR: MDNode => Value: NamedMDNode::addOperand()Duncan P. N. Exon Smith2014-11-051-1/+1
| | | | | | | Change `NamedMDNode::addOperand()` to take a `Value *` instead of an `MDNode *`. This is part of PR21433. llvm-svn: 221359
* [mips][microMIPS] Mark symbols as microMIPS if necessaryZoran Jovanovic2014-11-051-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D6039 llvm-svn: 221355
* llvm-readobj: Add support for dumping the DOS header in PE filesDavid Majnemer2014-11-051-1/+6
| | | | llvm-svn: 221333
* Revert 220932.Jiangning Liu2014-11-051-36/+0
| | | | | | | | | Commit 220932 caused crash when building clang-tblgen on aarch64 debian target, so it's blocking all daily tests. The std::call_once implementation in pthread has bug for aarch64 debian. llvm-svn: 221331
* Fix broken C++ mode commentMatt Arsenault2014-11-051-1/+1
| | | | llvm-svn: 221327
* ErrorOr: Be more explicit in the implicit conversion to bool docsJustin Bogner2014-11-041-3/+3
| | | | llvm-svn: 221295
* [PBQP] Tweak spill costs and coalescing benefitsArnaud A. de Grandmaison2014-11-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves how the different costs (register, interference, spill and coalescing) relates together. The assumption is now that: - coalescing (or any other "side effect" of reg alloc) is negative, and instead of being derived from a spill cost, they use the block frequency info. - spill costs are in the [MinSpillCost:+inf( range - register or interference costs are in [0.0:MinSpillCost( or +inf The current MinSpillCost is set to 10.0, which is a random value high enough that the current constraint builders do not need to worry about when settings costs. It would however be worth adding a normalization step for register and interference costs as the last step in the constraint builder chain to ensure they are not greater than SpillMinCost (unless this has some sense for some architectures). This would work well with the current builder pipeline, where all costs are tweaked relatively to each others, but could grow above MinSpillCost if the pipeline is deep enough. The current heuristic is tuned to depend rather on the number of uses of a live interval rather than a density of uses, as used by the greedy allocator. This heuristic provides a few percent improvement on a number of benchmarks (eembc, spec, ...) and will definitely need to change once spill placement is implemented: the current spill placement is really ineficient, so making the cost proportionnal to the number of use is a clear win. llvm-svn: 221292
* Remove unused DisableRedZone option.Rafael Espindola2014-11-041-5/+0
| | | | | | Patch by Steve King. llvm-svn: 221282
* Remove FindProgramByName. NFC.Rafael Espindola2014-11-041-13/+1
| | | | llvm-svn: 221258
* [Support][Program] Add findProgramByName(Name, OptionalPaths)Michael J. Spencer2014-11-041-0/+18
| | | | llvm-svn: 221220
* Use the LLVM_GNUC_PREREQ macro instead of the longhand version checkReid Kleckner2014-11-041-4/+3
| | | | llvm-svn: 221219
* Remove the END_WITH_NULL macro now that Clang doesn't use itReid Kleckner2014-11-041-2/+0
| | | | llvm-svn: 221218
* Rename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.hReid Kleckner2014-11-047-21/+17
| | | | | | | | | We shouldn't put this kind of attribute stuff in DataTypes.h. Leave the END_WITH_NULL name for now so I can update clang without making build spam. llvm-svn: 221215
* The patchpoint lowering logic would crash with live constants equal toSanjoy Das2014-11-041-1/+1
| | | | | | | the tombstone or empty keys of a DenseMap<int64_t, T>. This patch fixes the issue (and adds a tests case). llvm-svn: 221214
* Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O ↵Kevin Enderby2014-11-041-0/+2
| | | | | | symbolizer. llvm-svn: 221211
* Use AA in LoadCombineHal Finkel2014-11-031-0/+4
| | | | | | | | | | | | | | LoadCombine can be smarter about aborting when a writing instruction is encountered, instead of aborting upon encountering any writing instruction, use an AliasSetTracker, and only abort when encountering some write that might alias with the loads that could potentially be combined. This was originally motivated by comments made (and a test case provided) by David Majnemer in response to PR21448. It turned out that LoadCombine was not responsible for that PR, but LoadCombine should also be improved so that unrelated stores (and @llvm.assume) don't interrupt load combining. llvm-svn: 221203
* Relax the LLVM_NOEXCEPT _MSC_VER version check back to 1900Reid Kleckner2014-11-031-1/+1
| | | | | | | | | | Unconditional noexcept support was added in the VS 2013 Nov CTP. Given that there have been three CTPs since then, I don't think we need careful macro magic to target that specific tech preview. Instead, target the major release version number of 1900, which corresponds to the as-yet unreleased VS "14". llvm-svn: 221169
* IR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()Duncan P. N. Exon Smith2014-11-031-4/+4
| | | | | | | Change `Instruction::getAllMetadataOtherThanDebugLoc()` from a vector of `MDNode` to one of `Value`. Part of PR21433. llvm-svn: 221167
* Revert r221150, as it broke sanitizer testsOliver Stannard2014-11-032-4/+3
| | | | llvm-svn: 221151
* Emit .eh_frame with relocations to functions, rather than sectionsOliver Stannard2014-11-032-3/+4
| | | | | | | | | | | | | | | | | | | | | | | When LLVM emits DWARF call frame information, it currently creates a local, section-relative symbol in the code section, which is pointed to by a relocation on the .eh_frame section. However, for C++ we emit some functions in section groups, and the SysV ABI has some rules to make it easier to remove these sections (http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules): A symbol table entry with STB_LOCAL binding that is defined relative to one of a group's sections, and that is contained in a symbol table section that is not part of the group, must be discarded if the group members are discarded. References to this symbol table entry from outside the group are not allowed. This means that we need to use the function symbol for the relocation, not a temporary symbol. There was a comment in the code claiming that the local symbol was used to avoid creating a relocation, but a relocation must be created anyway as the code and CFI are in different sections. llvm-svn: 221150
* Test commit.Charlie Turner2014-11-031-2/+2
| | | | | | | Fixes two typos. Change-Id: I129f647de8933e1d8f0dc9941bcb91602edce7e2 llvm-svn: 221148
OpenPOWER on IntegriCloud