Commit Graph

128913 Commits

Author SHA1 Message Date
Charles Davis a81618db44 Grab bag of Microsoft Mangler fixes:
- Support mangling virtual function tables (base tables need work on the
  ManglerContext interface).
- Correct mangling of local scopes (i.e. functions and C++ methods).
- Replace every llvm_unreachable() for actually-reachable code with a
  diagnostic.

llvm-svn: 158376
2012-06-13 00:18:14 +00:00
Nick Kledzik c890ae41e2 flesh out mach-o Reference Kinds
llvm-svn: 158375
2012-06-12 23:01:30 +00:00
Nick Kledzik b47d6ca3a5 Wrote initial doc on how to create a Reader
llvm-svn: 158374
2012-06-12 22:43:35 +00:00
Hal Finkel 79c39da135 Add some missing 64-bit itinerary definitions for the PPC A2 core.
llvm-svn: 158373
2012-06-12 20:32:29 +00:00
Chad Rosier 075608ecfc [ms-inline-asm] The __asm keyword is a statement separator, so multiple asm
statements are allowed on the same line.

llvm-svn: 158372
2012-06-12 20:30:26 +00:00
Duncan Sands 72aea01b6e Use DenseMap as SmallMap workaround rather than std::map, at Chandler's request.
llvm-svn: 158371
2012-06-12 20:26:43 +00:00
Bob Wilson d5ea39a871 Fix test to work when clang is built without powerpc64 support.
llvm-svn: 158370
2012-06-12 20:22:45 +00:00
Duncan Sands 67cd591989 Use std::map rather than SmallMap because SmallMap assumes that the value has
POD type, causing memory corruption when mapping to APInts with bitwidth > 64.
Merge another crash testcase into crash.ll while there.

llvm-svn: 158369
2012-06-12 20:16:51 +00:00
Chad Rosier c6916f88a8 [arm-fast-isel] Add support for -arm-long-calls.
Patch by Jush Lu <jush.msn@gmail.com>.

llvm-svn: 158368
2012-06-12 19:25:13 +00:00
Chad Rosier 0764e0bb30 [ms-inline-asm] Cleanup MS style inline assembly parsing.
Specifically, improve the handling of whitespace, stop saving tokens that are
in comments and fix the case where we have a comment followed by a closing brace
on the next line.

Unfortunately, there's no easy way of testing this code.

llvm-svn: 158367
2012-06-12 19:03:42 +00:00
Hal Finkel 8c33dde666 Split out the PPC instruction class IntSimple from IntGeneral.
On the POWER7, adds and logical operations can also be handled
in the load/store pipelines. We'll call these IntSimple.

llvm-svn: 158366
2012-06-12 19:01:24 +00:00
Manuel Klimek 6d6baa88f6 Add documentation for the JSON compilation database format.
llvm-svn: 158365
2012-06-12 17:51:04 +00:00
David Blaikie 5452aa5f47 Remove use of GNU extension to resolve Clang warning.
llvm-svn: 158364
2012-06-12 17:06:32 +00:00
Hal Finkel f1cc96ab50 Fixes for PPC host detection and features.
POWER4 is a 64-bit CPU (better matched to the 970).
The g3 is really the 750 (no altivec), the g4+ is the 74xx (not the 750).

Patch by Andreas Tobler.

llvm-svn: 158363
2012-06-12 16:39:23 +00:00
Dmitri Gribenko a99fa5b062 Use correct syntax highliter in code blocks. Noticed by Sean Silva.
llvm-svn: 158359
2012-06-12 15:45:07 +00:00
Duncan Sands d7aeefebd6 Now that Reassociate's LinearizeExprTree can look through arbitrary expression
topologies, it is quite possible for a leaf node to have huge multiplicity, for
example: x0 = x*x, x1 = x0*x0, x2 = x1*x1, ... rapidly gives a value which is x
raised to a vast power (the multiplicity, or weight, of x).  This patch fixes
the computation of weights by correctly computing them no matter how big they
are, rather than just overflowing and getting a wrong value.  It turns out that
the weight for a value never needs more bits to represent than the value itself,
so it is enough to represent weights as APInts of the same bitwidth and do the
right overflow-avoiding dance steps when computing weights.  As a side-effect it
reduces the number of multiplies needed in some cases of large powers.  While
there, in view of external uses (eg by the vectorizer) I made LinearizeExprTree
static, pushing the rank computation out into users.  This is progress towards
fixing PR13021.

llvm-svn: 158358
2012-06-12 14:33:56 +00:00
Douglas Gregor 9b4f370095 When code completion walks the members of a protocol or interface,
make sure that we walk the definition. Fixes <rdar://problem/11427742>.

llvm-svn: 158357
2012-06-12 13:44:08 +00:00
Anna Zaks 2ae781f9e3 [analyzer] WWW: Shorten the menu title.
llvm-svn: 158356
2012-06-12 13:18:20 +00:00
Bill Wendling d4da16c193 Remove unused variable.
llvm-svn: 158353
2012-06-12 06:53:25 +00:00
Craig Topper db0fbf0a50 Add XOP permute intrinsics.
llvm-svn: 158351
2012-06-12 06:03:35 +00:00
Hal Finkel 060f5d2c4c Add two newlines in ParseSubtargetFeatures's debug output after the CPU is printed.
There is otherwise not a newline between the CPU name and the start of the next
pass's output which makes both difficult to read.

llvm-svn: 158350
2012-06-12 04:21:36 +00:00
Hal Finkel 59b0ee8a56 Reapply r158337, this time properly protect Darwin/PPC host CPU use with __ppc__.
Original commit message:
Move PPC host-CPU detection logic from PPCSubtarget into sys::getHostCPUName().

Both the new Linux functionality and the old Darwin functions have been moved.
This change also allows this information to be queried directly by clang and
other frontends (clang, for example, will now have real -mcpu=native support).

llvm-svn: 158349
2012-06-12 03:03:13 +00:00
Richard Smith 700537cddf If parsing a trailing-return-type fails, don't pretend we didn't have one at
all. Suppresses follow-on errors mentioned in PR13074.

llvm-svn: 158348
2012-06-12 01:51:59 +00:00
Dmitri Gribenko c69a5be0cc Correct comment. The return type was changed to const Type* in r123814. Patch by David Röthlisberger.
llvm-svn: 158347
2012-06-12 01:21:44 +00:00
Argyrios Kyrtzidis c6dc4d75fd Satisfy C++ aliasing rules, per suggestion by Chandler.
llvm-svn: 158346
2012-06-12 01:06:16 +00:00
Jakob Stoklund Olesen f8f128606c Revert r158337 "Move PPC host-CPU detection logic from PPCSubtarget into sys::getHostCPUName()."
This commit broke most of the PowerPC unit tests when running on
Intel/Apple.

llvm-svn: 158345
2012-06-12 00:58:40 +00:00
Dmitri Gribenko 19408a76a6 FileCheck docs: remove leftover HTML markup.
llvm-svn: 158344
2012-06-12 00:48:47 +00:00
Dmitri Gribenko 4425368365 Remove unused variable.
llvm-svn: 158343
2012-06-12 00:43:19 +00:00
Argyrios Kyrtzidis 8d19c86c9a For llvm::sys::ThreadLocalImpl instead of malloc'ing the platform-specific
thread local data, embed them in the class using a uint64_t and make sure
we get compiler errors if there's a platform where this is not big enough.

This makes ThreadLocal more safe for using it in conjunction with CrashRecoveryContext.

Related to crash in rdar://11434201.

llvm-svn: 158342
2012-06-12 00:21:31 +00:00
Jordan Rose 2fdc07ee89 Revert "[analyzer] Treat LValueBitCasts like regular pointer bit casts."
This does not actually give us the right behavior for reinterpret_cast
of references. Reverting so I can think about it some more.

This reverts commit 50a75a6e26a49011150067adac556ef978639fe6.

llvm-svn: 158341
2012-06-12 00:20:22 +00:00
Andrew Trick 3e465fb225 misched: When querying RegisterPressureTracker, always save current and max pressure.
llvm-svn: 158340
2012-06-11 23:42:23 +00:00
Andrew Trick d054bd833a misched: regpressure getMaxPressureDelta, revert accidental checkin.
llvm-svn: 158339
2012-06-11 23:42:20 +00:00
Jordan Rose ca00b28a47 [analyzer] Treat LValueBitCasts like regular pointer bit casts.
These casts only appear in very well-defined circumstances, in which the
target of a reinterpret_cast or a function formal parameter is an lvalue
reference. According to the C++ standard, the following are equivalent:

 reinterpret_cast<T&>( x)
*reinterpret_cast<T*>(&x)

[expr.reinterpret.cast]p11

llvm-svn: 158338
2012-06-11 23:20:52 +00:00
Hal Finkel 23c699e497 Move PPC host-CPU detection logic from PPCSubtarget into sys::getHostCPUName().
Both the new Linux functionality and the old Darwin functions have been moved.
This change also allows this information to be queried directly by clang and
other frontends (clang, for example, will now have real -mcpu=native support).

llvm-svn: 158337
2012-06-11 23:14:31 +00:00
Nick Kledzik 40b68559e8 Move implementation of WriterOptionsMachO to its own file. Reduced redundant
ivars in WriterOptionsMachO instead have its methods compute ivar interactions.
Refactor mach-o Reference Kinds and introduce abstract class KindHandler.
Split up StubAtoms.hpp by architecture.  Add support for 32-bit x86 stubs.

llvm-svn: 158336
2012-06-11 22:53:15 +00:00
Anna Zaks 130adbc5a3 [analyzer] WWW: Add FAQ to the menu.
llvm-svn: 158335
2012-06-11 22:35:53 +00:00
Hal Finkel 8eb5928514 Add PPC support for translating gcc-style -mcpu options into LLVM -target-cpu options.
This functionality is based on what is done on ARM, and enables selecting PPC CPUs
in a way compatible with gcc's driver. Also, mirroring gcc (and what is done on x86),
-mcpu=native support was added. This uses the host cpu detection from LLVM
(which will also soon be updated by refactoring code currently in backend).

In order for this to work, the target needs a list of valid CPUs -- we now accept all CPUs accepted by LLVM.
A few preprocessor defines for common CPU types have been added.

llvm-svn: 158334
2012-06-11 22:35:19 +00:00
Anna Zaks 8a87c12355 [analyzer] WWW: FAQ - fix the assertion use example.
llvm-svn: 158333
2012-06-11 22:09:48 +00:00
Anna Zaks 0560cc0591 [analyzer] The FAQ question style shouldn't be the same as code_example.
llvm-svn: 158332
2012-06-11 22:09:46 +00:00
Anna Zaks c1e3568e7d [analyzer] WWW: Add table of contents, fixed code examples.
llvm-svn: 158331
2012-06-11 22:09:44 +00:00
Anna Zaks 67bd96479e [analyzer] WWW: Mention that we do not support "noreturn" for methods.
llvm-svn: 158330
2012-06-11 22:09:41 +00:00
Chad Rosier 175b507f5e Make CodeGenFunction::EmitMSAsmStmt throw a fatal error as MS-style inline
assembly is completely untested and unsupported.

llvm-svn: 158329
2012-06-11 21:52:25 +00:00
Jakob Stoklund Olesen e782fa649f Fix test that depends on register allocation.
The test is really checking the prolog/epilog load/store multiple
formation.

llvm-svn: 158328
2012-06-11 21:14:28 +00:00
Johnny Chen be4e208103 rdar://problem/11390100
debugserver needs to be able to posix_spawn debugging apps that have ".app" in their path that aren't bundles

llvm-svn: 158327
2012-06-11 21:05:26 +00:00
Chad Rosier 32503020a4 Etch out the code path for MS-style inline assembly.
llvm-svn: 158325
2012-06-11 20:47:18 +00:00
Hal Finkel bddc916f2b Enable MFOCRF generation on the PPC A2 core.
llvm-svn: 158324
2012-06-11 19:57:04 +00:00
Hal Finkel bfd3d08d18 Rename the PPC target feature gpul to mfocrf.
The PPC target feature gpul (IsGigaProcessor) was only used for one thing:
To enable the generation of the MFOCRF instruction. Furthermore, this
instruction is available on other PPC cores outside of the G5 line. This
feature now corresponds to the HasMFOCRF flag.

No functionality change.

llvm-svn: 158323
2012-06-11 19:57:01 +00:00
Hal Finkel 25d4c568d3 Add A2 to the list of PPC CPUs recognized by Linux host CPU-type detection.
llvm-svn: 158322
2012-06-11 19:56:57 +00:00
Jordan Rose efef760214 [analyzer] Add ObjCLoopChecker: objects from NSArray et al are non-nil.
While collections containing nil elements can still be iterated over in an
Objective-C for-in loop, the most common Cocoa collections -- NSArray,
NSDictionary, and NSSet -- cannot contain nil elements. This checker adds
that assumption to the analyzer state.

This was the cause of some minor false positives concerning CFRelease calls
on objects in an NSArray.

llvm-svn: 158319
2012-06-11 16:40:41 +00:00
Jordan Rose 3ba8ae3fd9 [analyzer] When looking for a known class, only traverse the hierarchy once.
This has a small hit in the case where only one class is interesting
(NilArgChecker) but is a big improvement when looking for one of several
interesting classes (VariadicMethodTypeChecker), in which the most common
case is that there is no match.

llvm-svn: 158318
2012-06-11 16:40:37 +00:00