Michael J. Spencer
4781534e1c
Fix spelling.
...
llvm-svn: 122244
2010-12-20 13:30:37 +00:00
Chris Lattner
4ce6f60782
add a version of IRBuilder::SetInsertPoint that takes an instruction.
...
llvm-svn: 122180
2010-12-19 19:16:22 +00:00
Michael J. Spencer
0e0c7c269f
Support/PathV1: Clarify deprecation warning.
...
llvm-svn: 122159
2010-12-18 22:23:24 +00:00
Michael J. Spencer
4701f704be
Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
...
llvm-svn: 122157
2010-12-18 22:23:07 +00:00
Eric Christopher
4e2b6c0e28
Header warning patrol.
...
llvm-svn: 122152
2010-12-18 10:54:29 +00:00
Owen Anderson
7103acd18e
Revert r122143 through r122140, which collectively broke the LLVMC tests on
...
the buildbots.
llvm-svn: 122149
2010-12-18 07:37:18 +00:00
Michael J. Spencer
b70c703b01
Support/PathV1: Clarify deprecation warning.
...
llvm-svn: 122143
2010-12-18 04:13:54 +00:00
Michael J. Spencer
6d64a36ced
Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
...
llvm-svn: 122141
2010-12-18 04:13:36 +00:00
Michael J. Spencer
bb238417bb
Support/PathV1: Deprecate getLast.
...
llvm-svn: 122116
2010-12-18 00:19:10 +00:00
Owen Anderson
702d715185
Add support to CallbackVH to receive notification when a Value's use-list changes.
...
llvm-svn: 122114
2010-12-18 00:07:15 +00:00
Michael J. Spencer
bc84ff581f
Fix 80 col.
...
llvm-svn: 122089
2010-12-17 21:32:47 +00:00
Michael J. Spencer
f2bf8518fb
Support/Path: Deprecate PathV1::isAbsolute.
...
llvm-svn: 122086
2010-12-17 21:21:31 +00:00
Benjamin Kramer
89db30db3a
Pass StringRefs by value, for consistency.
...
llvm-svn: 122074
2010-12-17 18:19:06 +00:00
Michael J. Spencer
63aaa03399
Support: Rename Path.h to PathV1.h and add a new Path.h that includes both V1 and V2.
...
llvm-svn: 122065
2010-12-17 17:22:36 +00:00
Chris Lattner
e92f8121d4
improve switch formation to handle small range
...
comparisons formed by comparisons. For example,
this:
void foo(unsigned x) {
if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6)
bar();
}
compiles into:
_foo: ## @foo
## BB#0: ## %entry
cmpl $6, %edi
ja LBB0_2
## BB#1: ## %entry
movl %edi, %eax
movl $91, %ecx
btq %rax, %rcx
jb LBB0_3
instead of:
_foo: ## @foo
## BB#0: ## %entry
cmpl $2, %edi
jb LBB0_4
## BB#1: ## %switch.early.test
cmpl $6, %edi
ja LBB0_3
## BB#2: ## %switch.early.test
movl %edi, %eax
movl $88, %ecx
btq %rax, %rcx
jb LBB0_4
This catches a bunch of cases in GCC, which look like this:
%804 = load i32* @which_alternative, align 4, !tbaa !0
%805 = icmp ult i32 %804, 2
%806 = icmp eq i32 %804, 3
%or.cond121 = or i1 %805, %806
%807 = icmp eq i32 %804, 4
%or.cond124 = or i1 %or.cond121, %807
br i1 %or.cond124, label %.thread, label %808
turning this into a range comparison.
llvm-svn: 122045
2010-12-17 06:20:15 +00:00
Michael J. Spencer
86f6a9ac6e
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
...
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Rafael Espindola
37a22419ce
Typo.
...
llvm-svn: 121906
2010-12-15 22:33:06 +00:00
Rafael Espindola
102a0b7b74
Generalize an assert.
...
llvm-svn: 121851
2010-12-15 07:12:24 +00:00
Nick Lewycky
0177564114
Remove dead header.
...
llvm-svn: 121463
2010-12-10 05:12:54 +00:00
Michael J. Spencer
95b8bf9f67
Fix whitespace.
...
llvm-svn: 121382
2010-12-09 17:37:32 +00:00
Michael J. Spencer
1d95a8f9bc
Support/FileSystem: Change file_status predicate functions that cannot fail to
...
return their result instead of an error_code. Also add some missing predicate
functions.
llvm-svn: 121380
2010-12-09 17:37:02 +00:00
Michael J. Spencer
15483143ec
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
...
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Michael J. Spencer
3885add959
Support: Remove Alarm. It is unused (via local grep and google code search).
...
llvm-svn: 121160
2010-12-07 18:41:59 +00:00
Michael J. Spencer
3dc94b3cc1
Support/PathV2: Remove const from bool return types.
...
llvm-svn: 121157
2010-12-07 18:12:07 +00:00
Michael J. Spencer
cda94ff1f3
Fix spelling.
...
llvm-svn: 121156
2010-12-07 18:11:54 +00:00
Michael J. Spencer
a679d9b91b
Support: Remove DynamicLinker.h. It is unused and unimplemented.
...
llvm-svn: 121155
2010-12-07 18:11:38 +00:00
Michael J. Spencer
7979bb402f
Support/PathV2: Change most functions in the path namespace to return their work
...
via their return value instead of an out parameter.
llvm-svn: 121149
2010-12-07 17:04:04 +00:00
Michael J. Spencer
a96fe51fa6
Support/PathV2: Remove the error_code return type from all functions in the path
...
namespace. None of them return anything except for success anyway. These will be
converted to returning their result soon.
llvm-svn: 121109
2010-12-07 03:57:37 +00:00
Michael J. Spencer
7c3efd63d4
Support/PathV2: Move make_absolute from path to fs.
...
llvm-svn: 121108
2010-12-07 03:57:17 +00:00
Michael J. Spencer
a59a7b3965
Support/PathV2: Clarify and correct documentation.
...
llvm-svn: 121091
2010-12-07 01:23:08 +00:00
Michael J. Spencer
898af0f235
Support/PathV2: Move current_path from path to fs and fix the Unix implementation.
...
Unix bug spotted by Dan Gohman.
llvm-svn: 121090
2010-12-07 01:22:31 +00:00
Frits van Bommel
f7368778bc
Fix clang warning: "extra ';' inside a class [-pedantic]".
...
llvm-svn: 120998
2010-12-06 10:48:11 +00:00
Michael J. Spencer
244b426701
Support/FileSystem: Add directory_iterator implementation.
...
llvm-svn: 120989
2010-12-06 04:28:42 +00:00
Michael J. Spencer
5a2272dcef
Support/FileSystem: Add status implementation.
...
llvm-svn: 120870
2010-12-04 00:32:40 +00:00
Michael J. Spencer
8754a822bb
Support/SystemError: Make error_category and error_code auto-bool-conversion-safe.
...
llvm-svn: 120869
2010-12-04 00:32:24 +00:00
Michael J. Spencer
4e1623c715
Support/FileSystem: Add unique_file and exists implementations.
...
llvm-svn: 120776
2010-12-03 01:21:28 +00:00
Michael J. Spencer
15c61ef434
Support/FileSystem: Remove temp_directory_path.
...
llvm-svn: 120775
2010-12-03 01:21:04 +00:00
Michael J. Spencer
de6ce43320
Support/PathV2: Split PathV2.h into PathV2.h and FileSystem.h.
...
llvm-svn: 120592
2010-12-01 19:31:48 +00:00
Michael J. Spencer
9c14dea286
Support/PathV2: Remove is_valid. It was only added because Path had it, but
...
apparently it is unused.
llvm-svn: 120540
2010-12-01 02:48:43 +00:00
Dan Gohman
3ff3bc0c31
Delete Path::appendSuffix's return value; it wasn't used anywhere, which
...
is fine since isn't really necessary to check isValid there anyway.
llvm-svn: 120538
2010-12-01 02:46:41 +00:00
Michael J. Spencer
5ac386d311
Support/PathV2: Add remove_filename implementation.
...
llvm-svn: 120513
2010-12-01 00:52:28 +00:00
Michael J. Spencer
a10e76dd58
Support/PathV2: Implement reverse iteration and parent_path.
...
llvm-svn: 120496
2010-11-30 23:28:07 +00:00
Michael J. Spencer
b3027299d1
Support/PathV2: Update comments.
...
llvm-svn: 120348
2010-11-29 23:35:35 +00:00
Michael J. Spencer
8ac563a538
Support: Add PathV2 implementation.
...
llvm-svn: 120329
2010-11-29 22:28:51 +00:00
Michael J. Spencer
a16d1d5f35
system_error: Remove Windows headers.
...
llvm-svn: 120328
2010-11-29 22:28:32 +00:00
Michael J. Spencer
edeb53dc0a
Support/PathV2: Just about every function call requires the Twine header.
...
llvm-svn: 120327
2010-11-29 22:28:22 +00:00
Charles Davis
e7f14dfdb8
Now to chant the magical incantation that will exorcise the System library
...
from LLVM forever:
grep -lR "llvm/System" * | grep -v .svn | xargs sed -ie 's#llvm/System#llvm/Support#g'
llvm-svn: 120314
2010-11-29 19:44:50 +00:00
Michael J. Spencer
4a63404543
I swear I did a make clean and make before committing all this...
...
llvm-svn: 120304
2010-11-29 18:47:54 +00:00
Michael J. Spencer
d5ec932c3a
Merge System into Support.
...
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Daniel Dunbar
56381d8cc7
raw_ostream::write_escaped: Add a UseHexEscapes argument.
...
llvm-svn: 120200
2010-11-27 07:59:50 +00:00
Michael J. Spencer
0d9fb7f72e
Fix spelling!
...
llvm-svn: 120167
2010-11-26 04:16:20 +00:00
Chris Lattner
80a065b474
add a MemoryBuffer::getOpenFile method, which turns an open
...
file descriptor into a MemoryBuffer (and closes the FD).
llvm-svn: 120065
2010-11-23 22:20:27 +00:00
Jason W Kim
b1725a8110
Move the ARM reloc constants to Support/ELF.h
...
llvm-svn: 120035
2010-11-23 19:40:36 +00:00
Chris Lattner
a830fc6a45
Revert functionality doug added in r98575 that was never
...
documented and only used by some clang stuff I just removed.
llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Chris Lattner
e6d7915f62
reimplement SwapByteOrder.h in terms of overloading instead of
...
being in terms of excessively complex template logic.
llvm-svn: 119992
2010-11-23 04:04:25 +00:00
Wesley Peck
e25f241e37
Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
...
llvm-svn: 119952
2010-11-21 22:06:28 +00:00
Chris Lattner
ba1cc33676
Implement PR8644: forwarding a memcpy value to a byval,
...
allowing the memcpy to be eliminated.
Unfortunately, the requirements on byval's without explicit
alignment are really weak and impossible to predict in the
mid-level optimizer, so this doesn't kick in much with current
frontends. The fix is to change clang to set alignment on all
byval arguments.
llvm-svn: 119916
2010-11-21 00:28:59 +00:00
Chris Lattner
de283efb5d
patch from Frits van Bommel:
...
The attached patch fixes IRBuilder and the NoFolder class so that when
NoFolder is used the instructions it generates are treated just like
the ones IRBuilder creates directly (insert into block, assign them a
name and debug info, as applicable).
It does this by
1) having NoFolder return Instruction*s instead of Value*s,
2) having IRBuilder call Insert(Value, Name) on values obtained from
the folder like it does on instructions it creates directly, and
3) adding an Insert(Constant*, const Twine& = "") overload which just
returns the constant so that the other folders shouldn't have any
extra overhead as long as inlining is enabled.
While I was there, I also added some missing (CreateFNeg and various
Create*Cast) methods to NoFolder.
llvm-svn: 119614
2010-11-18 02:15:42 +00:00
Dan Gohman
a585073323
Fix ScalarEvolution's range memoization to avoid using a
...
default ctor with ConstantRange.
llvm-svn: 119550
2010-11-17 20:23:08 +00:00
Duncan Sands
2bd7e7c274
Move some those Xor simplifications which don't require creating new
...
instructions out of InstCombine and into InstructionSimplify. While
there, introduce an m_AllOnes pattern to simplify matching with integers
and vectors with all bits equal to one.
llvm-svn: 119536
2010-11-17 18:52:15 +00:00
Chris Lattner
99b8654169
now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
...
cookie argument to the SourceMgr diagnostic stuff. This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling
definition, increasing type safety and cleaning things up.
llvm-svn: 119486
2010-11-17 08:13:01 +00:00
Dan Gohman
b10ff802a0
Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
...
This fixes some extreme compile times on unrolled sha512 code.
llvm-svn: 119455
2010-11-17 02:44:44 +00:00
Daniel Dunbar
1f695efa5e
report_fatal_error: Simplify a possible ambiguity.
...
llvm-svn: 118972
2010-11-13 02:48:51 +00:00
Rafael Espindola
8555d32c9e
Initial comdat implementation.
...
llvm-svn: 118805
2010-11-11 18:13:52 +00:00
Duncan Sands
7f44d33a4c
There is no EndPtr anymore - reinterpret the original comment in terms
...
of InputData.
llvm-svn: 118677
2010-11-10 07:46:36 +00:00
Jim Grosbach
380e284cf8
Add v5 and v7 ARM CPU subtype values.
...
llvm-svn: 118281
2010-11-05 17:48:05 +00:00
Daniel Dunbar
8f3d8495f5
CrashRecoveryContext: Add RunSafelyOnThread helper function.
...
llvm-svn: 118272
2010-11-05 07:19:09 +00:00
Mikhail Glushenkov
991857f132
Rename FindExecutable to PrependMainExecutablePath.
...
Makes it more clear that it is just a path manipulation function.
llvm-svn: 118174
2010-11-03 16:14:16 +00:00
Dan Gohman
67f95d770b
Factor code out of APInt to form a isUIntN helper function.
...
llvm-svn: 118133
2010-11-03 00:38:40 +00:00
Mikhail Glushenkov
4077e2da6f
FindExecutable: remove the executability check.
...
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...
llvm-svn: 118049
2010-11-02 20:32:46 +00:00
Rafael Espindola
660b7f5c4a
Add support for files with more than 65280 sections. No testcase since
...
it would be a bit too big :-)
llvm-svn: 117849
2010-10-31 00:16:26 +00:00
Chris Lattner
ee8dea6453
Rename alignof -> alignOf to avoid irritating C++'0x compilers,
...
PR8423, patch by nobled.
llvm-svn: 117774
2010-10-30 05:14:01 +00:00
Rafael Espindola
68ec803155
Add support for R_386_TLS_GD, R_386_TLS_LE_32, R_386_TLS_IE and R_386_TLS_LE.
...
llvm-svn: 117494
2010-10-27 21:23:52 +00:00
Mikhail Glushenkov
64c0814208
It is confusing to call a random-access iterator 'InputIterator'.
...
llvm-svn: 117441
2010-10-27 07:39:54 +00:00
Mikhail Glushenkov
a52646c12e
Trailing whitespace.
...
llvm-svn: 117440
2010-10-27 07:39:48 +00:00
Rafael Espindola
5748458e7d
Add support for emitting ARM file attributes.
...
llvm-svn: 117275
2010-10-25 17:50:35 +00:00
Duncan Sands
cfdc3382c9
Remove deprecated macro names. Hopefully this will unbreak the
...
smooshlab build. The breakage seems to be due to a collision
between LLVM's ATTRIBUTE_UNUSED and gcc's which was previously
hidden due to header files being included in a lucky order.
llvm-svn: 117260
2010-10-25 12:47:22 +00:00
Chandler Carruth
7dd652736f
Move the remaining attribute macros to systematic names based on the attribute
...
name and prefixed with 'LLVM_'.
llvm-svn: 117203
2010-10-23 08:40:19 +00:00
Chandler Carruth
7799a873bb
Switch attribute macros to use 'LLVM_' as a prefix. We retain the old names
...
until other LLVM projects using these are cleaned up.
llvm-svn: 117200
2010-10-23 08:10:43 +00:00
Michael J. Spencer
81bb7d4ad7
I hate line endings.
...
llvm-svn: 117132
2010-10-22 19:14:39 +00:00
Michael J. Spencer
8daaefa006
Endian: Get rid of LLVM_IS_HOST_BIG_ENDIAN.
...
llvm-svn: 117124
2010-10-22 18:45:12 +00:00
Michael J. Spencer
93269f7395
Rename LLVM_IS_TARGET_BIG_ENDIAN to LLVM_IS_HOST_BIG_ENDIAN to reflect what it actually means.
...
llvm-svn: 117092
2010-10-22 08:47:28 +00:00
Michael J. Spencer
b9734a5b12
Support: Add Endian.h
...
llvm-svn: 117057
2010-10-21 20:28:21 +00:00
Wesley Peck
00cc1b6983
Adding the EM_MBLAZE value to the machine architectures enumeration to
...
support future ELF file generation by the MBlaze backend.
llvm-svn: 116985
2010-10-21 02:52:59 +00:00
Chandler Carruth
7763c845be
Add a comment about ATTRIBUTE_UNUSED to avoid further confusion over when to
...
use it.
llvm-svn: 116920
2010-10-20 08:44:27 +00:00
Dan Gohman
df5c887e86
Add TypeBasedAliasAnalysis to the standard pass lists. Note that it
...
is currently inert by default.
llvm-svn: 116732
2010-10-18 18:50:27 +00:00
Dan Gohman
6aff5b94ff
Make BasicAliasAnalysis a normal AliasAnalysis implementation which
...
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.
Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.
Update tests to explicitly request -basicaa.
llvm-svn: 116720
2010-10-18 18:04:47 +00:00
Michael J. Spencer
f9a7c39ecc
MC-COFF: Add support for default-null weak externals.
...
llvm-svn: 116666
2010-10-16 08:25:57 +00:00
Francois Pichet
ad0548d742
Always use binary mode for output stream. This is important to prevent unwanted end of line conversion on Windows. Should not affect Unix where O_BINARY is not defined. This fix /clang/test/lexer/preamble.c XFAIL on WIN32.
...
llvm-svn: 116509
2010-10-14 20:30:58 +00:00
Michael J. Spencer
0888ccaa19
System: Add SwapByteOrder and update Support/MathExtras.h to use it.
...
This time correctly.
llvm-svn: 116247
2010-10-11 21:56:16 +00:00
Michael J. Spencer
0af3659b5d
Revert "System: Add SwapByteOrder and update Support/MathExtras.h to use it."
...
This reverts commit 116234.
It compiled just fine with MSVC and clang...
llvm-svn: 116242
2010-10-11 21:39:24 +00:00
Michael J. Spencer
d0d6c9b01e
System: Add SwapByteOrder and update Support/MathExtras.h to use it.
...
llvm-svn: 116234
2010-10-11 21:22:22 +00:00
Michael J. Spencer
bdf3b8770f
MC-COFF: Fix Simple and Complex type. Fixes PR8320.
...
llvm-svn: 116037
2010-10-08 03:17:11 +00:00
Michael J. Spencer
fc3f9d7c92
Fix Whitespace.
...
llvm-svn: 116036
2010-10-08 03:16:56 +00:00
Dan Gohman
6645ce3f75
Move tool_output_file into its own file.
...
llvm-svn: 115973
2010-10-07 20:32:40 +00:00
Michael J. Spencer
2d26a21128
Support: Add __forceinline to Compiler.h on MSVC.
...
llvm-svn: 115595
2010-10-05 06:00:52 +00:00
Duncan Sands
39e0233734
Remove two uses of the gcc specific 'aligned' attribute. This
...
is partly because this attribute caused trouble in the past (the
SmallVector one had to be changed from aligned to aligned(8) due
to causing crashes on i386 for example; in theory the same might
be needed in the Allocator case...). But it's mostly because
there seems to be no point in special casing gcc here. Using the
same implementation for all compilers results in better testing.
llvm-svn: 115462
2010-10-03 15:15:19 +00:00
Kevin Enderby
f3d8ed8368
Did my commit for the last patch for the .loc directory from the wrong place and
...
missed a bunch of files. Here the rest. Sorry about that.
llvm-svn: 115173
2010-09-30 17:16:09 +00:00
Owen Anderson
aafc02daa9
Revert r115099 (adding early jump threading). It's not clear if the benefits are worth the compile time cost.
...
llvm-svn: 115106
2010-09-29 23:31:09 +00:00
Owen Anderson
2511059a16
Early CFG simplification can fold conditionals down to selects, which is often a good thing, but it can also
...
hide jump threading opportunities by turning control flow into data flow. Run an early JumpThreading pass
(adds approximately an additional 1% to optimization time on SPEC), allowing it to get a shot at these cases
first. Fixes <rdar://problem/8447345>.
llvm-svn: 115099
2010-09-29 22:57:02 +00:00