Commit Graph

724 Commits

Author SHA1 Message Date
Chris Lattner
b9f08a00af no need to negate the APInt for 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 00:06:25 +00:00
Chris Lattner
159c35b3ee Change m_ConstantInt and m_SelectCst to take their constant integers
as template arguments instead of as instance variables, exposing more
optimization opportunities to the compiler earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:53:12 +00:00
Chris Lattner
06ebbcc71d make m_ConstantInt(int64_t) safely match ConstantInt's that are larger than i64.
This fixes an instcombine crash on PR3235.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:45:50 +00:00
Dan Gohman
d68a07650c Tidy up #includes, deleting a bunch of unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:59:02 +00:00
Chris Lattner
723a59c17e add #include guards, thanks Dan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 01:28:00 +00:00
Misha Brukman
630fcb8678 * Alphabetized system headers per the style guide
* Minor spacing and comment cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 20:26:30 +00:00
Chris Lattner
0401245ab3 newline at end of phile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 06:32:32 +00:00
Chris Lattner
312b9a17e6 pred_iterator got a lot slower since use-diet landed. This is a
really simple cache class for these queries.  Hopefully this can
be removed if pred_iterator speeds back up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 06:27:07 +00:00
Ted Kremenek
d75ba1c357 Have raw_fd_ostream keep track of the position in the file to make tell() go faster by not requiring a flush().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:51:11 +00:00
Ted Kremenek
5984680c1f Add 'tell' method to raw_fd_ostream that clients can use to query the current location in the file the stream is writing to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 03:33:13 +00:00
Nuno Lopes
08d67c7763 change AnnotationManager to use 'const char*' instead of std::string. this fixes the leakage of those strings and avoids the creation of such strings in static cosntructors (should result in a little improvement of startup time)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:00:44 +00:00
Scott Michel
2cd91804ec Roll back rev 59890, since Chris says this can never happen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 19:22:48 +00:00
Scott Michel
bab6436b17 Check for NULL before traversing the isa<> type hierarchy checking with a
NULL-based reference.

Note: Encountered this a few times on Tiger + gcc 4.0.1. Might just be a
platform-specific compiler issue, but it's good defensive programming in any
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 23:49:26 +00:00
Chris Lattner
16062ca93a add a write method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 06:45:06 +00:00
Chris Lattner
a236c89ee3 add a new m_Specific pattern that matches only if we have a specific Value*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:38:30 +00:00
Chris Lattner
67abc10616 add a new template for matching a select between two constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 04:33:10 +00:00
Nick Lewycky
ac44d25bdd Clean up some strange whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 20:32:33 +00:00
Daniel Dunbar
0d9eb9b491 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 05:01:07 +00:00
Anton Korobeynikov
476527a19d Symbol visibility is unsupported on cygwin too.
Patch by Jay Foad!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 18:05:01 +00:00
Dan Gohman
1975d03183 Canonicalize sext(i1) to i1?-1:0, and update various instcombine
optimizations accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 20:40:10 +00:00
Bill Wendling
a872aae731 Revert r58411. The user needs to #define this when using the JITMemoryManager.h header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 01:22:58 +00:00
Bill Wendling
fb309cb2d6 Revert part of r58048. It was breaking on SnowLeopard claiming that
"__STDC_CONSTANT_MACROS" needs to be #defined first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 00:11:55 +00:00
Dan Gohman
5a9a4bf7f2 Fix the name of the include guard to match the filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 00:52:46 +00:00
Oscar Fuentes
cd6213233e CMake: Sync'ed DataTypes.h.cmake with DataTypes.h.in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58131 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 03:25:11 +00:00
Ted Kremenek
43d1f02b54 Added raw_fd_ostream::close().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 23:49:09 +00:00
Steve Naroff
93fbe75a94 Changes to make the Windows build work...
- Add a file to the VC++ project.
- Make sure the clang driver links against the Transforms library.
- Incorporate changes from patch by Dan Gohman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58048 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 23:28:23 +00:00
Argyrios Kyrtzidis
39ac2cbcd8 Introduce INT64_C macro and unbreak LLVM on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 17:20:39 +00:00
Daniel Dunbar
48534b31d8 Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 19:53:10 +00:00
Daniel Dunbar
76dba94dfa Rename IRBuilder::IsNonNull -> IsNotNull in response to feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 17:05:03 +00:00
Daniel Dunbar
7a3ec1e148 Add IRBuilder::{CreateIsNull, CreateIsNonNull} helper methods.
- I'm open to the idea that these could have better names. I think
   these read better than CreateEQNull and CreateNENull.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 23:22:55 +00:00
Devang Patel
0598866c05 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:45 +00:00
Devang Patel
eaf42abab6 s/ParameterAttributes/Attributes/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:03:40 +00:00
Oscar Fuentes
3d01fc7de8 Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 01:08:49 +00:00
Nuno Lopes
5b8dbf839b plug memleak: destroy internal buffer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 12:06:08 +00:00
Evan Cheng
1505cdbcea Add DebugInfoBuilder. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 06:51:14 +00:00
Ted Kremenek
4ac67ef47a Grammar fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 16:41:15 +00:00
Ted Kremenek
3d4866e683 Added "str()" method to raw_string_ostream.
str() mirrors the same method in std::ostringstream.
str() flushes the buffered stream contents to string and returns a reference to the string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 16:34:01 +00:00
Chris Lattner
78a2812538 Add raw_stream adaptors that write into an std::string and SmallVector/SmallString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:43:04 +00:00
Chris Lattner
944fac71e0 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:23:09 +00:00
Chris Lattner
b2560526d5 Split format() out to its own file, add support for formatting
up to three values in one call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:48:00 +00:00
Chris Lattner
0958ab0fd1 conditionalize this to work on windows, untested but it should work
according to the intarnetz


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:27:03 +00:00
Chris Lattner
097af7fc8f add a simple mechanism for formatted output. This gives raw_ostream's
all the power and risk of fprintf format strings.  Use them like this:

  OS << format("%10.4f", 42.0) << "\n" << format("%x", 42) << '\n';



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:23:10 +00:00
Nicolas Geoffray
f46dc79ac5 Also overload for char, since the "char" type depends on the host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55173 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 08:44:47 +00:00
Owen Anderson
1f83b02c62 Overload for both signed and unsigned char.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 07:42:25 +00:00
Owen Anderson
66b17ba0d2 Move non-trivial methods out of line to avoid code-size bloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 20:58:52 +00:00
Owen Anderson
89a1a85913 Implement operator<< in terms of basic types rather than [u]int*_t, which is better for portability. There might be some way to factor this all with metaprogramming magic, but I'm not sure how offhand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 06:20:47 +00:00
Eli Friedman
afc802dc7d Remove size_t operator; this unbreaks the build on Linux. Committing on
the suggestion of resistor.

If this breaks some other platform, please go ahead and back this out.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 04:28:31 +00:00
Owen Anderson
cb37188323 Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:14:44 +00:00
Chris Lattner
071acf4279 add raw_ostream method for emitting an unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:23:02 +00:00
Gordon Henriksen
8715367182 Don't require Registry specializations to define random static variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:08:34 +00:00