Commit Graph

113930 Commits

Author SHA1 Message Date
NAKAMURA Takumi 37a4674fdc Install c-index-test also on CMake build, following up r140681.
llvm-svn: 140694
2011-09-28 10:50:23 +00:00
Chandler Carruth 7d8241cf4f Attempt to silence the GCC -Wreturn-type warning...
llvm-svn: 140693
2011-09-28 10:49:06 +00:00
Chandler Carruth cd99bad4ac Generate tests for all of the x86 SIMD instruction feature set
predefines based on the output of GCC as well as the CPU predefines.

Invert tests for __AVX__, Clang's AVX feature is hard coded off still.

Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).

Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).

llvm-svn: 140692
2011-09-28 10:36:46 +00:00
Chandler Carruth e83c3d9d33 Add a little banner to this test. This lets my scripts more easily
automate the process of updating and generating these tests.

If anyone is really interested, I can check my scripts for generating
this test in, but its a horrible pile of shell... Not sure its really
worth it.

llvm-svn: 140691
2011-09-28 10:17:41 +00:00
Chandler Carruth 5d0feef373 Fix a think-o on my part that got enshrined in a FIXME by setting up the
__tune_...__ define as well.

llvm-svn: 140690
2011-09-28 09:54:11 +00:00
Chandler Carruth 3f7ed950fd Move some of the defines down to more natural locations, consolidating
the target identifying macros at the top, including subtarget macros.

llvm-svn: 140689
2011-09-28 09:54:07 +00:00
Chandler Carruth 6e20c2bd35 Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.

llvm-svn: 140688
2011-09-28 09:45:08 +00:00
Chandler Carruth df5f48ac99 Simplify the control flow for predefined macro selection by using
fallthrough now that we're working with a switch. Also remove a dubious
"feature" regarding k6 processors and 3dnow and leave a fixme... Not
that anyone is likely to care about correct tuning for k6 processors
with and w/o 3dnow...

llvm-svn: 140687
2011-09-28 09:45:05 +00:00
Duncan Sands 2e67937f76 A typeid of zero means a cleanup, not a catch. This case occurs
when there is both a catch and a cleanup.  Correct the comment.

llvm-svn: 140686
2011-09-28 09:13:02 +00:00
Chandler Carruth 212334f7ab Switch the X86TargetInfo object from a string representation of the
selected CPU model to the enumeration. This parses the string
representation once using a StringSwitch on SetCPU. It returns an error
for strings which are not recognized (yay!). Finally it replaces
ridiculous if-chains with switches that cover all enumerators.

The last change required adding several missing entries to the features
function. These were obvious on inspection. Yay for a pattern that gives
warnings when we miss one.

No new test cases yet, as I want to get the 64-bit errors working first.
I'll then start fleshing out the testing more. Currently I'm primarily
testing on Linux, but I'm hoping check whether there are interesting
differences on darwin before long...

llvm-svn: 140685
2011-09-28 08:55:37 +00:00
Chandler Carruth 3ac7aeaacb Introduce an enumeration for the x86 CPUs recognized by Clang. I've
tried to give these nice doxyments, but if I've gotten any of my history
wrong, please chime in.

llvm-svn: 140684
2011-09-28 08:55:34 +00:00
Chandler Carruth 8bdcf9ea12 Clean up a bit of the uses of CPU in the TargetInfo classes. This makes
it an error if a CPU is provided for a target that doesn't implement
logic handling CPU settings, to match the ABI settings. It also removes
the CPU parameter from the getDefaultFeatures method. This parameter was
always filled in with the same value as setCPU was called with, and at
this point every single target implementation that referenced the CPU
within this function has needed to store the CPU via setCPU anyways in
order to implement other interface points.

llvm-svn: 140683
2011-09-28 05:56:05 +00:00
Benjamin Kramer fcfb53d5a5 Driver: Fix two bad typos that were breaking the buildbots.
llvm-svn: 140682
2011-09-28 05:33:02 +00:00
Ted Kremenek 7f01c7b5f1 Install c-index-test as part of install-clang-c Makefile rule.
llvm-svn: 140681
2011-09-28 04:39:41 +00:00
Benjamin Kramer 8747e3e7ea PTX: Simplify code. No functionality change.
llvm-svn: 140680
2011-09-28 04:32:36 +00:00
Benjamin Kramer 5d7a73fa8c PTX: Pass param name strings per const reference.
The copies caused use-after-free bugs on std::string implementations without COW (i.e. anything but libstdc++)

llvm-svn: 140679
2011-09-28 04:08:02 +00:00
Bill Wendling baf3941fde Strip off pointer casts when looking at the eh.sjlj.functioncontext's argument.
llvm-svn: 140678
2011-09-28 03:52:41 +00:00
Bill Wendling 225e8481b0 Bitcast the alloca to an i8* to match the intrinsic's signature.
llvm-svn: 140677
2011-09-28 03:47:11 +00:00
Bill Wendling 66b110f571 Create and use an llvm.eh.sjlj.functioncontext intrinsic.
This intrinsic is used to pass the index of the function context to the back-end
for further processing. The back-end is in charge of filling in the rest of the
entries.

llvm-svn: 140676
2011-09-28 03:36:43 +00:00
Bill Wendling 2e76ca9d9a In the new EH model, setup the function context and the call site info.
The DWARF exception pass uses the call site information, which is set up here. A
pre-RA pass is too late for it to use this information. So create and setup the
function context here, and then insert the call site values here (and map the
call sites for the DWARF EH pass). This is simpler than the original pass, and
doesn't make the CFG lose its SSA-ness.

It's a win-win-win-win-lose-win-win situation.

llvm-svn: 140675
2011-09-28 03:14:05 +00:00
Bill Wendling e6138e3ad1 Don't conditionalize execution of the SjLj EH prepare pass.
We may need an SjLj EH preparation pass for some call site information, at least
in the short term.

llvm-svn: 140674
2011-09-28 03:07:34 +00:00
Chandler Carruth 5ac1e8e6b1 Begin fixing Clang's predefined macros for various architectures. This
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.

This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.

Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.

llvm-svn: 140673
2011-09-28 02:59:25 +00:00
Argyrios Kyrtzidis 0ce4c9ab55 Introduce Decl::getParentFunctionOrMethod which if the decl is defined inside
a function/method/block it returns the corresponding DeclContext, otherwise it returns null.

llvm-svn: 140672
2011-09-28 02:45:33 +00:00
Andrew Trick 8c219ecd1a Test case for r140670: indvars should hoist sext.
llvm-svn: 140671
2011-09-28 02:13:32 +00:00
Andrew Trick e0e30532a5 indvars should hoist [sz]ext because licm is not rerun.
llvm-svn: 140670
2011-09-28 01:35:36 +00:00
Johnny Chen a32a13d207 Add a test sequence of iterating through a module's symbols belonging to a section.
Add the relevant utility functions to the lldbutil.py file.

llvm-svn: 140669
2011-09-28 00:51:00 +00:00
Chad Rosier fe6fd36b6c [driver] If no OSX or iOS target has been specified and we're compiling for
armv7, go ahead as assume we're targeting iOS.
rdar://10147774

llvm-svn: 140668
2011-09-28 00:46:32 +00:00
Eli Friedman 5f476dc3ef PR10628: Fix getModRefInfo so it queries the underlying alias() implementation correctly while checking nocapture calls.
llvm-svn: 140666
2011-09-28 00:34:27 +00:00
Jakob Stoklund Olesen bd5109f14d Rename class and clean up source.
No functional change intended.

llvm-svn: 140664
2011-09-28 00:01:56 +00:00
Jakob Stoklund Olesen 934b7d7645 Rename SSEDomainFix -> lib/CodeGen/ExecutionDepsFix.
I'll clean up the source in the next commit.

llvm-svn: 140663
2011-09-28 00:01:54 +00:00
Jim Ingham 32adcb2e8f Need to go to the containing inline block to get the inline name right.
llvm-svn: 140662
2011-09-27 23:59:35 +00:00
Akira Hatanaka ae40dc735d Remove MipsFPRound. Mips1 is no longer supported.
llvm-svn: 140661
2011-09-27 23:55:37 +00:00
Howard Hinnant 920b56ca88 Another installment on debug mode. This addresses list. However this should be considered a temporary state. The API of the debug database and how vector and list use it, is unsatisfactory at the moment. It is both inefficient and overly verbose. I wanted to get this functionality checked in though. In the next day or so I'll refactor what is there in an attempt to streamline things.
llvm-svn: 140660
2011-09-27 23:55:03 +00:00
Jakob Stoklund Olesen 30c811246f Remove X86-dependent stuff from SSEDomainFix.
This also enables domain swizzling for AVX code which required a few
trivial test changes.

The pass will be moved to lib/CodeGen shortly.

llvm-svn: 140659
2011-09-27 23:50:46 +00:00
Eli Friedman 9ab36372db PR11002: Make sure we emit sentinel warnings with a valid source location. (Ideally, we want to use the location returned by getLocForEndOfToken, but that is not always successful.)
llvm-svn: 140658
2011-09-27 23:46:37 +00:00
Ted Kremenek ab2dcc8de6 Include prefix with default synthesized ivars.
llvm-svn: 140657
2011-09-27 23:39:40 +00:00
Douglas Gregor 75acd925d0 Only print _Bool as 'bool' when 'bool' is defined as an object-like
macro whose only replacement token is '_Bool'.

llvm-svn: 140656
2011-09-27 23:30:47 +00:00
Ted Kremenek e3e36f80f5 Unbreak CMake build.
llvm-svn: 140655
2011-09-27 23:29:59 +00:00
Johnny Chen b2c7825515 Add a simple test TestModuleAndSection.py to exercise some module/section-related APIs.
In particular, it iterates through the executable module's SBSections, looking for the
'__TEXT' section and further iterates on its subsections (of SBSection type, too).

llvm-svn: 140654
2011-09-27 23:15:58 +00:00
Jakob Stoklund Olesen f9b71a2e01 Implement TII::get/setExecutionDomain() for ARM.
llvm-svn: 140653
2011-09-27 22:57:21 +00:00
Jakob Stoklund Olesen b48c994cc0 Promote the X86 Get/SetSSEDomain functions to TargetInstrInfo.
I am going to unify the SSEDomainFix and NEONMoveFix passes into a
single target independent pass.  They are essentially doing the same
thing.

llvm-svn: 140652
2011-09-27 22:57:18 +00:00
Douglas Gregor eaed8d57dd Remove the egregious hack that made Objective-C++ ARC work with older
versions of libc++. Newer versions of libc++ know how to deal with ARC
properly. Fixes <rdar://problem/10062179>.

llvm-svn: 140651
2011-09-27 22:48:19 +00:00
Douglas Gregor c0b07286cf When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.

llvm-svn: 140650
2011-09-27 22:38:19 +00:00
Fariborz Jahanian ac8dbf0fc7 objcetive-c-arc: When overriding a method, its ns_consumed patameter
attribute must match its overriden method. Same also for
ns_returns_retained/not_retained on the result type.
This is one half of // rdar://10187884

llvm-svn: 140649
2011-09-27 22:35:36 +00:00
Anna Zaks 0070c6d4db Fix a crash in MallocOverflowSecurityChecker. Patch by Lei Zhang.
llvm-svn: 140648
2011-09-27 22:25:01 +00:00
Jim Grosbach c63af1b7b6 ARM Thumb2 asm parsing [SU]XT[BH] without rotate but with .w.
Add inst alias to handle these assembly forms. Add tests, too.

rdar://10178799

llvm-svn: 140647
2011-09-27 22:18:54 +00:00
Bill Wendling 354ff9e348 This is the start of the new SjLj EH preparation pass, which will replace the
current IR-level pass.

The old SjLj EH pass has some problems, especially with the new EH model. Most
significantly, it violates some of the new restrictions the new model has. For
instance, the 'dispatch' table wants to jump to the landing pad, but we cannot
allow that because only an invoke's unwind edge can jump to a landing pad. This
requires us to mangle the code something awful. In addition, we need to keep the
now dead landingpad instructions around instead of CSE'ing them because the
DWARF emitter uses that information (they are dead because no control flow edge
will execute them - the control flow edge from an invoke's unwind is superceded
by the edge coming from the dispatch).

Basically, this pass belongs not at the IR level where SSA is king, but at the
code-gen level, where we have more flexibility.

llvm-svn: 140646
2011-09-27 22:14:12 +00:00
David Chisnall ddbd68fbd2 Check for GCC paths that have the target triple in them. This is required for a lot of cross-compile toolchains. Also add some slightly better support for -B.
llvm-svn: 140645
2011-09-27 22:03:18 +00:00
Akira Hatanaka a5d18f2d7e Embed patterns in definitions of MFC1 and MTC1 instead of defining them outside
of the instruction definitions using Pat<>.

llvm-svn: 140644
2011-09-27 22:01:01 +00:00
Cameron Zwarich 7a6e8f2c5d Remove an invalid assert that is really just asserting when the scheduler emits
a suboptimal schedule.

llvm-svn: 140643
2011-09-27 21:59:16 +00:00