summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."Andrew Trick2013-09-192-98/+74
| | | | | | | | Working on a better solution to this. This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2. llvm-svn: 190990
* Encapsulate PassManager debug flags to avoid static init and cxa_exit.Andrew Trick2013-09-182-74/+98
| | | | | | | | | | | | | | This puts all the global PassManager debugging flags, like -print-after-all and -time-passes, behind a managed static. This eliminates their static initializers and, more importantly, exit-time destructors. The only behavioral change I anticipate is that tools need to initialize the PassManager before parsing the command line in order to export these options, which makes sense. Tools that already initialize the standard passes (opt/llc) don't need to do anything new. llvm-svn: 190974
* whitespaceAndrew Trick2013-09-182-22/+22
| | | | llvm-svn: 190973
* MemCpyOptimizer: Use max legal int size instead of pointer sizeMatt Arsenault2013-09-161-0/+7
| | | | | | | | | | | | If there are no legal integers, assume 1 byte. This makes more sense than using the pointer size as a guess for the maximum GPR width. It is conceivable to want to use some 64-bit pointers on a target where 64-bit integers aren't legal. llvm-svn: 190817
* Implement function prefix data as an IR feature.Peter Collingbourne2013-09-164-0/+48
| | | | | | | | | Previous discussion: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html Differential Revision: http://llvm-reviews.chandlerc.com/D1191 llvm-svn: 190773
* Debug Info: move class definition of DIRef.Manman Ren2013-09-111-4/+0
| | | | | | | | | | | Definition of DIRef used to require the full definition of DIType because of usage of DIType::isType in DIRef::resolve. We now use DIDescriptor::isType instead to remove the requirement and move definition of DIRef before DIType. With this, we can move the definition of DIType::getContext to the header file. llvm-svn: 190540
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-115-29/+29
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-115-29/+29
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Debug Info: define a DIRef template.Manman Ren2013-09-101-22/+19
| | | | | | | | | | | | | Specialize the constructors for DIRef<DIScope> and DIRef<DIType> to make sure the Value is indeed a scope ref and a type ref. Use DIScopeRef for DIScope::getContext and DIType::getContext and use DITypeRef for getContainingType and getClassType. DIScope::generateRef now returns a DIScopeRef instead of a "Value *" for readability and type safety. llvm-svn: 190418
* Debug Info: In DIBuilder, the context fields of a TAG_inheritance and aManman Ren2013-09-091-2/+2
| | | | | | | | TAG_friend are updated to use scope reference. Added testing cases to verify that class with inheritance can be uniqued. llvm-svn: 190364
* Debug Info: move DIScope::getContext back from DwarfDebug.Manman Ren2013-09-091-0/+23
| | | | | | | | This partially reverts r190330. DIScope::getContext now returns DIScopeRef instead of DIScope. We construct a DIScopeRef from DIScope when we are dealing with subprogram, lexical block or name space. llvm-svn: 190362
* Debug Info: Use DIScopeRef for DIType::getContext.Manman Ren2013-09-093-5/+13
| | | | | | | | | | | | | | | | | In DIBuilder, the context field of a TAG_member is updated to use the scope reference. Verifier is updated accordingly. DebugInfoFinder now needs to generate a type identifier map to have access to the actual scope. Same applies for BreakpointPrinter. processModule of DebugInfoFinder is called during initialization phase of the verifier to make sure the type identifier map is constructed early enough. We are now able to unique a simple class as demonstrated by the added testing case. llvm-svn: 190334
* Debug Info: move DIScope::getContext to DwarfDebug.Manman Ren2013-09-091-23/+0
| | | | | | | | | | | | DIScope::getContext is a wrapper function that calls the specific getContext method on each subclass. When we switch DIType::getContext to return DIScopeRef instead of DIScope, DIScope::getContext can no longer return a DIScope without a type identifier map. DIScope::getContext is only used by DwarfDebug, so we move it to DwarfDebug to have easy access to the type identifier map. llvm-svn: 190330
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-092-47/+8
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 llvm-svn: 190328
* Debug Info: Move isSubprogramContext from DebugInfo to DwarfDebug.Manman Ren2013-09-091-13/+0
| | | | | | | | | | This helper function needs the type identifier map when we switch DIType::getContext to return DIScopeRef instead of DIScope. Since isSubprogramContext is used by DwarfDebug only, We move it to DwarfDebug to have easy access to the map. llvm-svn: 190325
* Debug Info: Rename DITypeRef to DIScopeRef.Manman Ren2013-09-091-24/+30
| | | | | | | | | | | | | | | | | | | | | | A reference to a scope is more general than a reference to a type since DIType is a subclass of DIScope. A reference to a type can be either an identifier for the type or the DIType itself, while a reference to a scope can be either an identifier for the type (when the scope is indeed a type) or the DIScope itself. A reference to a type and a reference to a scope will be resolved in the same way. The only difference is in the verifier when a field is a reference to a type (i.e. the containing type field of a DICompositeType) or a field is a reference to a scope (i.e. the context field of a DIType). This is to get ready for switching DIType::getContext to return DIScopeRef instead of DIScope. Tighten up isTypeRef and isScopeRef to make sure the identifier is not empty and the MDNode is DIType for TypeRef and DIScope for ScopeRef. llvm-svn: 190322
* Debug Info: Update isScope to make sure DIType is a scope andManman Ren2013-09-091-1/+2
| | | | | | TAG_file_type is also a scope. llvm-svn: 190321
* Revert r190269 to fix dragonegg failures.Manman Ren2013-09-081-1/+1
| | | | llvm-svn: 190271
* Debug Info: use null instead of "i32 0" in DIBuilder.Manman Ren2013-09-081-13/+5
| | | | | | For context field of subroutine_type and when creating artificial types. llvm-svn: 190270
* Debug Info: pass in DIScope instead of DIDescriptor in createMemberType.Manman Ren2013-09-081-1/+1
| | | | | | Improve readability. No functionality change. llvm-svn: 190269
* Remove verifier check that attribute 'builtin' is only applied to calls toRichard Smith2013-09-071-8/+0
| | | | | | | | functions marked 'nobuiltin'. That approach doesn't play well with LTO, and there's no harm in marking a call as 'builtin' if it was going to be a builtin regardless. llvm-svn: 190233
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-072-2/+2
| | | | | | | | a DISubprogram. Verifier is updated accordingly. llvm-svn: 190229
* Debug Info: pass in VTableHolder as DIType instead of MDNode *.Manman Ren2013-09-061-5/+5
| | | | | | Remove one cast and improve readability. No functionality change. llvm-svn: 190225
* Debug Info: Use identifier to reference DIType in containing type field ofManman Ren2013-09-062-4/+4
| | | | | | | | a DICompositeType. Verifier is updated accordingly. llvm-svn: 190190
* Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be partManman Ren2013-09-062-13/+12
| | | | | | | | | | | of DIType. Implement DIType::generateRef to return a type reference. This function will be used in setContaintingType and in DIBuilder to generete the type reference. No functionality change. llvm-svn: 190188
* Debug Info: Use identifier to reference DIType in base type field ofManman Ren2013-09-052-3/+83
| | | | | | | | | | | | | | | | | | | | | | ptr_to_member. We introduce a new class DITypeRef that represents a reference to a DIType. It wraps around a Value*, which can be either an identifier in MDString or an actual MDNode. The class has a helper function "resolve" that finds the actual MDNode for a given DITypeRef. We specialize getFieldAs to return a field that is a reference to a DIType. To correctly access the base type field of ptr_to_member, getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef. Also add a typedef for DITypeIdentifierMap and a helper generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually populate the map. Verifier is updated accordingly. llvm-svn: 190081
* DIBuilder: retain a type when created with a unique identifier.Manman Ren2013-08-291-3/+23
| | | | | | | | | | | | | | | createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will retain a type when created with a unique identifier, to make sure they are treated as used even when all uses are replaced with the identifiers. Use TrackingVH<MDNode> instead of MDNode in AllRetainTypes, since the created node can later be updated. The change will be tested when clients of DIBuilder start to pass in non-empty unique identifier. llvm-svn: 189621
* Period.David Blaikie2013-08-281-2/+2
| | | | llvm-svn: 189513
* r189495: Pull out some debug logic into a function for legibilityDavid Blaikie2013-08-281-13/+18
| | | | | | Code review feedback from Eric Christopher. llvm-svn: 189512
* PR16995: DebugInfo: Don't overwrite existing member lists when adding ↵David Blaikie2013-08-281-1/+18
| | | | | | | | | template arguments With the added debug assertions this fix is covered by existing Clang tests. (& found some other issues, also fixed) llvm-svn: 189495
* DIBuilder: take an optional StringRef to pass in unique identifier.Manman Ren2013-08-271-10/+14
| | | | | | | | createClassType, createStructType, createUnionType, createEnumerationType, and createForwardDecl will take an optional StringRef to pass in the unique identifier. llvm-svn: 189410
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-262-10/+37
| | | | | | | | | | | | | | | | | | DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. llvm-svn: 189282
* Fix a bug where we would corrupt the offset when evaluatingChandler Carruth2013-08-251-1/+3
| | | | | | | | | | | a non-constant GEP. I don't have any test case that demonstrates this, Nadav (indirectly) pointed this out in code review. I'm not sure how possible it is to contrive a test case for the current users of this code that triggers the bad issue sadly. llvm-svn: 189188
* DebugInfoFinder: handle imported entities of a CU.Manman Ren2013-08-241-0/+12
| | | | llvm-svn: 189158
* DebugInfoFinder: handle template params of a DISubprogram.Manman Ren2013-08-231-0/+13
| | | | llvm-svn: 189131
* Add function attribute 'optnone'.Andrea Di Biagio2013-08-232-1/+20
| | | | | | | | This function attribute indicates that the function is not optimized by any optimization or code generator passes with the exception of interprocedural optimization passes. llvm-svn: 189101
* Add a new helper method to Value to strip in-bounds constant offsets ofChandler Carruth2013-08-221-0/+34
| | | | | | | | | | | pointers, but accumulate the offset into an APInt in the process of stripping it. This is a pretty handy thing to have, such as when trying to determine if two pointers are at some constant relative offset. I'll be committing a patch shortly to use it for exactly that purpose. llvm-svn: 189000
* Introduce non-const overloads for GlobalAlias::{get,resolve}AliasedGlobal.Peter Collingbourne2013-08-191-8/+8
| | | | llvm-svn: 188725
* DebugInfo: Allow the addition of other (such as static data) members to a ↵David Blaikie2013-08-162-6/+7
| | | | | | | | record type after construction Plus a type cleanup & minor fix to enumerate members of declarations. llvm-svn: 188577
* [Mips][msa] Value types for MSA support.Jack Carter2013-08-131-0/+2
| | | | | | | | | Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, and CodeGenTarget.cpp Patch by Daniel Sanders llvm-svn: 188326
* DebugInfo: provide the ability to add members to a class after it has been ↵David Blaikie2013-08-091-0/+13
| | | | | | | | | | constructed This is necessary to allow Clang to only emit implicit members when there is code generated for them, rather than whenever they are ODR used. llvm-svn: 188082
* Make sure that if we're going to attempt to add a type to a DIE thatEric Christopher2013-08-082-1/+6
| | | | | | | | | | | | the type exists. Fix up cases where we weren't checking for optional types and add an assert to addType to make sure we catch this in the future. Fix up a testcase that was using the tag for DW_TAG_array_type when it meant DW_TAG_enumeration_type. llvm-svn: 187963
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-081-2/+2
| | | | llvm-svn: 187953
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-062-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. Re-apply r187609 with fix to pass ocaml binding. vmcore.ml generates a debug location with scope being metadata !{}, in verifier we treat this as a null scope. llvm-svn: 187812
* Add a AttributeSetImpl::dump function.Peter Collingbourne2013-08-022-0/+6
| | | | | | | This is for the benefit of those of us with inferior debuggers which do not permit member function calls on value types. llvm-svn: 187685
* Make one of the AttributeSet ctors maintain the invariant that thePeter Collingbourne2013-08-022-2/+29
| | | | | | | | attribute list is ordered by index. Differential Revision: http://llvm-reviews.chandlerc.com/D1265 llvm-svn: 187682
* Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached toEric Christopher2013-08-022-7/+16
| | | | | | | | instructions." in an attempt to bring back some bots. This reverts commit r187609. llvm-svn: 187638
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-012-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. llvm-svn: 187609
* Reject bitcasts between address spaces with different sizesMatt Arsenault2013-07-311-20/+104
| | | | llvm-svn: 187506
* Add parentheses to silence gcc warning.Richard Trieu2013-07-311-4/+4
| | | | llvm-svn: 187482
OpenPOWER on IntegriCloud