platform/upstream/llvm.git
11 years agoFix template instantiation of attributes. More specifically, fix the case
DeLesley Hutchins [Wed, 26 Sep 2012 17:57:31 +0000 (17:57 +0000)]
Fix template instantiation of attributes.  More specifically, fix the case
where an attribute is attached to a forward declaration of a template function,
and refers to parameters of that declaration, but is then inherited by the
definition of that function.  When the definition is instantiated, the
parameter references need to be remapped.

llvm-svn: 164710

11 years agoUse sep instead of ' '.
Ted Kremenek [Wed, 26 Sep 2012 17:23:31 +0000 (17:23 +0000)]
Use sep instead of ' '.

llvm-svn: 164709

11 years agoNow that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
Duncan Sands [Wed, 26 Sep 2012 17:16:01 +0000 (17:16 +0000)]
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke
instructions; it already skips this for call instructions.  Fixes PR13903.

llvm-svn: 164707

11 years agoMake our mini-stdint.h platform-independent by using predefined macros.
Jordan Rose [Wed, 26 Sep 2012 16:41:11 +0000 (16:41 +0000)]
Make our mini-stdint.h platform-independent by using predefined macros.

This also adds a definition for uint64_t, which was causing build failures
on some platforms. (I'm actually surprised this didn't happen on more
builders, but maybe the search paths are different.)

llvm-svn: 164706

11 years ago[libclang] Remove the ParentKind cursor kind from code-completion results.
Argyrios Kyrtzidis [Wed, 26 Sep 2012 16:39:56 +0000 (16:39 +0000)]
[libclang] Remove the ParentKind cursor kind from code-completion results.

This is to reduce dependency to cursors for the code-completion results.

llvm-svn: 164705

11 years agoHave ASTUnit::Save() return a bool to indicate save error.
Argyrios Kyrtzidis [Wed, 26 Sep 2012 16:39:46 +0000 (16:39 +0000)]
Have ASTUnit::Save() return a bool to indicate save error.

Removes a dependency of ASTUnit to clang-c/Index.h.

llvm-svn: 164704

11 years agoPatch by Matt, to get lldb to build with the updated llvm+clang versions (via Makefiles).
Filipe Cabecinhas [Wed, 26 Sep 2012 16:27:06 +0000 (16:27 +0000)]
Patch by Matt, to get lldb to build with the updated llvm+clang versions (via Makefiles).

llvm-svn: 164703

11 years agoMake lldb more C++11 friendly.
Filipe Cabecinhas [Wed, 26 Sep 2012 16:27:04 +0000 (16:27 +0000)]
Make lldb more C++11 friendly.

llvm-svn: 164702

11 years agoYAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.
Benjamin Kramer [Wed, 26 Sep 2012 15:52:15 +0000 (15:52 +0000)]
YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.

Fixes PR12632.

llvm-svn: 164701

11 years agoBump _LIBCPP_VERSION to 1002
Howard Hinnant [Wed, 26 Sep 2012 15:38:09 +0000 (15:38 +0000)]
Bump _LIBCPP_VERSION to 1002

llvm-svn: 164700

11 years agoRemove unneeded and invalid SetInsertPoint calls from unittest.
Benjamin Kramer [Wed, 26 Sep 2012 15:16:05 +0000 (15:16 +0000)]
Remove unneeded and invalid SetInsertPoint calls from unittest.

BB->end() returns a sentinel value that is not a legal insert point.

llvm-svn: 164699

11 years agoAPFloat::roundToIntegral: Special values don't keep the exponent value up to date...
Benjamin Kramer [Wed, 26 Sep 2012 14:06:58 +0000 (14:06 +0000)]
APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.

Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.

llvm-svn: 164698

11 years agoAddress Duncan's comments on r164684:
Hans Wennborg [Wed, 26 Sep 2012 14:01:53 +0000 (14:01 +0000)]
Address Duncan's comments on r164684:

- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.

llvm-svn: 164696

11 years agoFixed a number of gpylint warnings, added binary names filtering (useful for Chrome...
Alexander Potapenko [Wed, 26 Sep 2012 13:16:42 +0000 (13:16 +0000)]
Fixed a number of gpylint warnings, added binary names filtering (useful for Chrome), minor fixes.

llvm-svn: 164695

11 years agoEncapsulate the main loop into a class to allow reusing it.
Alexander Potapenko [Wed, 26 Sep 2012 12:12:41 +0000 (12:12 +0000)]
Encapsulate the main loop into a class to allow reusing it.

llvm-svn: 164694

11 years agoSet --use-symbol-table=true as Alexey has already resolved the FIXME.
Alexander Potapenko [Wed, 26 Sep 2012 11:36:14 +0000 (11:36 +0000)]
Set --use-symbol-table=true as Alexey has already resolved the FIXME.

llvm-svn: 164693

11 years agoAddress Duncan's comments on r164682:
Hans Wennborg [Wed, 26 Sep 2012 11:07:37 +0000 (11:07 +0000)]
Address Duncan's comments on r164682:

- Finish assert messages with exclamation mark
- Move overflow checking into ShouldBuildLookupTable.

llvm-svn: 164692

11 years agoAnalogous fix to memset and memcpy rewriting. Don't have a test case
Chandler Carruth [Wed, 26 Sep 2012 10:59:22 +0000 (10:59 +0000)]
Analogous fix to memset and memcpy rewriting. Don't have a test case
contrived for these yet, as I spotted them by inspection and the test
cases are a bit more tricky to phrase.

llvm-svn: 164691

11 years agoWhen rewriting the pointer operand to a load or store which has
Chandler Carruth [Wed, 26 Sep 2012 10:45:28 +0000 (10:45 +0000)]
When rewriting the pointer operand to a load or store which has
alignment guarantees attached, re-compute the alignment so that we
consider offsets which impact alignment.

llvm-svn: 164690

11 years agoTeach all of the loads, stores, memsets and memcpys created by the
Chandler Carruth [Wed, 26 Sep 2012 10:27:46 +0000 (10:27 +0000)]
Teach all of the loads, stores, memsets and memcpys created by the
rewriter in SROA to carry a proper alignment. This involves
interrogating various sources of alignment, etc. This is a more complete
and principled fix to PR13920 as well as related bugs pointed out by Eli
in review and by inspection in the area.

Also by inspection fix the integer and vector promotion paths to create
aligned loads and stores. I still need to work up test cases for
these... Sorry for the delay, they were found purely by inspection.

llvm-svn: 164689

11 years agoAdd some convenience methods to IRBuilder for constructing aligned loads
Chandler Carruth [Wed, 26 Sep 2012 10:27:40 +0000 (10:27 +0000)]
Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.

llvm-svn: 164688

11 years agoARM/atomicrmw_minmax.ll: Fix RUN line.
NAKAMURA Takumi [Wed, 26 Sep 2012 10:12:20 +0000 (10:12 +0000)]
ARM/atomicrmw_minmax.ll: Fix RUN line.

llvm-svn: 164687

11 years agoFix tests that didn't test anything.
Benjamin Kramer [Wed, 26 Sep 2012 09:51:39 +0000 (09:51 +0000)]
Fix tests that didn't test anything.

llvm-svn: 164686

11 years agoFix ordering of operands on lowering of atomicrmw min/max nodes on ARM.
James Molloy [Wed, 26 Sep 2012 09:48:32 +0000 (09:48 +0000)]
Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.

llvm-svn: 164685

11 years agoSimplifyCFG: Make the switch-to-lookup table transformation store the
Hans Wennborg [Wed, 26 Sep 2012 09:44:49 +0000 (09:44 +0000)]
SimplifyCFG: Make the switch-to-lookup table transformation store the
tables in bitmaps when they fit in a target-legal register.

This saves some space, and it also allows for building tables that would
otherwise be deemed too sparse.

One interesting case that this hits is example 7 from
http://blog.regehr.org/archives/320. We currently generate good code
for this when lowering the switch to the selection DAG: we build a
bitmask to decide whether to jump to one block or the other. My patch
will result in the same bitmask, but it removes the need for the jump,
as the return value can just be retrieved from the mask.

llvm-svn: 164684

11 years agoFix build failure and enhance the testcase for unwind.h.
Logan Chien [Wed, 26 Sep 2012 09:40:37 +0000 (09:40 +0000)]
Fix build failure and enhance the testcase for unwind.h.

llvm-svn: 164683

11 years agoSimplifyCFG: Refactor the switch-to-lookup table transformation by
Hans Wennborg [Wed, 26 Sep 2012 09:34:53 +0000 (09:34 +0000)]
SimplifyCFG: Refactor the switch-to-lookup table transformation by
breaking out the building of lookup tables into a separate class.

llvm-svn: 164682

11 years agollvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.
NAKAMURA Takumi [Wed, 26 Sep 2012 09:24:12 +0000 (09:24 +0000)]
llvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.

llvm-svn: 164681

11 years agoRun test in a freestanding environment so it doesn't accidentally pick up system...
Benjamin Kramer [Wed, 26 Sep 2012 09:10:53 +0000 (09:10 +0000)]
Run test in a freestanding environment so it doesn't accidentally pick up system headers for the wrong target.

While there add a test that verifies that the header parses in C++ mode.

llvm-svn: 164679

11 years agoFix two more tests that didn't do anything.
Nico Weber [Wed, 26 Sep 2012 09:09:17 +0000 (09:09 +0000)]
Fix two more tests that didn't do anything.

Found with
  find test -type f | xargs grep RUN: | grep '%clang' | grep -iv '%s' | grep -v '%t' | grep -v '\\$'

llvm-svn: 164678

11 years agoMake this test actually test something
Nico Weber [Wed, 26 Sep 2012 09:02:07 +0000 (09:02 +0000)]
Make this test actually test something

llvm-svn: 164677

11 years agoThe assumption that /proc/self/exe always exists is incorrect.
Sylvestre Ledru [Wed, 26 Sep 2012 08:30:35 +0000 (08:30 +0000)]
The assumption that /proc/self/exe always exists is incorrect.
For example, under a Linux chroot, /proc/ might not be mounted.
Therefor, we test if this file exist. If it is the case, use it (the current
behavior). Otherwise, we fall back to the detection used by *BSD.

The issue has been reported initially on the Debian bug tracker:
http://bugs.debian.org/674588

llvm-svn: 164676

11 years agoAdd SARX/SHRX/SHLX code generation support
Michael Liao [Wed, 26 Sep 2012 08:26:25 +0000 (08:26 +0000)]
Add SARX/SHRX/SHLX code generation support

llvm-svn: 164675

11 years agoAdd RORX code generation support
Michael Liao [Wed, 26 Sep 2012 08:24:51 +0000 (08:24 +0000)]
Add RORX code generation support

llvm-svn: 164674

11 years agoAdd MULX code generation support
Michael Liao [Wed, 26 Sep 2012 08:22:37 +0000 (08:22 +0000)]
Add MULX code generation support

llvm-svn: 164673

11 years agoRevert r163022, it caused PR13924.
Nico Weber [Wed, 26 Sep 2012 08:19:01 +0000 (08:19 +0000)]
Revert r163022, it caused PR13924.

Add a test for PR13924. Do not revert the test added in r163022,
it surprisingly still passes even after reverting the code changes.

llvm-svn: 164672

11 years agoTeach the 'lint' sanity checking pass to detect simple buffer overflows.
Duncan Sands [Wed, 26 Sep 2012 07:45:36 +0000 (07:45 +0000)]
Teach the 'lint' sanity checking pass to detect simple buffer overflows.

llvm-svn: 164671

11 years agoRevert r164663 due to buildbot failure.
Craig Topper [Wed, 26 Sep 2012 07:43:06 +0000 (07:43 +0000)]
Revert r164663 due to buildbot failure.

llvm-svn: 164670

11 years agoRevert the business end of r164636 and try again. I'll come in again. ;]
Chandler Carruth [Wed, 26 Sep 2012 07:41:40 +0000 (07:41 +0000)]
Revert the business end of r164636 and try again. I'll come in again. ;]

This should really, really fix PR13916. For real this time. The
underlying bug is... a bit more subtle than I had imagined.

The setup is a code pattern that leads to an @llvm.memcpy call with two
equal pointers to an alloca in the source and dest. Now, not any pattern
will do. The alloca needs to be formed just so, and both pointers should
be wrapped in different bitcasts etc. When this precise pattern hits,
a funny sequence of events transpires. First, we correctly detect the
potential for overlap, and correctly optimize the memcpy. The first
time. However, we do simplify the set of users of the alloca, and that
causes us to run the alloca back through the SROA pass in case there are
knock-on simplifications. At this point, a curious thing has happened.
If we happen to have an i8 alloca, we have direct i8 pointer values. So
we don't bother creating a cast, we rewrite the arguments to the memcpy
to dircetly refer to the alloca.

Now, in an unrelated area of the pass, we have clever logic which
ensures that when visiting each User of a particular pointer derived
from an alloca, we only visit that User once, and directly inspect all
of its operands which refer to that particular pointer value. However,
the mechanism used to detect memcpy's with the potential to overlap
relied upon getting visited once per *Use*, not once per *User*. This is
always true *unless* the same exact value is both source and dest. It
turns out that almost nothing actually produces that pattern though.

We can hand craft test cases that more directly test this behavior of
course, and those are included. Also, note that there is a significant
missed optimization here -- we prove in many cases that there is
a non-volatile memcpy call with identical source and dest addresses. We
shouldn't prevent splitting the alloca in that case, and in fact we
should just remove such memcpy calls eagerly. I'll address that in
a subsequent commit.

llvm-svn: 164669

11 years agoAdd is16BitVector and is32BitVector to MVT and call them from EVT. Matches other...
Craig Topper [Wed, 26 Sep 2012 07:17:37 +0000 (07:17 +0000)]
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.

llvm-svn: 164668

11 years agoReplace calls to getSizeInBits with getExtendedSizeInBits since its already known...
Craig Topper [Wed, 26 Sep 2012 07:11:42 +0000 (07:11 +0000)]
Replace calls to getSizeInBits with getExtendedSizeInBits since its already known its an extended type.

llvm-svn: 164667

11 years agoRename virtual table anchors from Anchor() to anchor() for consistency with the rest...
Craig Topper [Wed, 26 Sep 2012 06:36:36 +0000 (06:36 +0000)]
Rename virtual table anchors from Anchor() to anchor() for consistency with the rest of the tree.

llvm-svn: 164666

11 years agoAdd struct keyword before _Unwind_Context.
Logan Chien [Wed, 26 Sep 2012 06:35:17 +0000 (06:35 +0000)]
Add struct keyword before _Unwind_Context.

In the C programming language, we have to add the
"struct" keyword.  Otherwise, the compiler will
emit error message.

llvm-svn: 164665

11 years agoRemove hasNoAVX method. Can just invert hasAVX instead.
Craig Topper [Wed, 26 Sep 2012 06:29:37 +0000 (06:29 +0000)]
Remove hasNoAVX method. Can just invert hasAVX instead.

llvm-svn: 164664

11 years agoMark extended type querying methods as 'readonly' to reduce compile size.
Craig Topper [Wed, 26 Sep 2012 06:28:26 +0000 (06:28 +0000)]
Mark extended type querying methods as 'readonly' to reduce compile size.

llvm-svn: 164663

11 years agoGenerate an error message instead of asserting or segfaulting when we have a
Bill Wendling [Wed, 26 Sep 2012 06:16:18 +0000 (06:16 +0000)]
Generate an error message instead of asserting or segfaulting when we have a
scalar-to-vector conversion that we cannot handle. For instance, when an invalid
constraint is used in an inline asm statement.
<rdar://problem/12284092>

llvm-svn: 164662

11 years agoRemove unnecessary ASTContext& parameter from SymExpr::getType().
Ted Kremenek [Wed, 26 Sep 2012 06:00:14 +0000 (06:00 +0000)]
Remove unnecessary ASTContext& parameter from SymExpr::getType().

llvm-svn: 164661

11 years agoAdd codegen support for the __debugbreak intrinsic.
Nico Weber [Wed, 26 Sep 2012 05:40:16 +0000 (05:40 +0000)]
Add codegen support for the __debugbreak intrinsic.

llvm-svn: 164660

11 years agoAdd 'lock' prefix output support in assembly printer
Michael Liao [Wed, 26 Sep 2012 05:13:44 +0000 (05:13 +0000)]
Add 'lock' prefix output support in assembly printer

- Instead of embedding 'lock' into each mnemonic of atomic
  instructions except 'xchg', we teach X86 assembly printer to output 'lock'
  prefix similar to or consistent with code emitter.

llvm-svn: 164659

11 years agoFix an edge case of mangling involving the combination of a lambda and typeid.
Eli Friedman [Wed, 26 Sep 2012 04:34:21 +0000 (04:34 +0000)]
Fix an edge case of mangling involving the combination of a lambda and typeid.
typeid (and a couple other non-standard places where we can transform an
unevaluated expression into an evaluated expression) is special
because it introduces an an expression evaluation context,
which conflicts with the mechanism to compute the current
lambda mangling context.  PR12123.

I would appreciate if someone would double-check that we get the mangling
correct with this patch.

llvm-svn: 164658

11 years agoGenerate an error message instead of asserting or segfaulting when we have a
Bill Wendling [Wed, 26 Sep 2012 04:04:19 +0000 (04:04 +0000)]
Generate an error message instead of asserting or segfaulting when we have a
scalar-to-vector conversion that we cannot handle. For instance, when an invalid
constraint is used in an inline asm statement.
<rdar://problem/12284092>

llvm-svn: 164657

11 years agoFix the AST representation for non-type template arguments to encode
Eli Friedman [Wed, 26 Sep 2012 02:36:12 +0000 (02:36 +0000)]
Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.

llvm-svn: 164656

11 years agoTeach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType
Richard Smith [Wed, 26 Sep 2012 02:18:13 +0000 (02:18 +0000)]
Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType
for a type alias template can appear as sugar at any level of desugaring, just
like a TypedefType.

llvm-svn: 164655

11 years agoExpansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Michael Ilseman [Wed, 26 Sep 2012 01:55:01 +0000 (01:55 +0000)]
Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.

Fixed issue with Release build.

llvm-svn: 164654

11 years agoFixed a bug in the path remapper that caused
Sean Callanan [Wed, 26 Sep 2012 01:28:11 +0000 (01:28 +0000)]
Fixed a bug in the path remapper that caused
a crash if the path to be remaped was NULL.

<rdar://problem/12371888>

llvm-svn: 164653

11 years agoRevert "Add --program-prefix support to build"
Jordan Rose [Wed, 26 Sep 2012 00:01:00 +0000 (00:01 +0000)]
Revert "Add --program-prefix support to build"

The Apple buildbots are set up to pass --target to configure for both
cross- and non-cross-compile builds, and the standard autoconf response
to this is to set the program prefix to '<target>-'. Until we can figure
out the proper way to handle this (don't pass --target? pass an explicit
--program-prefix=""? don't auto-populate program_prefix with target_alias?)
it's more important to keep the buildbots running.

This reverts r164633 / ba48ceb1a3802e20e781ef04ea2573ffae2ac414.

llvm-svn: 164651

11 years agoUpdate checker build.
Ted Kremenek [Tue, 25 Sep 2012 23:58:39 +0000 (23:58 +0000)]
Update checker build.

llvm-svn: 164649

11 years agoAdd an API to figure out whether a breakpoint is internal or not.
Jim Ingham [Tue, 25 Sep 2012 23:55:19 +0000 (23:55 +0000)]
Add an API to figure out whether a breakpoint is internal or not.

llvm-svn: 164648

11 years agoThe iOSSimulator platform should create a PlatformDarwin with
Jason Molenda [Tue, 25 Sep 2012 23:32:06 +0000 (23:32 +0000)]
The iOSSimulator platform should create a PlatformDarwin with
is_host == true so PlatformDarwin knows it can do same-host
operations like process lookup.  <rdar://problem/12296249>

llvm-svn: 164647

11 years ago[Options] Store the option ID in OptTable::Info.
Michael J. Spencer [Tue, 25 Sep 2012 23:12:48 +0000 (23:12 +0000)]
[Options] Store the option ID in OptTable::Info.

llvm-svn: 164644

11 years agoRemove 'const' version of getBasicVals(), which is useless.
Ted Kremenek [Tue, 25 Sep 2012 23:12:12 +0000 (23:12 +0000)]
Remove 'const' version of getBasicVals(), which is useless.

llvm-svn: 164643

11 years agoInitialize boolean variables in MipsSubtarget's constructor.
Akira Hatanaka [Tue, 25 Sep 2012 23:07:11 +0000 (23:07 +0000)]
Initialize boolean variables in MipsSubtarget's constructor.

llvm-svn: 164642

11 years agoDon't drop the alignment on a memcpy intrinsic when producing a store. This is
Nick Lewycky [Tue, 25 Sep 2012 22:46:21 +0000 (22:46 +0000)]
Don't drop the alignment on a memcpy intrinsic when producing a store. This is
only a missed optimization opportunity if the store is over-aligned, but a
miscompile if the store's new type has a higher natural alignment than the
memcpy did. Fixes PR13920!

llvm-svn: 164641

11 years agoblank line for test commit
Reed Kotler [Tue, 25 Sep 2012 22:34:20 +0000 (22:34 +0000)]
blank line for test commit

llvm-svn: 164640

11 years agoRename CanFitInto64Bits to alwaysFitsInto64Bits per discussion on IRC.
Jordan Rose [Tue, 25 Sep 2012 22:32:51 +0000 (22:32 +0000)]
Rename CanFitInto64Bits to alwaysFitsInto64Bits per discussion on IRC.

This makes the behavior clearer concerning literals with the maximum
number of digits. For a 32-bit example, 4,000,000,000 is a valid uint32_t,
but 5,000,000,000 is not, so we'd have to count 10-digit decimal numbers
as "unsafe" (meaning we have to check for overflow when parsing them,
just as we would for numbers with 11 digits or higher). This is the same,
only with 64 bits to play with.

No functionality change.

llvm-svn: 164639

11 years ago[driver] Add support for the -fno-fast-math option.
Chad Rosier [Tue, 25 Sep 2012 22:03:25 +0000 (22:03 +0000)]
[driver] Add support for the -fno-fast-math option.
rdar://12299433

llvm-svn: 164638

11 years agoRevert the business end of r164634, and replace it with a different fix. The
Nick Lewycky [Tue, 25 Sep 2012 21:50:37 +0000 (21:50 +0000)]
Revert the business end of r164634, and replace it with a different fix. The
reason we were getting two of the same alloca is because of a memmove/memcpy
which had the same alloca in both the src and dest. Now we detect that case
directly. This has the same testcase as before, but fixes a clang test
CodeGenObjC/exceptions.m which runs clang -O2.

llvm-svn: 164636

11 years agoDon't try to promote the same alloca twice. Fixes PR13916!
Nick Lewycky [Tue, 25 Sep 2012 21:15:50 +0000 (21:15 +0000)]
Don't try to promote the same alloca twice. Fixes PR13916!

Chandler, it's not obvious that it's okay that this alloca gets into the list
twice to begin with. Please review and see whether this is the fix you really
want, but I wanted to get a fix checked in quickly.

llvm-svn: 164634

11 years agoAdd --program-prefix support to build
Sebastian Pop [Tue, 25 Sep 2012 21:15:08 +0000 (21:15 +0000)]
Add --program-prefix support to build

llvm-svn: 164633

11 years agoMove remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.
Bill Wendling [Tue, 25 Sep 2012 20:57:48 +0000 (20:57 +0000)]
Move remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.

llvm-svn: 164631

11 years agodocs: Sphinxify HowToSubmitABug
Sean Silva [Tue, 25 Sep 2012 20:52:04 +0000 (20:52 +0000)]
docs: Sphinxify HowToSubmitABug

llvm-svn: 164630

11 years agoMove Attribute::typeIncompatible inside of the Attributes class.
Bill Wendling [Tue, 25 Sep 2012 20:38:59 +0000 (20:38 +0000)]
Move Attribute::typeIncompatible inside of the Attributes class.

llvm-svn: 164629

11 years agoTargetLowering interface to set/get minimum block entries for jump tables.
Sebastian Pop [Tue, 25 Sep 2012 20:35:36 +0000 (20:35 +0000)]
TargetLowering interface to set/get minimum block entries for jump tables.

Provide interface in TargetLowering to set or get the minimum number of basic
blocks whereby jump tables are generated for switch statements rather than an
if sequence.

    getMinimumJumpTableEntries() defaults to 4.
    setMinimumJumpTableEntries() allows target configuration.

    This patch changes the default for the Hexagon architecture to 5
    as it improves performance on some benchmarks.

llvm-svn: 164628

11 years agoRevert r164614 to appease the buildbots.
Chad Rosier [Tue, 25 Sep 2012 19:57:20 +0000 (19:57 +0000)]
Revert r164614 to appease the buildbots.

llvm-svn: 164627

11 years ago[libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.
Argyrios Kyrtzidis [Tue, 25 Sep 2012 19:29:50 +0000 (19:29 +0000)]
[libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.

llvm-svn: 164626

11 years agoImprove upon r164450 and localize the logic of updating the type of
Argyrios Kyrtzidis [Tue, 25 Sep 2012 19:26:39 +0000 (19:26 +0000)]
Improve upon r164450 and localize the logic of updating the type of
a function decl inside the ASTNodeImporter::VisitFunctionDecl function.

llvm-svn: 164625

11 years agoOptimize NumericLiteralParser::GetIntegerValue().
Dmitri Gribenko [Tue, 25 Sep 2012 19:09:15 +0000 (19:09 +0000)]
Optimize NumericLiteralParser::GetIntegerValue().

It does a conservative estimate on the size of numbers that can fit into
uint64_t.  This bound is improved.

llvm-svn: 164624

11 years ago[analyzer] Add tests for symbolic expression liveness.
Jordan Rose [Tue, 25 Sep 2012 19:03:09 +0000 (19:03 +0000)]
[analyzer] Add tests for symbolic expression liveness.

There are very few tests here because SValBuilder is fairly aggressive
about not building SymExprs that we can't evaluate, which saves memory
and CPU but also makes it very much tied to the current constraint
manager. We should probably scale back here and let things decay to
UnknownVal later on.

bitwise-ops.c tests that for the SymExprs we do create, we persist our
assumptions about them. traversal-path-unification.c tests that we do
clean out constraints on arbitrary SymExprs once they have actually died.

llvm-svn: 164623

11 years agoReapply "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Jordan Rose [Tue, 25 Sep 2012 19:03:06 +0000 (19:03 +0000)]
Reapply "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."

Previously, we'd just keep constraints around forever, which means we'd
never be able to merge paths that differed only in constraints on dead
symbols.

Because we now allow constraints on symbolic expressions, not just single
symbols, this requires changing SymExpr::symbol_iterator to include
intermediate symbol nodes in its traversal, not just the SymbolData leaf
nodes.

This depends on the previous commit to be correct. Originally applied in
r163444, reverted in r164275, now being re-applied.

llvm-svn: 164622

11 years ago[analyzer] Calculate liveness for symbolic exprs as well as atomic symbols.
Jordan Rose [Tue, 25 Sep 2012 19:03:01 +0000 (19:03 +0000)]
[analyzer] Calculate liveness for symbolic exprs as well as atomic symbols.

No tests, but this allows the optimization of removing dead constraints.
We can then add tests that we don't do this prematurely.

<rdar://problem/12333297>

Note: the added FIXME to investigate SymbolRegionValue liveness is
tracked by <rdar://problem/12368183>. This patch does not change the
existing behavior.

llvm-svn: 164621

11 years agoUnder certain terrible circumstances (<rdar://problem/10805775>),
Douglas Gregor [Tue, 25 Sep 2012 18:29:14 +0000 (18:29 +0000)]
Under certain terrible circumstances (<rdar://problem/10805775>),
top-level frameworks can actually be symlinked over to embedded
frameworks, and accessed via the top-level framework's headers. In
this case, we need to determine that the framework was *actually* an
embedded framework, so we can load the appropriate top-level module.

llvm-svn: 164620

11 years agoAdded process attach options and also use the SBLaunchInfo and SBAttachInfo.
Greg Clayton [Tue, 25 Sep 2012 18:27:12 +0000 (18:27 +0000)]
Added process attach options and also use the SBLaunchInfo and SBAttachInfo.

llvm-svn: 164619

11 years agoThis patch makes use of recently added relocation reference data. The bulk
Sid Manning [Tue, 25 Sep 2012 18:22:09 +0000 (18:22 +0000)]
This patch makes use of recently added relocation reference data.  The bulk
of this is derived from the Mach-O writer.  Reviewed by: Nick Kledzik.
 * Adds loop to SectionChunk::write traverse references calling the
   writer's fixup handler, applyFixup.
 * Adds method, ELFWriter::buildAtomToAddressMap to that creates a
   mapping from an atom to its runtime address.
 * Adds method, ELFWriter::addressOfAtom to return the runtime address
   of the atom.

llvm-svn: 164618

11 years agoMake this test check the transforms it's actually doing. Also add a test that it
Nick Lewycky [Tue, 25 Sep 2012 18:17:38 +0000 (18:17 +0000)]
Make this test check the transforms it's actually doing. Also add a test that it
doesn't transform the trivially unsafe case.

llvm-svn: 164617

11 years agoAdd missing i64 max/min/umax/umin on 32-bit target
Michael Liao [Tue, 25 Sep 2012 18:08:13 +0000 (18:08 +0000)]
Add missing i64 max/min/umax/umin on 32-bit target

- Turn on atomic6432.ll and add specific test case as well

llvm-svn: 164616

11 years agoARM: Darwin BL/BLX relocations to out-of-range symbols.
Jim Grosbach [Tue, 25 Sep 2012 18:07:17 +0000 (18:07 +0000)]
ARM: Darwin BL/BLX relocations to out-of-range symbols.

When a BL/BLX references a symbol in the same translation unit that is
out of range, use an external relocation. The linker will use this to
generate a branch island rather than a direct reference, allowing the
relocation to resolve correctly.

rdar://12359919

llvm-svn: 164615

11 years agoExpansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Michael Ilseman [Tue, 25 Sep 2012 17:56:47 +0000 (17:56 +0000)]
Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.

llvm-svn: 164614

11 years agoConsistently specify the assembly variant to MatchInstructionImpl.
Bob Wilson [Tue, 25 Sep 2012 17:19:29 +0000 (17:19 +0000)]
Consistently specify the assembly variant to MatchInstructionImpl.

llvm-svn: 164611

11 years agoMacro history (de-)serialization. Deserialization currently reads only the latest...
Alexander Kornienko [Tue, 25 Sep 2012 17:18:14 +0000 (17:18 +0000)]
Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.

Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules.

Reviewers: doug.gregor

Reviewed By: alexfh

CC: cfe-commits, rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D41

llvm-svn: 164610

11 years agoExamine the last, not the first, instruction from the MC matcher.
Bob Wilson [Tue, 25 Sep 2012 16:30:16 +0000 (16:30 +0000)]
Examine the last, not the first, instruction from the MC matcher.

If an MS-style inline asm is matched to multiple instructions, e.g., with a
a WAIT-prefix, then we need to examine the operands of the last instruction
instruction, not the prefix instruction.

llvm-svn: 164608

11 years ago-iframework should allow separate arguments.
Douglas Gregor [Tue, 25 Sep 2012 16:13:41 +0000 (16:13 +0000)]
-iframework should allow separate arguments.

llvm-svn: 164607

11 years agoIntroduce builtin macros to determine whether we're building a
Douglas Gregor [Tue, 25 Sep 2012 15:44:52 +0000 (15:44 +0000)]
Introduce builtin macros to determine whether we're building a
specific module (__building_module(modulename)) and to get the name of
the current module as an identifier (__MODULE__).

Used to help headers behave differently when they're being included as
part of building a module. Oh, the irony.

llvm-svn: 164605

11 years agoA minor doc fix.
Alexander Kornienko [Tue, 25 Sep 2012 12:42:05 +0000 (12:42 +0000)]
A minor doc fix.

llvm-svn: 164601

11 years ago[TSan] fork external symbolizer before starting internal threads
Alexey Samsonov [Tue, 25 Sep 2012 12:35:47 +0000 (12:35 +0000)]
[TSan] fork external symbolizer before starting internal threads

llvm-svn: 164600

11 years agoFix failing test/Sema/wchar.c on ARM.
Hans Wennborg [Tue, 25 Sep 2012 10:11:17 +0000 (10:11 +0000)]
Fix failing test/Sema/wchar.c on ARM.

Currently Sema/wchar.c fails because WCHAR_T_TYPE is defined as int,
however on ARM wchar_t is unsigned int.

This patch changes that, so this test passes for ARM.

Patch by Joey Gouly!

llvm-svn: 164598

11 years agoWhen performing a ::delete of an object with a virtual destructor,
John McCall [Tue, 25 Sep 2012 10:10:39 +0000 (10:10 +0000)]
When performing a ::delete of an object with a virtual destructor,
be sure to delete the complete object pointer, not the original
pointer.  This is necessary if the base being deleted is at a
non-zero offset in the complete object.  This is only required
for objects with virtual destructors because deleting an object
via a base-class subobject when the base does not have a virtual
destructor is undefined behavior.

Noticed while reviewing the last four years of cxx-abi-dev
activity.

llvm-svn: 164597

11 years agoFix a case where SROA did not correctly detect dead PHI or selects due
Chandler Carruth [Tue, 25 Sep 2012 10:03:40 +0000 (10:03 +0000)]
Fix a case where SROA did not correctly detect dead PHI or selects due
to chains or cycles between PHIs and/or selects. Also add a couple of
really nice test cases reduced from Kostya's reports in PR13905 and
PR13906. Both are fixed by this patch.

llvm-svn: 164596

11 years agoChange the way the lint sanity checking pass detects misaligned memory accesses.
Duncan Sands [Tue, 25 Sep 2012 10:00:49 +0000 (10:00 +0000)]
Change the way the lint sanity checking pass detects misaligned memory accesses.
Previously it was only be able to detect problems if the pointer was a numerical
value (eg inttoptr i32 1 to i32*), but not if it was an alloca or globa.  The
reason was the use of ComputeMaskedBits: imagine you have "alloca i8, align 2",
and ask ComputeMaskedBits what it knows about the bits of the alloca pointer.
It can tell you that the bottom bit is known zero (due to align 2) but it can't
tell you that bit 1 is known one.  That's because the address could be an even
multiple of 2 rather than an odd multiple, eg it might be a multiple of 4.  Thus
trying to use KnownOne is ineffective in the case of an alloca as it will never
have any bits set.  Instead look explicitly for constant offsets from allocas
and globals.

llvm-svn: 164595

11 years agoclang/test/CodeGenCXX/microsoft-*: Fix for -Asserts.
NAKAMURA Takumi [Tue, 25 Sep 2012 09:53:18 +0000 (09:53 +0000)]
clang/test/CodeGenCXX/microsoft-*: Fix for -Asserts.

llvm-svn: 164594

11 years agoImplement Mike Herrick's proposed noexcept mangling.
John McCall [Tue, 25 Sep 2012 09:10:17 +0000 (09:10 +0000)]
Implement Mike Herrick's proposed noexcept mangling.

llvm-svn: 164593