Commit Graph

23 Commits

Author SHA1 Message Date
Charles Davis e8f297ca94 Target/X86: Add explicit Win64 and System V/x86-64 calling conventions.
Summary:
This patch adds explicit calling convention types for the Win64 and
System V/x86-64 ABIs. This allows code to override the default, and use
the Win64 convention on a target that wants to use SysV (and
vice-versa). This is needed to implement the `ms_abi` and `sysv_abi` GNU
attributes.

Reviewers:

CC:

llvm-svn: 186144
2013-07-12 06:02:35 +00:00
Daniel Malea fddddbeab0 Re-implement DebugIR in a way that does not subclass AssemblyWriter:
- move AsmWriter.h from public headers into lib
- marked all AssemblyWriter functions as non-virtual; no need to override them
- DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper
- exposed flags to control hiding of a) debug metadata b) debug intrinsic calls

C/R: Paul Redmond

llvm-svn: 182617
2013-05-23 22:34:33 +00:00
Daniel Malea ded9f93248 Pull up AssemblyWriter interface into header to allow subclassing
- made all functions virtual so that subclasses can specialize them
- add printInstructionLine so that subclasses can choose whether or not to
  print the newline character (without having to implement printBasicBlock()
- added a second constructor to AssemblyWriter that does not require a
  SlotTracker, as required in order to keep the SlotTracker helper class outside
  AsmWriter.h and buried in the implementation.

llvm-svn: 181466
2013-05-08 20:38:31 +00:00
Rafael Espindola cbf5a7ad06 Now that the underlying issue is fixed, revert r180750 and r180722.
The cause of the windows failures was fixed by r180791. Revert to the state
after Sabre's original revert.

Original message:

revert r179735, it has no testcases, and doesn't really make sense.

llvm-svn: 180844
2013-05-01 13:07:03 +00:00
Bill Wendling 0494597566 Revert the command line option patch. However, keep the part that makes this pass on Windows. I.e., we don't emit the target dependent attributes in a comment before the function.
llvm-svn: 180750
2013-04-29 23:48:06 +00:00
Reid Kleckner e02c622baa Revert "revert r179735, it has no testcases, and doesn't really make sense."
This un-reverts r179735 and reverts commit r180574.

This fixes assertion failures for me locally and should fix the failures
on Windows reported widely on llvm-dev.  We should check if the bots
caught this and if so why not.

llvm-svn: 180722
2013-04-29 18:23:53 +00:00
Chris Lattner 6b2702a6cc revert r179735, it has no testcases, and doesn't really make sense.
llvm-svn: 180574
2013-04-25 20:34:16 +00:00
Bill Wendling 6a97e89df6 Make the TargetIndependent flag have the right boolean value.
llvm-svn: 179798
2013-04-18 21:45:04 +00:00
Bill Wendling 877cf534ab Add an option `-enable-old-style-attr-syntax' to print out function attributes in the "old" style.
It's sometimes beneficial to emit a testcase with the old style attribute
syntax. Allow someone to do this.
<rdar://problem/13563209>

llvm-svn: 179735
2013-04-17 23:35:59 +00:00
Bill Wendling 847a5c3d8f Print out the target-independent attributes in a comment before the function definition.
llvm-svn: 179622
2013-04-16 20:55:47 +00:00
David Blaikie dc69ebb1fc Remove support for versioned debug info.
Versioned debug info support has been a burden to maintain & also compromised
current debug info verification by causing test cases testing old debug info to
remain rather than being updated to the latest. It also makes it hard to add or
change the metadata schema by requiring various backwards-compatibility in the
DI* hierarchy.

So it's being removed in preparation for new changes to the schema to tidy up
old/unnecessary fields and add new fields needed for new debug info (well, new
to LLVM at least).

The more surprising part of this is the changes to DI*::Verify - this became
necessary due to the changes to AsmWriter. AsmWriter was relying on the version
test to decide which bits of metadata were actually debug info when printing
the comment annotations. Without the version information the tag numbers were
too common & it would print debug info on random metadata that happened to
start with an integer that matched a tag number. Instead this change makes the
Verify functions more precise (just adding "number of operands" checks - not
type checking those operands yet) & relies on that to decide which metadata is
debug info metadata.

llvm-svn: 176838
2013-03-11 23:39:23 +00:00
Bill Wendling a032374ea0 Use references to attribute groups on the call/invoke instructions.
Listing all of the attributes for the callee of a call/invoke instruction is way
too much and makes the IR unreadable. Use references to attributes instead.

llvm-svn: 175877
2013-02-22 09:09:42 +00:00
Bill Wendling 90bc19cd91 Modify the LLVM assembly output so that it uses references to represent function attributes.
This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }

llvm-svn: 175605
2013-02-20 07:21:42 +00:00
Bill Wendling 6da216f6f4 Add the function attributes from an inline asm call. These don't have declarations that set the attribute groups, so we must do it on our own.
llvm-svn: 175577
2013-02-20 00:04:41 +00:00
Guy Benyei 83c74e9fad Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
llvm-svn: 175006
2013-02-12 21:21:59 +00:00
Bill Wendling 829b478980 Add support for printing out the attribute groups.
This emits the attribute groups that are used by the functions. (It currently
doesn't print out return type or parameter attributes within attribute groups.)

Note: The functions still retrieve their attributes from the "old" bitcode
format (using the deprecated 'Raw()' method). This means that string attributes
within an attribute group will not show up during a disassembly. This will be
addressed in a future commit.

llvm-svn: 174867
2013-02-11 08:43:33 +00:00
David Blaikie b78e9e59ca Fix unnecessary removal of const through cast machinery
I have some uncommitted changes to the cast code that catch this sort of thing
at compile-time but I still need to do some other cleanup before I can enable
it.

llvm-svn: 174853
2013-02-11 01:16:51 +00:00
Dan Gohman b2f426c40e Minor cleanup.
llvm-svn: 174756
2013-02-08 22:01:47 +00:00
Michael Gottesman 27e7ef326a Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.
llvm-svn: 174340
2013-02-05 05:57:38 +00:00
Bill Wendling 658d24d211 Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.

llvm-svn: 172853
2013-01-18 21:53:16 +00:00
Chandler Carruth dcb603feef Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.
llvm-svn: 171749
2013-01-07 15:43:51 +00:00
Chandler Carruth 9fb823bbd4 Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth ef860a2488 Rename VMCore directory to IR.
Aside from moving the actual files, this patch only updates the build
system and the source file comments under lib/... that are relevant.

I'll be updating other docs and other files in smaller subsequnet
commits.

While I've tried to test this, but it is entirely possible that there
will still be some build system fallout.

Also, note that I've not changed the library name itself: libLLVMCore.a
is still the library name. I'd be interested in others' opinions about
whether we should rename this as well (I think we should, just not sure
what it might break)

llvm-svn: 171359
2013-01-02 09:10:48 +00:00