Commit Graph

1035 Commits

Author SHA1 Message Date
Jay Foad 83be361b8a Replace the existing forms of ConstantArray::get() with a single form
that takes an ArrayRef.

llvm-svn: 133615
2011-06-22 09:24:39 +00:00
Chris Lattner cc19efaa97 Revamp the "ConstantStruct::get" methods. Previously, these were scattered
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.

llvm-svn: 133412
2011-06-20 04:01:31 +00:00
Chris Lattner 8936d2bfbc Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This syntax isn't documented
and blocks forward progress.

llvm-svn: 133371
2011-06-19 00:03:46 +00:00
Chris Lattner 07037364cd revert r133368, apparently I missed the tests to be updated.
llvm-svn: 133369
2011-06-18 23:51:31 +00:00
Chris Lattner a7f74ad10e Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This asmprinter has never
generated this, as you can tell by no tests being updated.  It also isn't
documented.

llvm-svn: 133368
2011-06-18 23:38:57 +00:00
Chris Lattner 0f214ebe5a eliminate the Type::getDescription() method, using "<<" instead. This
removes some gunk from LLVMContext.

llvm-svn: 133360
2011-06-18 21:18:23 +00:00
Matt Beaumont-Gay c3dfb5fa89 Fix -Asserts build
llvm-svn: 133305
2011-06-17 22:21:12 +00:00
Chris Lattner 9505356e3f remove another old and dead hunk of code.
llvm-svn: 133267
2011-06-17 17:40:18 +00:00
Chris Lattner 6bc5c89093 Stop accepting and ignoring attributes in function types. Attributes are applied
to functions and call/invokes, not to types.

llvm-svn: 133266
2011-06-17 17:37:13 +00:00
Chris Lattner 5756c16cdf make the asmparser reject function and type redefinitions. 'Merging' hasn't been
needed since llvm-gcc 3.4 days.

llvm-svn: 133248
2011-06-17 07:06:44 +00:00
Chris Lattner 59345c8b65 remove asmparser support for the old getresult instruction, which has been subsumed by extractvalue.
llvm-svn: 133247
2011-06-17 06:57:15 +00:00
Chris Lattner 33de427cd6 remove parser support for the obsolete "multiple return values" syntax, which
was replaced with return of a "first class aggregate".

llvm-svn: 133245
2011-06-17 06:49:41 +00:00
Chris Lattner 4649a73cc3 stop accepting begin/end around function bodies in the .ll parser, this isn't pascal anymore.
llvm-svn: 133244
2011-06-17 06:42:57 +00:00
Chris Lattner def1949c00 Remove support for using "foo" as symbols instead of %"foo". This is ancient
syntax and has been long obsolete.  As usual, updating the tests is the nasty
part of this.

llvm-svn: 133242
2011-06-17 06:36:20 +00:00
Chris Lattner 7810372577 Remove old backwards compatibility support from the parser for autoupgrading
the old malloc/free instructions, and for 'sext' and 'zext' as function 
attributes (they are spelled signext/zeroext now), and support for result
value attributes being specified after a function.

Additionally, diagnose invalid attributes on functions with an error message
instead of an abort in the verifier.

llvm-svn: 133229
2011-06-17 03:16:47 +00:00
John McCall 4b7a8d68ae Add a new function attribute, nonlazybind, which inhibits lazy-loading
optimizations when emitting calls to the function;  instead those calls may
use faster relocations which require the function to be immediately resolved
upon loading the dynamic object featuring the call.  This is useful when it
is known that the function will be called frequently and pervasively and
therefore there is no merit in delaying binding of the function.

Currently only implemented for x86-64, where it turns into a call through
the global offset table.

Patch by Dan Gohman, who assures me that he's going to add LangRef documentation
for this once it's committed.

llvm-svn: 133080
2011-06-15 20:36:13 +00:00
Nick Lewycky 5bcbd73c38 Teach the .ll parser to handle named metadata with non-simple names.
Unfortunately we can't follow what the rest of the language does (wrapping it
in double-quotes) because that would cause an ambiguity with metadata strings,
so instead we escape any unusual characters with \xx escaping.

llvm-svn: 133050
2011-06-15 06:37:58 +00:00
Nick Lewycky 2176cdc98c Refactor parsing of variable names (ie., %foo and @foo) since they have the same
rules. Also refactor "read string until quote" into its own function. No
functionality change!

llvm-svn: 132645
2011-06-04 18:16:26 +00:00
Rafael Espindola fc9bae6f8b Replace the -unwind-tables option with a per function flag. This is more
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.

llvm-svn: 132033
2011-05-25 03:44:17 +00:00
Benjamin Kramer 9c373c1c7a Remove unused variables caught by GCC's -Wunused-but-set-variable.
llvm-svn: 130755
2011-05-03 16:00:27 +00:00
Jay Foad 5514afe6b2 PR9214: Convert Metadata API to use ArrayRef.
llvm-svn: 129932
2011-04-21 19:59:31 +00:00
Bill Wendling 35a9c3cd72 Revert r129235 pending a vetting of the EH rewrite.
--- Reverse-merging r129235 into '.':
D    test/Feature/bb_attrs.ll
U    include/llvm/BasicBlock.h
U    include/llvm/Bitcode/LLVMBitCodes.h
U    lib/VMCore/AsmWriter.cpp
U    lib/VMCore/BasicBlock.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/AsmParser/LLLexer.cpp
U    lib/AsmParser/LLToken.h
U    lib/Bitcode/Reader/BitcodeReader.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp

llvm-svn: 129259
2011-04-10 23:18:04 +00:00
Bill Wendling 3d5450d809 Beginning of the Great Exception Handling Rewrite.
* Add a "landing pad" attribute to the BasicBlock.
* Modify the bitcode reader and writer to handle said attribute.

Later: The verifier will ensure that the landing pad attribute is used in the
appropriate manner. I.e., not applied to the entry block, and applied only to
basic blocks that are branched to via a `dispatch' instruction.

(This is a work-in-progress.)

llvm-svn: 129235
2011-04-10 00:04:27 +00:00
Jay Foad 52131344a2 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Tilmann Scheller 3bc0bcf3ad Use X86_thiscall calling convention for Win64 as well.
llvm-svn: 126934
2011-03-03 07:49:07 +00:00
Tilmann Scheller a3769f8021 Add Win64 thiscall calling convention.
llvm-svn: 126862
2011-03-02 19:29:22 +00:00
Rafael Espindola 1e49a6d9bc Add a special streamer to libLTO that just records symbols definitions and
uses.

The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)

llvm-svn: 126830
2011-03-02 04:14:42 +00:00
Chris Lattner 69229316aa convert ConstantVector::get to use ArrayRef.
llvm-svn: 125537
2011-02-15 00:14:00 +00:00
Chris Lattner 34442e6ebf revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

llvm-svn: 125504
2011-02-14 18:15:46 +00:00
Chris Lattner d9f5b88548 Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom.  Change various clients to simplify their code.

llvm-svn: 125487
2011-02-14 07:55:32 +00:00
Chris Lattner a676c0fc77 implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.

llvm-svn: 125006
2011-02-07 16:40:21 +00:00
Chris Lattner 35315d065b enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.

Nothing forms exact udivs yet though.  This is progress on PR8862

llvm-svn: 124992
2011-02-06 21:44:57 +00:00
Rafael Espindola 563eb4bb6c Move unnamed_addr after the function arguments on Sabre's request.
llvm-svn: 124209
2011-01-25 19:09:56 +00:00
Rafael Espindola 489e505adf Allow unnamed_addr on declarations.
llvm-svn: 123529
2011-01-15 08:15:00 +00:00
Rafael Espindola 026d152e58 Reject uses of unnamed_addr in declarations.
llvm-svn: 123358
2011-01-13 01:30:30 +00:00
Rafael Espindola 45e6c195d7 First step in fixing PR8927:
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.

llvm-svn: 123063
2011-01-08 16:42:36 +00:00
Nick Lewycky 0de20af7ba Add missing standard headers. Patch by Joerg Sonnenberger!
llvm-svn: 122193
2010-12-19 20:43:38 +00:00
Nick Lewycky b71afe82bf Add missing std:: prefixes to some calls. C++ doesn't require that <cfoo>
headers provide symbols outside namespace std and the LLVM coding standards
state that we should prefix all of them.

llvm-svn: 122192
2010-12-19 20:42:43 +00:00
Michael J. Spencer 39a0ffc394 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
Michael J. Spencer 7b6fef82d4 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
Jay Foad 583abbc4df PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

llvm-svn: 121120
2010-12-07 08:25:19 +00:00
Charles Davis 22fe18625d Add a new 'hotpatch' attribute. This attribute will insert a two-byte no-op
instruction at the beginning of each function that has the attribute, allowing
the function to be easily hooked and/or patched.

llvm-svn: 117264
2010-10-25 15:37:09 +00:00
Duncan Sands 4c5c858d78 AlignLoc is never used for anything - zap it (gcc-4.6 warning).
llvm-svn: 117025
2010-10-21 16:07:10 +00:00
Benjamin Kramer 1dc34b48dd Eliminate some calls to Value::getNameStr.
llvm-svn: 116670
2010-10-16 11:28:23 +00:00
Nick Lewycky 912888fac9 Pacify a noisy compiler, and sink this variable declaration closer to its uses.
llvm-svn: 115206
2010-09-30 21:04:13 +00:00
Nick Lewycky 83e471180c Silence compiler warning.
llvm-svn: 115107
2010-09-29 23:32:20 +00:00
Benjamin Kramer c758311025 Push twines deeper into SourceMgr's error handling methods.
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
Che-Liang Chiou 299479020a Add ret instruction to PTX backend
llvm-svn: 114788
2010-09-25 07:46:17 +00:00
Michael J. Spencer 93c9b2ea93 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer dc38d36ccb CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00