summaryrefslogtreecommitdiff
path: root/unittests/VMCore
Commit message (Collapse)AuthorAge
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
* Update cmake build.Benjamin Kramer2012-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161297 91177308-0d34-0410-b5e6-96231b3b80d8
* Postpone the deletion of the old name in StructType::setName to allow using ↵Benjamin Kramer2012-08-04
| | | | | | | | a slice of the old name. Fixes PR13522. Add a rudimentary unit test to exercise the behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161296 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for attaching branch weight metadata directly from the IRBuilder.Chandler Carruth2012-07-16
| | | | | | | | | Added a basic unit test for this with CreateCondBr. I didn't go all the way and test the switch side as the boilerplate for setting up the switch IRBuilder unit tests is a lot more. Fortunately, the two share all the interesting code paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160251 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a boring bit of boilerplate to start testing IRBuilder::CreateCondBr.Chandler Carruth2012-07-16
| | | | | | | This is in anticipation of changing CreateCondBr and wanting to test those changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160250 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the IRBuilder unittest from Support to VMCore. This got missed inChandler Carruth2012-07-16
| | | | | | the original move of IRBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160249 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completesChandler Carruth2012-07-15
| | | | | | | | | | | | the move of *Builder classes into the Core library. No uses of this builder in Clang or DragonEgg I could find. If there is a desire to have an IR-building-support library that contains all of these builders, that can be easily added, but currently it seems likely that these add no real overhead to VMCore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160243 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live withChandler Carruth2012-07-15
| | | | | | | | | | | IRBuilder, DIBuilder, etc. This is the proper layering as MDBuilder can't be used (or implemented) without the Core Metadata representation. Patches to Clang and Dragonegg coming up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160237 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-29
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests: Simplify LINK_COMPONENTS.NAKAMURA Takumi2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158942 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.NAKAMURA Takumi2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158941 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for the special 'fast' value for fpmath accuracy for the moment.Duncan Sands2012-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154850 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to indicate relaxed floating point requirements at the IR levelDuncan Sands2012-04-16
| | | | | | | | | | through the use of 'fpmath' metadata. Currently this only provides a 'fpaccuracy' value, which may be a number in ULPs or the keyword 'fast', however the intent is that this will be extended with additional information about NaN's, infinities etc later. No optimizations have been hooked up to this so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154822 91177308-0d34-0410-b5e6-96231b3b80d8
* I noticed in passing that the Metadata getIfExists method was creating a newDuncan Sands2012-03-31
| | | | | | | node and returning it if one didn't exist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153798 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle unreachable code in the dominates functions. This changes users whenRafael Espindola2012-03-30
| | | | | | | needed for correctness, but still doesn't clean up code that now unnecessary checks for reachability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153755 91177308-0d34-0410-b5e6-96231b3b80d8
* Undo the hack in r147427 and move this unittest to a better home. ThisChandler Carruth2012-01-02
| | | | | | | | | | | | | | | is testing the bitcode reader's functionality, not VMCore's. Add the what is a hope sufficient build system mojo to build and run a new unittest. Also clean up some of the test's naming. The goal for the file should be to unittest the Bitcode Reader, and this is just one particular test among potentially many in the future. Also, reverse my position and relegate the PR# to a comment, but stash the comment on the same line as the test name so it doesn't get lost. This makes the code more self-documenting hopefully w/o losing track of the PR number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147431 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unittest makefile after r147425. This should unbreak the makefileChandler Carruth2012-01-02
| | | | | | | | | | | build. This didn't show up in the CMake build because the CMake build for the unittests is rather poorly factored. This probably isn't the correct fix. This should be a bitcode reader unittest not a VMCore unittest. I'll move it and clean various parts of the unittest up in a follow-up patch, but I wanted to unbreak the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147427 91177308-0d34-0410-b5e6-96231b3b80d8
* Materialize functions whose basic blocks are used by global variables. FixesRafael Espindola2012-01-02
| | | | | | PR11677. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147425 91177308-0d34-0410-b5e6-96231b3b80d8
* re-enable unittestDylan Noblesmith2011-12-12
| | | | | | Accidentally left out since r145214/r145217. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146356 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for vectors of pointers.Nadav Rotem2011-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix C++0x narrowing errors when char is unsigned.Jeffrey Yasskin2011-08-30
| | | | | | | In the case of EDInstInfo, this would actually cause a bug when -1 became 255 and was then compared >=0 in llvm-mc/Disassembler.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138825 91177308-0d34-0410-b5e6-96231b3b80d8
* The 'expected' argument to EXPECT_EQ is actually the first one;John McCall2011-08-27
| | | | | | | | flip these tests around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138708 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-12
| | | | | | StructType::get() and TargetData::getIntPtrType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
* De-constify Types in FunctionType::get().Jay Foad2011-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Revamp the "ConstantStruct::get" methods. Previously, these were scatteredChris Lattner2011-06-20
| | | | | | | | | | | | | | | | | all over the place in different styles and variants. Standardize on two preferred entrypoints: one that takes a StructType and ArrayRef, and one that takes StructType and varargs. In cases where there isn't a struct type convenient, we now add a ConstantStruct::getAnon method (whose name will make more sense after a few more patches land). It would be "really really nice" if the ConstantStruct::get and ConstantVector::get methods didn't make temporary std::vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach getCastOpcode about element-by-element vector casts. For example, "trunc"Duncan Sands2011-05-18
| | | | | | | | | | | | | | can be used to turn a <4 x i64> into a <4 x i32> but getCastOpcode would assert if you passed these types to it. Note that this strictly extends the previous functionality: if getCastOpcode previously accepted two vector types (i.e. didn't assert) then it still will and returns the same opcode (BitCast). That's because before it would only accept vectors with the same bitwidth, and the new code only touches vectors with the same length. However if two vectors have both the same bitwidth and the same length then their element types have the same bitwidth, so the new logic will return BitCast as before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131530 91177308-0d34-0410-b5e6-96231b3b80d8
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129932 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
* While testing dragonegg I noticed that isCastable and getCastOpcodeDuncan Sands2011-04-01
| | | | | | | | | had gotten out of sync: isCastable didn't think it was possible to cast the x86_mmx type to anything, while it did think it possible to cast an i64 to x86_mmx. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128705 91177308-0d34-0410-b5e6-96231b3b80d8
* Strip trailing whitespace.Duncan Sands2011-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128622 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow unnamed_addr on declarations.Rafael Espindola2011-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123529 91177308-0d34-0410-b5e6-96231b3b80d8
* Reject uses of unnamed_addr in declarations.Rafael Espindola2011-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123358 91177308-0d34-0410-b5e6-96231b3b80d8
* First step in fixing PR8927:Rafael Espindola2011-01-08
| | | | | | | | | | | | | | | | | | | Add a unnamed_addr bit to global variables and functions. This will be used to indicate that the address is not significant and therefore the constant or function can be merged with others. If an optimization pass can show that an address is not used, it can set this. Examples of things that can have this set by the FE are globals created to hold string literals and C++ constructors. Adding unnamed_addr to a non-const global should have no effect unless an optimization can transform that global into a constant. Aliases are not allowed to have unnamed_addr since I couldn't figure out any use for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123063 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the "ugly" method BranchInst::setUnconditionalDest().Jay Foad2011-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123026 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.Chris Lattner2010-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 119600 to unbreak the build. Francois, please investigate.Jim Grosbach2010-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119606 91177308-0d34-0410-b5e6-96231b3b80d8
* Appease MSVC 2008: you can't use keyword this inside EXPECT_EQ().Francois Pichet2010-11-18
| | | | | | This is because of bug 331418 on Microsoft Connect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119600 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ValueMapTest from ADT to VMCore so that ADT doesn't needDan Gohman2010-09-27
| | | | | | | to link in "core". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114831 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefix `next' iterator operation with `llvm::'.Oscar Fuentes2010-08-02
| | | | | | | | | Fixes potential ambiguity problems on VS 2010. Patch by nobled! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
* Make NamedMDNode not be a subclass of Value, and simplify the interfaceDan Gohman2010-07-21
| | | | | | | for creating and populating NamedMDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
* unit test to go along with r108610Chris Lattner2010-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108611 91177308-0d34-0410-b5e6-96231b3b80d8