summaryrefslogtreecommitdiff
path: root/lib/IR
Commit message (Collapse)AuthorAge
* Make sure that if we're going to attempt to add a type to a DIE thatEric Christopher2013-08-08
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187963 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more rigorous about the sizes of forms and attributes.Eric Christopher2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187953 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187812 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a AttributeSetImpl::dump function.Peter Collingbourne2013-08-02
| | | | | | | This is for the benefit of those of us with inferior debuggers which do not permit member function calls on value types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187685 91177308-0d34-0410-b5e6-96231b3b80d8
* Make one of the AttributeSet ctors maintain the invariant that thePeter Collingbourne2013-08-02
| | | | | | | | attribute list is ordered by index. Differential Revision: http://llvm-reviews.chandlerc.com/D1265 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187682 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached toEric Christopher2013-08-02
| | | | | | | | instructions." in an attempt to bring back some bots. This reverts commit r187609. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187638 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187609 91177308-0d34-0410-b5e6-96231b3b80d8
* Reject bitcasts between address spaces with different sizesMatt Arsenault2013-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187506 91177308-0d34-0410-b5e6-96231b3b80d8
* Add parentheses to silence gcc warning.Richard Trieu2013-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187482 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ptr vector inconsistency in CreatePointerCastMatt Arsenault2013-07-31
| | | | | | | | One form would accept a vector of pointers, and the other did not. Make both accept vectors of pointers, and add an assertion for the number of elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187464 91177308-0d34-0410-b5e6-96231b3b80d8
* Respect address space sizes in isEliminableCastPair.Matt Arsenault2013-07-30
| | | | | | | This avoids constant folding bitcast/ptrtoint/inttoptr combinations that have illegal bitcasts between differently sized address spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187455 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove isCastable since nothing uses it now"Matt Arsenault2013-07-30
| | | | | | Apparently dragonegg uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187454 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove isCastable since nothing uses it nowMatt Arsenault2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187448 91177308-0d34-0410-b5e6-96231b3b80d8
* Change behavior of calling bitcasted alias functions.Matt Arsenault2013-07-30
| | | | | | | | It will now only convert the arguments / return value and call the underlying function if the types are able to be bitcasted. This avoids using fp<->int conversions that would occur before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187444 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code simplification suggested by DuncanMatt Arsenault2013-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187309 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: verify SPs in llvm.dbg.sp.Manman Ren2013-07-27
| | | | | | | | | Also always add DIType, DISubprogram and DIGlobalVariable to the list in DebugInfoFinder without checking them, so we can verify them later on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187285 91177308-0d34-0410-b5e6-96231b3b80d8
* Use more parens to clarify assert.Eric Christopher2013-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187247 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: enable verification of DICompileUnit.Manman Ren2013-07-26
| | | | | | | | | We used to call Verify before adding DICompileUnit to the list, and now we remove the check and always add DICompileUnit to the list in DebugInfoFinder, so we can verify them later on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187237 91177308-0d34-0410-b5e6-96231b3b80d8
* Collapse conditional and add an assert for unhandled scope types.Eric Christopher2013-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187224 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add DataLayout pointer size convenience functions.Matt Arsenault2013-07-26
| | | | | | | | These were reverted in r167222 along with the rest of the last different address space pointer size attempt. These will be used in later commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187223 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to get the context of any particular scope.Eric Christopher2013-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187212 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: update comments and add a FIXME.Manman Ren2013-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187157 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: improve the verifier to check field types.Manman Ren2013-07-25
| | | | | | | | Make sure the context field of DIType is MDNode. Fix testing cases to make them pass the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187150 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a way to add a kind-value string pair to an attribute.Bill Wendling2013-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187138 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: improve the verifier to check field types.Manman Ren2013-07-25
| | | | | | | | | Make sure the context and type fields are MDNodes. We will generate verification errors if those fields are non-empty strings. Fix testing cases to make them pass the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187106 91177308-0d34-0410-b5e6-96231b3b80d8
* Make these methods const correct.Rafael Espindola2013-07-25
| | | | | | Thanks to Nick Lewycky for noticing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187098 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.Bill Wendling2013-07-25
| | | | | | | | | There's no need to specify a flag to omit frame pointer elimination on non-leaf nodes...(Honestly, I can't parse that option out.) Use the function attribute stuff instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187093 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: improve the Finder.Manman Ren2013-07-24
| | | | | | | | Improve the Finder to handle context of a DIVariable used by DbgValueInst. Fix testing cases to make them pass the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187052 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace with a "null" RAUW with an assert since we'd actually likeEric Christopher2013-07-24
| | | | | | to assume we're replacing. Clarify comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187018 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187017 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary constructors as the default conversions will handleEric Christopher2013-07-24
| | | | | | | all enumerated cases. Reformat the rest of the existing constructors to match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187015 91177308-0d34-0410-b5e6-96231b3b80d8
* More constructor cleanup.Eric Christopher2013-07-24
| | | | | | | Move to a single constructor with a default argument and avoid the check and nullification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187014 91177308-0d34-0410-b5e6-96231b3b80d8
* Collapse logic and move and reword comment for clarity.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187013 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a fixme and reformat.Eric Christopher2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187012 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: improve the Finder.Manman Ren2013-07-23
| | | | | | | | Improve the Finder to handle context of a DIVariable. If Scope is a DICompileUnit, add it to the list of CUs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187003 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: clean up.Manman Ren2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187002 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused function.Eric Christopher2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187001 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: code cleanup, use getNodeField if possible.Manman Ren2013-07-23
| | | | | | | | Use getNodeField to access a field as a MDNode. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186985 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo Verifier: verify the actual type.Manman Ren2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186972 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder: use processDeclare and processValue to list debug infoManman Ren2013-07-23
| | | | | | | | | | | | MDNodes used by DbgDeclareInst and DbgValueInst. Another 16 testing cases failed and they are disabled with -disable-debug-info-verifier. A total of 34 cases are disabled with -disable-debug-info-verifier and will be corrected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186902 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder: add processScope to actually handle the Scope.Manman Ren2013-07-22
| | | | | | | Instead of just adding the scope to the list, we actually handle the scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186867 91177308-0d34-0410-b5e6-96231b3b80d8
* Disallow global aliases to bitcast between address spacesMatt Arsenault2013-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186767 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespace, fix file path in commentMatt Arsenault2013-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186766 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: simplify DIxxx::VerifyManman Ren2013-07-20
| | | | | | | | | Simplify DIxxx:Verify to not call Verify on an operand. Instead, we use DebugInfoFinder to list all MDNodes that should be a DIScope and all MDNodes that should be a DIType and we will call Verify on those lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186737 91177308-0d34-0410-b5e6-96231b3b80d8
* s/compiler_used/compiler.used/.Rafael Espindola2013-07-19
| | | | | | | We were incorrectly using compiler_used instead of compiler.used. Unfortunately the passes using the broken name had tests also using the broken name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186705 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove DIBuilder cache of variable TheCU and change the fewEric Christopher2013-07-19
| | | | | | | uses that wanted it. Also change the interface for createCompileUnit to compensate. Fix comments that refer to TheCU as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186637 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: enable verifying by default and disable testing cases that fail.Manman Ren2013-07-19
| | | | | | | | | | | | | | | | | | | | 1> Use DebugInfoFinder to find debug info MDNodes. 2> Add disable-debug-info-verifier to disable verifying debug info. 3> Disable verifying for testing cases that fail (will update the testing cases later on). 4> MDNodes generated by clang can have empty filename for TAG_inheritance and TAG_friend, so DIType::Verify is modified accordingly. Note that DebugInfoFinder does not list all debug info MDNode. For example, clang can generate: metadata !{i32 786468}, which will fail to verify. This MDNode is used by debug info but not included in DebugInfoFinder. This MDNode is generated as a temporary node in DIBuilder::createFunction Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) }; MDNode::getTemporary(VMContext, TElts) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186634 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove DIBuilder cache of variable TheCU and change the few"Eric Christopher2013-07-18
| | | | | | This reverts commit r186599 as I didn't want to commit this yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186601 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove DIBuilder cache of variable TheCU and change the fewEric Christopher2013-07-18
| | | | | | | uses that wanted it. Also change the interface for createCompileUnit to compensate. Fix comments that refer to TheCU as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186599 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getModuleFlag(StringRef Key) to query a module flag given Key.Manman Ren2013-07-16
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186470 91177308-0d34-0410-b5e6-96231b3b80d8