Commit Graph

165277 Commits

Author SHA1 Message Date
Nico Rieck 9d2e0df049 Revert "Decouple dllexport/dllimport from linkage"
Revert this for now until I fix an issue in Clang with it.

This reverts commit r199204.

llvm-svn: 199207
2014-01-14 12:38:32 +00:00
Nico Rieck 1794b62f54 Revert "Handle dllexport for global aliases"
This reverts commit r199205.

llvm-svn: 199206
2014-01-14 12:36:54 +00:00
Nico Rieck 4192acdbc3 Handle dllexport for global aliases
llvm-svn: 199205
2014-01-14 11:55:40 +00:00
Nico Rieck e43aaf7967 Decouple dllexport/dllimport from linkage
Representing dllexport/dllimport as distinct linkage types prevents using
these attributes on templates and inline functions.

Instead of introducing further mixed linkage types to include linkonce and
weak ODR, the old import/export linkage types are replaced with a new
separate visibility-like specifier:

  define available_externally dllimport void @f() {}
  @Var = dllexport global i32 1, align 4

Linkage for dllexported globals and functions is now equal to their linkage
without dllexport. Imported globals and functions must be either
declarations with external linkage, or definitions with
AvailableExternallyLinkage.

llvm-svn: 199204
2014-01-14 11:55:03 +00:00
Nico Rieck da881a2742 Fix fastcall mangling of dllimported symbols
fastcall requires @ as global prefix instead of _ but getNameWithPrefix
wrongly assumes the OutName buffer is empty and replaces at index 0.
For imported functions this buffer is pre-filled with "__imp_" resulting
in broken "@_imp_foo@0" mangling.

Instead replace at the proper index. We also never have to prepend the
@-prefix because this fastcall mangling is only used on 32-bit Windows
targets which have _ has global prefix.

llvm-svn: 199203
2014-01-14 11:53:26 +00:00
Deepak Panickal 263fde068f Fix return type for Windows
llvm-svn: 199202
2014-01-14 11:34:44 +00:00
NAKAMURA Takumi ba6ea6024c clang/test/Index/recursive-cxx-member-calls.cpp: Add "-target" rather than XFAILing.
llvm-svn: 199201
2014-01-14 11:07:55 +00:00
Kostya Serebryany 19e6e4a445 [tsan] reduce the size of stack frame in MapRodata to please gcc 4.8.2
llvm-svn: 199200
2014-01-14 10:25:42 +00:00
Sylvestre Ledru 096d6e44fd Remove trailing spaces
llvm-svn: 199199
2014-01-14 10:25:26 +00:00
Daniel Jasper d07c2ee99e clang-format: Fix bug introduced in r198871.
We cannot simply change the start column to accomodate for the @ in an
ObjC string literal as that will make clang-format happily violate the
column limit.

Use a different workaround instead. However, a better long-term
solution might be to join the @ and the rest of the literal into a
single token.

llvm-svn: 199198
2014-01-14 09:53:07 +00:00
NAKAMURA Takumi 23c0ab53b2 Revert r199191, "LTO: add API to set strategy for -internalize"
Please update also Other/link-opts.ll, in next time.

llvm-svn: 199197
2014-01-14 09:40:18 +00:00
David Majnemer a5b0999e4d Disable this test for windows builders
This test provides definitions of size_t which are at odds with
-fms-compatibility.  Disable this test on those builders (for now).

llvm-svn: 199196
2014-01-14 08:19:51 +00:00
David Majnemer d4328ded85 Switch to ssize_t from size_t to unbreak windows builders.
Builders that have -fms-compatibility on by default define size_t implicitly.
Tests that provide conflicting definitions would cause unintended failures.

llvm-svn: 199195
2014-01-14 08:18:49 +00:00
Craig Topper ad60708a72 Remove stray comma in enum to satisfy -Wpedantic.
llvm-svn: 199194
2014-01-14 08:07:10 +00:00
Craig Topper ae11aed9d7 Separate the concept of 16-bit/32-bit operand size controlled by 0x66 prefix and the current mode from the concept of SSE instructions using 0x66 prefix as part of their encoding without being affected by the mode.
This should allow SSE instructions to be encoded correctly in 16-bit mode which r198586 probably broke.

llvm-svn: 199193
2014-01-14 07:41:20 +00:00
Kostya Serebryany 47d5569de1 [asan] Include <sys/stat.h> if __x86_64__ is defined
struct stat defined in <asm/stat.h> is incorrect for x32.  <asm/stat.h>
is included to get struct __old_kernel_stat.  But struct __old_kernel_stat
isn't used for x86-64 nor x32.  This patch includes <sys/stat.h> instead
of <asm/stat.h> and comments out size check of struct __old_kernel_stat
for x86-64.

Patch by H.J. Lu

llvm-svn: 199192
2014-01-14 07:38:53 +00:00
Duncan P. N. Exon Smith 43ea3478bf LTO: add API to set strategy for -internalize
Add API to LTOCodeGenerator to specify a strategy for the -internalize
pass.

This is a new attempt at Bill's change in r185882, which he reverted in
r188029 due to problems with the gold linker.  This puts the onus on the
linker to decide whether (and what) to internalize.

In particular, running internalize before outputting an object file may
change a 'weak' symbol into an internal one, even though that symbol
could be needed by an external object file --- e.g., with arclite.

This patch enables three strategies:

- LTO_INTERNALIZE_FULL: the default (and the old behaviour).
- LTO_INTERNALIZE_NONE: skip -internalize.
- LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
  visibility.

LTO_INTERNALIZE_FULL should be used when linking an executable.

Outputting an object file (e.g., via ld -r) is more complicated, and
depends on whether hidden symbols should be internalized.  E.g., for
ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
eventually need to link with others.

lto_codegen_set_internalize_strategy() sets the strategy for subsequent
calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().

<rdar://problem/14334895>

llvm-svn: 199191
2014-01-14 06:37:26 +00:00
David Majnemer 1de36917d3 Sema: Predefine size_t in MSVC Compatibility mode
MSVC defines size_t without any explicit declarations.  This change
allows us to be compatible with TUs that depend on this declaration
appearing from nowhere.

llvm-svn: 199190
2014-01-14 06:19:35 +00:00
Jakob Stoklund Olesen 899b4f3624 This test is passing on SPARC.
llvm-svn: 199189
2014-01-14 06:19:29 +00:00
Jakob Stoklund Olesen 6e1aaf27c1 Puny 24-byte structs are returned by value on SPARC.
Pad these structs up so they are sret-returned even on that
architecture.

llvm-svn: 199188
2014-01-14 06:19:26 +00:00
Jakob Stoklund Olesen b6b35a4955 Always let value types influence register classes.
When creating a virtual register for a def, the value type should be
used to pick the register class. If we only use the register class
constraint on the instruction, we might pick a too large register class.

Some registers can store values of different sizes. For example, the x86
xmm registers can hold f32, f64, and 128-bit vectors. The three
different value sizes are represented by register classes with identical
register sets: FR32, FR64, and VR128. These register classes have
different spill slot sizes, so it is important to use the right one.

The register class constraint on an instruction doesn't necessarily care
about the size of the value its defining. The value type determines
that.

This fixes a problem where InstrEmitter was picking 32-bit register
classes for 64-bit values on SPARC.

llvm-svn: 199187
2014-01-14 06:18:38 +00:00
Jakob Stoklund Olesen 209120621a Switch the NEON register class from QPR to DPair.
The already allocatable DPair superclass contains odd-even D register
pair in addition to the even-odd pairs in the QPR register class. There
is no reason to constrain the set of D register pairs that can be used
for NEON values. Any NEON instructions that require a Q register will
automatically constrain the register class to QPR.

The allocation order for DPair begins with the QPR registers, so
register allocation is unlikely to change much.

llvm-svn: 199186
2014-01-14 06:18:34 +00:00
Chandler Carruth e2d5663b10 [PM] Fix stale header blocker, found by Duncan Smith in code review!
llvm-svn: 199185
2014-01-14 05:50:19 +00:00
Marshall Clow ec931c0721 Rename libc++ internal templates __is_void, __is_integral, __is_floating_point, __is_pointer, __is_function_imp, __is_function, __is_member_function_pointer, __is_member_pointer, __is_signed_impl, __is_signed, __is_unsigned_impl, __is_unsigned to __libcpp_is_XXX, because some compilers have decided that __is_XXX are keywords. No functionality change.
llvm-svn: 199184
2014-01-14 05:13:45 +00:00
Chandler Carruth 9384786b14 Remove the last weird subproject, 'privbracket'.
llvm-svn: 199183
2014-01-14 05:05:18 +00:00
Chandler Carruth 75a6545d0e Add checks to configure for sufficiently modern host compilers. This
requires Clang 3.1 or GCC 4.7. If the compiler isn't Clang or GCC, we
don't try to do any sanity checking, but this give us at least
a reasonable baseline of modern compilers.

Also, I'm not claiming that this is the best way to do compiler version
tests. I'm happy for anyone to suggest better ways of doing this test.

llvm-svn: 199182
2014-01-14 05:02:38 +00:00
Rafael Espindola 6d5f7ce348 Replace .mips_hack_stocg with ".set micromips" and ".set nomicromips".
This matches what gnu as does and implementing this is easier than arguing
about it.

llvm-svn: 199181
2014-01-14 04:25:13 +00:00
Mark Seaborn 8271118a65 Fix llc to not reuse spill slots in functions that invoke setjmp()
We need to ensure that StackSlotColoring.cpp does not reuse stack
spill slots in functions that call "returns_twice" functions such as
setjmp(), otherwise this can lead to miscompiled code, because a stack
slot would be clobbered when it's still live.

This was already handled correctly for functions that call setjmp()
(though this wasn't covered by a test), but not for functions that
invoke setjmp().

We fix this by changing callsFunctionThatReturnsTwice() to check for
invoke instructions.

This fixes PR18244.

llvm-svn: 199180
2014-01-14 04:20:01 +00:00
Chandler Carruth af968eda27 Ok, really, for the last time, llvm-gcc is dead Jim.
Also, so is stacker, llvm-tv, etc. Wow.

But will someone please fess up to what projects/privbracket is and why
our autoconf build supports it?

llvm-svn: 199179
2014-01-14 04:01:01 +00:00
Chandler Carruth b4dd3c6840 llvm-gcc is dead. REALLY. IT'S DEAD JIM.
llvm-svn: 199178
2014-01-14 03:46:00 +00:00
Richard Smith 75a9a1a3c2 Update feature name "Generalized Attributes" to match the heading in the paper.
llvm-svn: 199177
2014-01-14 02:52:38 +00:00
Bob Wilson 5a4f3eab0a Remove a temporary workaround that is no longer relevant.
llvm-svn: 199176
2014-01-14 01:56:31 +00:00
Aaron Ballman 05d76eaa21 Removing some attribute magic related to the OpenCL keyword attributes. Instead of mapping them to their semantics as a custom part of the parser, they instead map declaratively through the rest of the attribute system.
llvm-svn: 199175
2014-01-14 01:29:54 +00:00
Rafael Espindola 4a1a360634 Make getTargetStreamer return a possibly null pointer.
This will allow it to be called from target independent parts of the main
streamer that don't know if there is a registered target streamer or not. This
in turn will allow targets to perform extra actions at specified points in the
interface: add extra flags for some labels, extra work during finalization, etc.

llvm-svn: 199174
2014-01-14 01:21:46 +00:00
Sean Callanan 22ac610c4f Harden the Materializer logic against types that
don't know their bit alignment.

llvm-svn: 199173
2014-01-14 01:14:40 +00:00
Warren Hunt 26b944274e [ms-abi] Small Change to pack+alignment interaction.
This patch makes a small behavioral change to the interaction between 
pack and alignment.  Specifically it makes __declspec(align()) on a 
field change that field's alignment without respect to pack but the 
alignment change to the record alignment as a whole still obeys pack.

llvm-svn: 199172
2014-01-14 00:54:36 +00:00
Reid Kleckner 5b1b5d5123 [ms-abi] Remove duplicated vbptr offset code
Record layout will tell us the offset of a shared vbptr inside a
non-virtual base.

No functionality change.

llvm-svn: 199171
2014-01-14 00:50:39 +00:00
Rui Ueyama ab9deb5466 [PECOFF] Support STACKSIZE module-definition file directive.
llvm-svn: 199170
2014-01-14 00:48:25 +00:00
DeLesley Hutchins f28bbec90e Consumed analysis: add two new attributes which fine-tune the behavior of
consumable objects.  These are useful for implementing error codes that
must be checked.  Patch also includes some significant refactoring, which was
necesary to implement the new behavior.

llvm-svn: 199169
2014-01-14 00:36:53 +00:00
Warren Hunt 6eba907102 [ms-abi] Report VBPtrOffset correctly
Although VBPtrs were being placed correctly by the ms-abi layout engine, 
their offsets were being improperly reported to the ASTRecordLayout 
builder due to a bug.  This patch fixes that and fixes the test cases to 
use the correct values.
y

llvm-svn: 199168
2014-01-14 00:31:30 +00:00
Rui Ueyama ca9e99fe50 Add a function to verify an ExportDesc.
llvm-svn: 199167
2014-01-14 00:29:26 +00:00
Rui Ueyama 37f5273773 Do not use "auto" where actual type is obvious and short.
llvm-svn: 199166
2014-01-14 00:06:50 +00:00
Rui Ueyama 1c1487494d Reduce even more boilerplate.
llvm-svn: 199165
2014-01-13 23:54:49 +00:00
Rui Ueyama 7c13c4459b Whitespace.
llvm-svn: 199164
2014-01-13 23:21:33 +00:00
Rui Ueyama 1090434d39 Reduce the boilerplate in the test cases for the module-definition file.
llvm-svn: 199163
2014-01-13 23:13:21 +00:00
Duncan P. N. Exon Smith f56df6e999 Remove extra } in documentation comment
llvm-svn: 199162
2014-01-13 23:11:48 +00:00
Rui Ueyama cbc6eb3e99 Use bettter names for the tests.
llvm-svn: 199161
2014-01-13 23:02:03 +00:00
Reid Kleckner 340ad862d9 [ms-abi] Always generate complete constructors in the Microsoft C++ ABI
Fixes PR18435, where we generated a base ctor instead of a complete
ctor, and so failed to construct virtual bases when constructing the
complete object.

llvm-svn: 199160
2014-01-13 22:57:31 +00:00
Rui Ueyama 69c26e903b [PECOFF] Add another test for the module-definition file parser.
llvm-svn: 199159
2014-01-13 22:55:09 +00:00
Cameron McInally da3bba445b Clean up RUN command for Assembler/getInt.ll.
llvm-svn: 199158
2014-01-13 22:37:35 +00:00