Commit Graph

105126 Commits

Author SHA1 Message Date
Duncan Sands d47ba853fc Forgot to commit the changes to this file.
llvm-svn: 130695
2011-05-02 16:34:19 +00:00
Duncan Sands a3e3699c88 Move some rem transforms out of instcombine and into instsimplify.
This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.

llvm-svn: 130694
2011-05-02 16:27:02 +00:00
Rafael Espindola 5164e6e8b2 Add 130690 back.
llvm-svn: 130693
2011-05-02 15:58:16 +00:00
Rafael Espindola e406670954 Only produce the eh_frame section if we have at least one personality function.
llvm-svn: 130692
2011-05-02 15:49:52 +00:00
Rafael Espindola a392475865 Revert while I debug the tests that use march but not mtriple.
llvm-svn: 130691
2011-05-02 15:42:31 +00:00
Rafael Espindola c2aad4f2a3 Move ppc OS X to cfi too. I am building it on an old ppc mini, but it will take some time.
llvm-svn: 130690
2011-05-02 15:00:52 +00:00
Tobias Grosser fe6d9849a1 Add new website for Polly
Use the content of the Polly wiki page[1] to create a new website. I do not yet
plan to officially promote this website, but it is already a solid base that we
can improve and peer review.

[1] http://wiki.llvm.org/Polly

llvm-svn: 130689
2011-05-02 07:48:29 +00:00
Chandler Carruth 5e9f05c2b8 Remove an unused variable in NDEBUG (found with -Wunused-variable).
llvm-svn: 130688
2011-05-02 05:49:01 +00:00
Jakob Stoklund Olesen 7d4067936a Minimize the slot indexes spanned by register ranges created when splitting.
When an interfering live range ends at a dead slot index between two
instructions, make sure that the inserted copy instruction gets a slot index
after the dead ones. This makes it possible to avoid the interference.

Ideally, there shouldn't be interference ending at a deleted instruction, but
physical register coalescing can sometimes do that to sub-registers.

This fixes PR9823.

llvm-svn: 130687
2011-05-02 05:29:58 +00:00
Jakob Stoklund Olesen 55f1e202a8 Add a SlotIndexes::insertMachineInstrInMaps to insert the instruction after any null indexes.
This makes a difference if a live interval is referring to a deleted
instruction. It can be important to insert an instruction before or after a
deleted instruction to avoid interference.

llvm-svn: 130686
2011-05-02 05:29:56 +00:00
Nick Lewycky e75ffa1b78 In option typo correction, consider -foo=VALUE flags as two distinct parts. The
comments claimed it did this, but the LHS value was actually an unused variable.

The new system considers only the '-foo' part when comparing it for typos
against flags that have values, but still look at the whole string for flags
that don't. That way, we'll still correct '-inst=combine' to '-instcombine'.

llvm-svn: 130685
2011-05-02 05:24:47 +00:00
Nick Lewycky 5f1eb968f0 Remove dead variable pointed out by GCC 4.6 warnings, and reflow this a little
to scope a variable more tightly per llvm coding style. No functional change.

llvm-svn: 130684
2011-05-02 05:05:29 +00:00
NAKAMURA Takumi c3a8529269 lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass.
FIXME: We should consider better isysroot scheme on Win32 hosts.
llvm-svn: 130683
2011-05-02 04:50:10 +00:00
NAKAMURA Takumi bb9ffbdc89 test/CodeGenCXX/vtable-debug-info.cpp: It does not crash on mingw.
FIXME: It would crash with -integrated-as. Implement -g on MCCOFF.
llvm-svn: 130682
2011-05-02 04:50:00 +00:00
NAKAMURA Takumi 0760218bca test/CodeGenCXX/debug-info-namespace.cpp: Add explicit -fverbose-asm to cc1 to let cygming pass.
This test seeks a verbose comment in output. By default, "-integrated-as" sets verbose-asm. Cygming is not ready for -integrated-as yet.

llvm-svn: 130681
2011-05-02 04:49:53 +00:00
Nick Lewycky d3c2df8d2b Remove redeclaration of Invalid. The code that set this to true was updating an
Invalid that was never read from again, causing non-type-template-parms to be
marked valid when in fact they weren't.

This was caught by GCC 4.6's -Wunused-but-set-variable warning.

llvm-svn: 130680
2011-05-02 01:48:46 +00:00
Nick Lewycky fc49f72b58 Remove unused variable spotted by GCC.
Devang, can we remove this call entirely? If I try that, "make check" passes
but the call has a side-effect of ensuring that the block's context exists in
the debug info. getContextDescriptor() is used in a void context for that side-
effect elsewhere in this file. Please take a look!

llvm-svn: 130679
2011-05-02 01:41:48 +00:00
Nick Lewycky 82e478009f Remove unused variable, but keep function call with side-effect.
llvm-svn: 130678
2011-05-02 01:07:19 +00:00
Chandler Carruth 61a8dacd00 I updated this constructor's interface, and didn't have to fix any
callers. Shockingly enough, *there are none*!

llvm-svn: 130677
2011-05-02 01:06:57 +00:00
Nick Lewycky cf8714ee7b Remove dead variable caught by GCC.
llvm-svn: 130676
2011-05-02 01:06:15 +00:00
Chandler Carruth 1d352ec6d9 Nuke stale code for separately importing the qualifer -- it's just part
of the QualifierLoc, and that's all we need to import now.

llvm-svn: 130675
2011-05-02 01:01:54 +00:00
Nick Lewycky 1c60a0bc98 Remove dead variable, flagged by gcc's -Wunused-but-set-variable.
llvm-svn: 130674
2011-05-02 00:46:56 +00:00
Nick Lewycky b4175cad29 Remove dead variable flagged by gcc's -Wunused-but-set-variable. No
functionality change.

llvm-svn: 130673
2011-05-02 00:41:17 +00:00
Nick Lewycky 18a1ee7f51 Remove a dead variable flagged by gcc's -Wunused-but-set-variable. No
functionality change.

llvm-svn: 130672
2011-05-02 00:40:24 +00:00
John McCall 824908373e Revise the representation of parameter scope data so that the
scope depth overlaps with the ObjCDeclQualifier, dropping
memory usage back to previous levels.

llvm-svn: 130671
2011-05-02 00:30:12 +00:00
Chandler Carruth 8d26bb0899 Add an optional field attached to a DeclRefExpr which points back to the
Decl actually found via name lookup & overload resolution when that Decl
is different from the ValueDecl which is actually referenced by the
expression.

This can be used by AST consumers to correctly attribute references to
the spelling location of a using declaration, and otherwise gain insight
into the name resolution performed by Clang.

The public interface to DRE is kept as narrow as possible: we provide
a getFoundDecl() which always returns a NamedDecl, either the ValueDecl
referenced or the new, more precise NamedDecl if present. This way AST
clients can code against getFoundDecl without know when exactly the AST
has a split representation.

For an example of the data this provides consider:
% cat x.cc
namespace N1 {
  struct S {};
  void f(const S&);
}
void test(N1::S s) {
  f(s);
  using N1::f;
  f(s);
}

% ./bin/clang -fsyntax-only -Xclang -ast-dump x.cc
[...]
void test(N1::S s) (CompoundStmt 0x5b02010 <x.cc:5:20, line:9:1>
  (CallExpr 0x5b01df0 <line:6:3, col:6> 'void'
    (ImplicitCastExpr 0x5b01dd8 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
      (DeclRefExpr 0x5b01d80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)'))
    (ImplicitCastExpr 0x5b01e20 <col:5> 'const struct N1::S' lvalue <NoOp>
      (DeclRefExpr 0x5b01d58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S')))
  (DeclStmt 0x5b01ee0 <line:7:3, col:14>
    0x5b01e40 "UsingN1::;")
  (CallExpr 0x5b01fc8 <line:8:3, col:6> 'void'
    (ImplicitCastExpr 0x5b01fb0 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
      (DeclRefExpr 0x5b01f80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)' (UsingShadow 0x5b01ea0 'f')))
    (ImplicitCastExpr 0x5b01ff8 <col:5> 'const struct N1::S' lvalue <NoOp>
      (DeclRefExpr 0x5b01f58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S'))))

Now we can tell that the second call is 'using' (no pun intended) the using
declaration, and *which* using declaration it sees. Without this, we can
mistake calls that go through using declarations for ADL calls, and have no way
to attribute names looked up with using declarations to the appropriate
UsingDecl.

llvm-svn: 130670
2011-05-01 23:48:14 +00:00
John McCall 8fb0d9d24a Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields;  here I've just done the lazy thing.

llvm-svn: 130669
2011-05-01 22:35:37 +00:00
Chandler Carruth bbf65b0501 Remove the NameQualifier struct, which was just a wrapper around
NestedNameSpecifierLoc. It predates when we had such an object.

Reference the NNSLoc directly in DREs, and embed it directly into the
MemberNameQualifier struct.

llvm-svn: 130668
2011-05-01 22:14:37 +00:00
Chandler Carruth e68f261dea Several cosmetic changes, no functionality changed.
Mostly trailing whitespace so that me editor nuking it doesn't muddy the
waters of subsequent commits that do change functionality.

Also nukes a stray statement that was harmless but redundant that
I introduced in r130666.

llvm-svn: 130667
2011-05-01 21:55:21 +00:00
Chandler Carruth 0e439960b8 Move the state bits in DeclRefExpr out of the pointer union and into
a bitfield in the base class. DREs weren't using any bits here past the
normal Expr bits, so we have plenty of room. This makes the common case
of getting a Decl out of a DRE no longer need to do any masking etc.

Also, while here, clean up code to use the accessor methods rather than
directly poking these bits, and provide a nice comment for DREs that
includes the information previously attached to the bits going into the
pointer union.

No functionality changed here, but DREs should be a tad faster now.

llvm-svn: 130666
2011-05-01 21:29:53 +00:00
Chandler Carruth 56b579a373 Switch getAs to castAs (didn't know about this before!) and simplify
some code.

llvm-svn: 130665
2011-05-01 21:29:41 +00:00
Chandler Carruth a62d8a50e2 Remove a stale comment, it no longer applied after my cleanups.
Also fix several misspellings in my comments. I cannot spell, and cannot
even be trusted to ask my editor how to spell apparently.

llvm-svn: 130662
2011-05-01 19:18:02 +00:00
Chris Lattner 23f61a09af enhance memcpyopt to obey -fno-builtin and friends. This addresses a
problem reported on cfe-dev.

llvm-svn: 130661
2011-05-01 18:27:11 +00:00
Abramo Bagnara 4d42399d46 Fixed source range for extern linkage specification without braces.
llvm-svn: 130660
2011-05-01 16:25:54 +00:00
Rafael Espindola 9af3d4b193 Add r130624 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
llvm-svn: 130659
2011-05-01 15:45:27 +00:00
Rafael Espindola fc8223670a Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
llvm-svn: 130658
2011-05-01 15:44:13 +00:00
NAKAMURA Takumi 4471f82e91 Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries.
autoconf: Add checking ELM_Callback decl for mingw32 and mingw-w64.
cmake/config-ix.cmake: Add checking ELM_Callback decl for win32.

llvm-svn: 130657
2011-05-01 13:29:49 +00:00
Chandler Carruth 73aa8f7027 Based on the new information in the AST provided by r130628, write
3 lines of code and improve a bunch of information in the libclang view
of the code.

Updates the two tests that exercise this with the new data, checking
that each new source location actually points back to the declared
template parameter.

llvm-svn: 130656
2011-05-01 09:53:37 +00:00
Chandler Carruth af85886563 Move several more type traits' implementations into the AST. A few were
already present in the AST, and I added the ones that weren't.

llvm-svn: 130655
2011-05-01 09:29:58 +00:00
Chandler Carruth 7ba7bd388b Switch __is_scalar to use the isScalarType predicate rather than
duplicating its logic.

llvm-svn: 130654
2011-05-01 09:29:55 +00:00
Chandler Carruth c5276e584e Have the array type traits build an expression with type 'size_t'
instead of 'int'.

The Embarcadero spec says 'unsigned int', not 'int'. That's what
'size_t' is on Windows, but for Clang using a 'size_t' that can be
larger than int seems more appropriate.

llvm-svn: 130653
2011-05-01 08:48:21 +00:00
Chandler Carruth f57eba3b20 Remove an inapplicable and completely out of place comment. The type is in fact 'bool'.
llvm-svn: 130652
2011-05-01 08:48:19 +00:00
Chandler Carruth 0d1a54f8e1 Remove more dead code for emitting diagnostics. The callers of these
functions already precluded dependent types from reaching them.

Also change one of the callers to not error when a trait is applied to
a dependent type. This is a perfectly reasonable pattern, and both Unary
and Binary type traits already support dependent types (by populating
the AST with a nonce value).

Remove the actual diagnostic, since these aren't errors.

llvm-svn: 130651
2011-05-01 08:41:10 +00:00
Argyrios Kyrtzidis d8970dde43 Improve traversing of BlockExprs in RecursiveASTVisitor.
llvm-svn: 130650
2011-05-01 08:06:46 +00:00
Chandler Carruth 9cf632cc35 Simplify the flow of some of the array type trait code.
Completely remove a switch which selected between the same two types.

llvm-svn: 130649
2011-05-01 07:49:26 +00:00
Chandler Carruth 20b9bc8638 Convert the expression trait evaluation to a static function and
a switch with any default case. This both warns when an enumerator is
missing and asserts if a value sneaks through despite the warning.

While in there fix a bunch of coding style issues with this code.

llvm-svn: 130648
2011-05-01 07:44:20 +00:00
Chandler Carruth b42fb19e9b Remove the default case from the unary type trait evaluation function,
adding an unreachable annotation. Remarkably this one was already
enumarting every trait.

llvm-svn: 130647
2011-05-01 07:44:17 +00:00
Chandler Carruth e46eaf3460 Remove a few more bogus returns when the switch covers all the
enumerators.

Also remove a default that led to llvm_unreachable to make another
switch warn if any enumerators fail to be covered.

llvm-svn: 130646
2011-05-01 07:23:23 +00:00
Chandler Carruth 8e2d6f4b31 Remove another default and a *completely* bogus return from a switch
over type traits.

Add the missing trait from this switch that Clang's warning uncovered.

llvm-svn: 130645
2011-05-01 07:23:20 +00:00
Chandler Carruth 8b0cf1d4d3 Mark that this function ends in a covering switch statement with every
case returning a value.

Silences a GCC warning.

llvm-svn: 130644
2011-05-01 07:23:17 +00:00