summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* Extend 'readonly' and 'readnone' to work on function arguments as well asNick Lewycky2013-07-063-9/+24
| | | | | | | functions. Make the function attributes pass add it to known library functions and when it can deduce it. llvm-svn: 185735
* DebugInfo: Consider global variables without locations to be validDavid Blaikie2013-07-041-3/+0
| | | | | | | | | | | | | | | | | We were being a bit too aggresive here in classifying global variables with no global reference or constant value to be invalid - this would cause LLVM to not emit the DWARF description of the global variable if it had been optimized away, which isn't helpful for users who might benefit from the global variable's description even if there's no location information. This also fixes a crasher issue here that I was unable to reduce a test case for - involving a using decl (& subsequent DW_TAG_imported_declaration ) of such a global variable that, once optimized away, would crash when an attempt to emit the imported declaration was made. llvm-svn: 185675
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-042-8/+8
| | | | | | specifying the vector size. llvm-svn: 185606
* Use an RWMutex instead of a Mutex in PassRegistry.Chad Rosier2013-07-031-10/+11
| | | | | | Patch by Alex Crichton <alex@crichton.co>. Approved by Chris Lattner. llvm-svn: 185566
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-031-6/+6
| | | | | | specifying the vector size. llvm-svn: 185540
* Debug Info: cleanupManman Ren2013-07-021-4/+6
| | | | llvm-svn: 185456
* IRVerifier: Correctly check attribute typesTobias Grosser2013-07-021-1/+2
| | | | | | | | | | | Add missing parenthesis such that all and not only the very first attribute is checked. Testing this piece of code is not possible with an LLVM-IR test file, as the LLVM-IR parser has a similar check such that the wrong IR does not even arrive at the verifier. llvm-svn: 185408
* Debug Info: clean up usage of Verify.Manman Ren2013-07-011-16/+18
| | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185383
* Debug Info: Scope of a DebugLoc should not be null.Manman Ren2013-07-011-6/+3
| | | | | | No functionality change. Remove handling for the null case. llvm-svn: 185354
* ConstantFold: Check that truncating the other side is safe under a sext when ↵Benjamin Kramer2013-06-301-2/+2
| | | | | | | | trying to remove a sext from a compare. Fixes PR16462. llvm-svn: 185284
* Debug Info: clean up usage of Verify.Manman Ren2013-06-292-5/+11
| | | | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. For cases where we know the type of a DI metadata, use assert. llvm-svn: 185249
* Fix extra whitespace / formattingMatt Arsenault2013-06-281-3/+0
| | | | llvm-svn: 185238
* Rename DIBuilder::createNullPtrType to createUnspecifiedType and introducePeter Collingbourne2013-06-271-4/+9
| | | | | | | | | a zero-argument createNullPtrType function for creating the canonical nullptr type. Differential Revision: http://llvm-reviews.chandlerc.com/D1050 llvm-svn: 185114
* Added support for the Builtin attribute.Michael Gottesman2013-06-273-2/+21
| | | | | | | | The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin, rdar://problem/13727199 llvm-svn: 185049
* s/C++0x/C++11/Adrian Prantl2013-06-251-1/+1
| | | | llvm-svn: 184892
* The GCDA 402 format won't have a second checksum either.Bill Wendling2013-06-251-1/+1
| | | | llvm-svn: 184864
* typo.Adrian Prantl2013-06-241-1/+1
| | | | llvm-svn: 184783
* DebugInfo: DIBuilder changes to match DIEnumerator changes in r184694David Blaikie2013-06-241-1/+1
| | | | | | | | Representing enumerators by int64 instead of uint64 for now. At some point we need to address the underlying issue of representation depending on the specific enumeration. llvm-svn: 184761
* DebugInfo: Support (using GNU extensions) for template template parameters ↵David Blaikie2013-06-222-7/+40
| | | | | | and parameter packs llvm-svn: 184643
* DebugInfo: When asm printing include a '[def]' tag for tag decls that are ↵David Blaikie2013-06-211-1/+6
| | | | | | | | | definitions (& rename the 'fwd' tag to 'decl' for clarity) This change is version locked with a change in Clang, so expect some transient buildbot fallout. llvm-svn: 184525
* [APFloat] Converted all references to APFloat::isNormal => ↵Michael Gottesman2013-06-191-1/+1
| | | | | | | | APFloat::isFiniteNonZero. Turns out all the references were in llvm and not in clang. llvm-svn: 184356
* We want a string representation of the attribute, not the kind as a string.Bill Wendling2013-06-181-2/+2
| | | | llvm-svn: 184239
* Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddressesDerek Schuff2013-06-131-1/+1
| | | | | | | | | | | | | | | This pass was assuming that if hasAddressTaken() returns false for a function, the function's only uses are call sites. That's not true because there can be references by BlockAddresses too. Fix the pass to handle this case. Fix BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type to be changed by RAUW'ing the function with a bitcast of the recreated function. Patch by Mark Seaborn. llvm-svn: 183933
* Require members of llvm.used to be named.Rafael Espindola2013-06-111-0/+1
| | | | | | | | The effect of llvm.used is to introduce an invisible reference, so this seems a reasonable restriction. It will be used to provide an easy ordering of the entries in llvm.used. llvm-svn: 183743
* DIBuilder: No functionality change.Manman Ren2013-06-071-23/+26
| | | | | | Use the correct DIType when creating types in DIBuilder. llvm-svn: 183543
* DIBuilder: No functionality change.Manman Ren2013-06-071-3/+3
| | | | | | Use the correct DIType when creating vector types. llvm-svn: 183484
* Move getRealLinkageName to a common place and remove all the duplicates of it.Benjamin Kramer2013-06-011-25/+16
| | | | | | Also simplify code a bit while there. No functionality change. llvm-svn: 183076
* Move object construction into [] so the temporary can be moved.Benjamin Kramer2013-06-011-5/+3
| | | | | | No functionality change. llvm-svn: 183075
* Simplify logic by using the appropriate functions.Adrian Prantl2013-05-291-2/+1
| | | | llvm-svn: 182869
* Make it explicit that GlobalAlias are ok in llvm.used.Rafael Espindola2013-05-271-5/+4
| | | | | | No functionality change. llvm-svn: 182747
* Add a new function attribute 'cold' to functions.Diego Novillo2013-05-242-1/+5
| | | | | | | | | | | Other than recognizing the attribute, the patch does little else. It changes the branch probability analyzer so that edges into blocks postdominated by a cold function are given low weight. Added analysis and code generation tests. Added documentation for the new attribute. llvm-svn: 182638
* Re-implement DebugIR in a way that does not subclass AssemblyWriter:Daniel Malea2013-05-232-1/+121
| | | | | | | | | | | - move AsmWriter.h from public headers into lib - marked all AssemblyWriter functions as non-virtual; no need to override them - DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper - exposed flags to control hiding of a) debug metadata b) debug intrinsic calls C/R: Paul Redmond llvm-svn: 182617
* Solidify the assumption that a DW_TAG_subprogram's type is a ↵David Blaikie2013-05-221-2/+6
| | | | | | | | | | | | | DW_TAG_subroutine_type There were bits & pieces of code lying around that may've given the impression that debug info metadata supported the possibility that a subprogram's type could be specified by a non-subroutine type describing the return type of a void function. This support was incomplete & unnecessary. Asserts & API have been changed to make the desired usage more clear. llvm-svn: 182532
* Expose the RTDyldMemoryManager through the C API. This allows clients of Filip Pizlo2013-05-221-0/+4
| | | | | | | | the C API to provide their own way of allocating JIT memory (both code and data) and finalizing memory permissions (page protections, cache flush). llvm-svn: 182448
* Roll out r182407 and r182408 because they broke builds.Filip Pizlo2013-05-211-4/+0
| | | | llvm-svn: 182409
* Expose the RTDyldMemoryManager through the C API. This allows clients of Filip Pizlo2013-05-211-0/+4
| | | | | | | | the C API to provide their own way of allocating JIT memory (both code and data) and finalizing memory permissions (page protections, cache flush). llvm-svn: 182408
* PR14606: Debug Info for namespace aliases/DW_TAG_imported_moduleDavid Blaikie2013-05-202-11/+41
| | | | | | | | | This resolves the last of the PR14606 failures in the GDB 7.5 test suite by implementing an optional name field for DW_TAG_imported_modules/DIImportedEntities and using that to implement C++ namespace aliases (eg: "namespace X = Y;"). llvm-svn: 182328
* Remove duplicated commentMatt Arsenault2013-05-181-5/+0
| | | | | | The same comment is already made in the header llvm-svn: 182181
* Remove dead code.Eli Bendersky2013-05-151-17/+0
| | | | | | This method is not being used/tested anywhere. llvm-svn: 181943
* Speed up Value::isUsedInBasicBlock() for long use lists.Jakob Stoklund Olesen2013-05-141-14/+13
| | | | | | | | | | | | | | | | This is expanding Ben's original heuristic for short basic blocks to also work for longer basic blocks and huge use lists. Scan the basic block and the use list in parallel, terminating the search when the shorter list ends. In almost all cases, either the basic block or the use list is short, and the function returns quickly. In one crazy test case with very long use chains, CodeGenPrepare runs 400x faster. When compiling ARMDisassembler.cpp it is 5x faster. <rdar://problem/13840497> llvm-svn: 181851
* PR14492: Debug Info: Support for values of non-integer non-type template ↵David Blaikie2013-05-102-2/+6
| | | | | | | | | | parameters. This is only tested for global variables at the moment (& includes tests for the unnamed parameter case, since apparently this entire function was completely untested previously) llvm-svn: 181632
* Add DebugIR pass -- emits IR file and replace source lines with IR lines in MDDaniel Malea2013-05-081-0/+7
| | | | | | | | | | | - requires existing debug information to be present - fixes up file name and line number information in metadata - emits a "<orig_filename>-debug.ll" succinct IR file (without !dbg metadata or debug intrinsics) that can be read by a debugger - initialize pass in opt tool to enable the "-debug-ir" flag - lit tests to follow llvm-svn: 181467
* Pull up AssemblyWriter interface into header to allow subclassingDaniel Malea2013-05-081-84/+42
| | | | | | | | | | | - made all functions virtual so that subclasses can specialize them - add printInstructionLine so that subclasses can choose whether or not to print the newline character (without having to implement printBasicBlock() - added a second constructor to AssemblyWriter that does not require a SlotTracker, as required in order to keep the SlotTracker helper class outside AsmWriter.h and buried in the implementation. llvm-svn: 181466
* Rename DIImportedModule to DIImportedEntity and allow imported declarationsDavid Blaikie2013-05-072-9/+26
| | | | | | | | | DIBuilder::createImportedDeclaration isn't fully plumbed through (note, lacking in AsmPrinter/DwarfDebug support) but this seemed like a sufficiently useful division of code to make the subsequent patch(es) easier to follow. llvm-svn: 181364
* Fix const merging when an alias of a const is llvm.used.Rafael Espindola2013-05-061-1/+7
| | | | | | | We used to disable constant merging not only if a constant is llvm.used, but also if an alias of a constant is llvm.used. This change fixes that. llvm-svn: 181175
* Add ArrayRef constructor from None, and do the cleanups that this ↵Dmitri Gribenko2013-05-053-5/+5
| | | | | | | | constructor enables Patch by Robert Wilhelm. llvm-svn: 181138
* This patch breaks up Wrap.h so that it does not have to include all of Filip Pizlo2013-05-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | the things, and renames it to CBindingWrapping.h. I also moved CBindingWrapping.h into Support/. This new file just contains the macros for defining different wrap/unwrap methods. The calls to those macros, as well as any custom wrap/unwrap definitions (like for array of Values for example), are put into corresponding C++ headers. Doing this required some #include surgery, since some .cpp files relied on the fact that including Wrap.h implicitly caused the inclusion of a bunch of other things. This also now means that the C++ headers will include their corresponding C API headers; for example Value.h must include llvm-c/Core.h. I think this is harmless, since the C API headers contain just external function declarations and some C types, so I don't believe there should be any nasty dependency issues here. llvm-svn: 180881
* Now that the underlying issue is fixed, revert r180750 and r180722.Rafael Espindola2013-05-013-13/+24
| | | | | | | | | | | The cause of the windows failures was fixed by r180791. Revert to the state after Sabre's original revert. Original message: revert r179735, it has no testcases, and doesn't really make sense. llvm-svn: 180844
* Change getSlotIndex to return unsigned.Rafael Espindola2013-04-302-4/+4
| | | | | | | | | | | The actual storage was already using unsigned, but the interface was using uint64_t. This is wasteful on 32 bits and looks to be the root causes of a miscompilation on Windows where a value was being sign extended to 64bits to compare with the result of getSlotIndex. Patch by Pasi Parviainen! llvm-svn: 180791
* Revert the command line option patch. However, keep the part that makes this ↵Bill Wendling2013-04-292-20/+5
| | | | | | pass on Windows. I.e., we don't emit the target dependent attributes in a comment before the function. llvm-svn: 180750
OpenPOWER on IntegriCloud