Commit Graph

75840 Commits

Author SHA1 Message Date
Fariborz Jahanian 1c2cb6df9e Fix rewriting for forward class declaration.
(fixes radar 6969189).

llvm-svn: 93201
2010-01-11 22:48:40 +00:00
Chris Lattner a6b1356cf9 Disable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the
trunc has multiple uses.  Codegen is not able to coalesce the subreg case 
correctly and so this leads to higher register pressure and spilling (see PR5997).

This speeds up 256.bzip2 from 8.60 -> 8.04s on my machine, ~7%.

llvm-svn: 93200
2010-01-11 22:45:25 +00:00
Douglas Gregor 88f3eb898a When performing name lookup into a scope, check that its entity is
non-NULL before looking at the entity itself.

llvm-svn: 93199
2010-01-11 22:40:45 +00:00
David Chisnall 394bf0d0ba Allow VLAs in C++ if in GNU mode (GNU C++ permits them). Clang can now compile LanguageKit, although the resulting code crashes (although not in any of the functions that use VLAs).
llvm-svn: 93198
2010-01-11 22:33:19 +00:00
Victor Hernandez 9d75c966e0 Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work
llvm-svn: 93197
2010-01-11 22:31:58 +00:00
Douglas Gregor d615026e8d C++0x [dcl.typedef]p4, take 3, where we actually figure out what "that
is not also a typedef-name" actually means. For anyone keeping score,
that's John: 2, Doug: 0.

llvm-svn: 93196
2010-01-11 22:30:10 +00:00
Tobias Grosser b53e826103 Remove trailing white spaces in post dominators header file
llvm-svn: 93195
2010-01-11 22:22:46 +00:00
Tobias Grosser 829e8a75a1 Add getNode() to post dominators.
Implement the same interface as already available for dominators.

llvm-svn: 93194
2010-01-11 22:22:32 +00:00
Douglas Gregor 323ade5ac8 Use isa<ElaboratedType> rather than getAs<ElaboratedType>, since the
latter may (eventually) perform multiple levels of desugaring (thus
breaking the newly-added tests) and the former is faster. Thanks, John!

llvm-svn: 93192
2010-01-11 22:04:54 +00:00
Evan Cheng 99789a7a76 Extend r93152 to work on OR r, r. If the source set bits are known not to overlap, then select as an ADD instead.
llvm-svn: 93191
2010-01-11 22:03:29 +00:00
Douglas Gregor 7419ce72ae Add test case from PR5763
llvm-svn: 93190
2010-01-11 21:58:49 +00:00
Chris Lattner f0d26d4b74 reduce this to a sensible testcase.
llvm-svn: 93189
2010-01-11 21:58:19 +00:00
Douglas Gregor 9dd13ab202 Allow redefinitions of typedef-names within class scope when the type
they redefine is a class-name but not a typedef-name, per C++0x
[dcl.typedef]p4. The code in the test was valid C++98 and is valid
C++0x, but an unintended consequence of DR56 made it ill-formed in
C++03 (which we were luck enough to implement). Fixes PR5455.

llvm-svn: 93188
2010-01-11 21:54:40 +00:00
David Greene eb103c404b Shorten up this testcase.
llvm-svn: 93187
2010-01-11 21:50:35 +00:00
Fariborz Jahanian 2990c029ad Fix a problem related to rewrite of anonymous unions.
(fixes radar 6948022)

llvm-svn: 93186
2010-01-11 21:17:32 +00:00
Evan Cheng 7bdf339602 Revert 93158. It's breaking quite a few x86_64 tests.
llvm-svn: 93185
2010-01-11 21:13:41 +00:00
Jakob Stoklund Olesen d2a1bee2d4 Avoid adding PHI arguments for a predecessor that has gone away when a BRCOND was constant folded.
This fixes PR5980.

llvm-svn: 93184
2010-01-11 21:02:33 +00:00
Benjamin Kramer 93ad708a46 Remove unused string functions.
llvm-svn: 93183
2010-01-11 20:33:12 +00:00
Evan Cheng c5f8184eec Do not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable.
llvm-svn: 93182
2010-01-11 20:18:04 +00:00
Benjamin Kramer 378083101c Fix pasto.
llvm-svn: 93181
2010-01-11 20:15:06 +00:00
Mon P Wang ec57c81e64 Disable transformation of select of two loads to a select of address and then a load if the
loads are not in the default address space because the transformation discards src value info.

llvm-svn: 93180
2010-01-11 20:12:49 +00:00
Chris Lattner e3e76e2a69 Use the new isInteger() method in a couple places, some random cleanup, and
add a fixme.

llvm-svn: 93179
2010-01-11 19:58:10 +00:00
Douglas Gregor b90b66178e When resolving a single function template specialization to a
function, be sure to adjust the resulting argument type to a pointer
(if necessary). Fixes PR5910 and PR5949.

llvm-svn: 93178
2010-01-11 19:55:36 +00:00
Douglas Gregor 0662b16ad2 Test case for naming of conversion function template specializations
llvm-svn: 93177
2010-01-11 19:52:23 +00:00
Benjamin Kramer 0129bd7432 Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).
llvm-svn: 93175
2010-01-11 19:46:28 +00:00
Benjamin Kramer 6bf8240762 Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
llvm-svn: 93174
2010-01-11 19:45:18 +00:00
Douglas Gregor 2159182078 When computing surrogates for calls to a value of object type, look
for all visible conversion functions.

llvm-svn: 93173
2010-01-11 19:36:35 +00:00
Devang Patel d1a8969dd2 Add top level section for named metadata.
llvm-svn: 93172
2010-01-11 19:35:55 +00:00
Ken Dyck de37a67f50 Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.
llvm-svn: 93171
2010-01-11 19:19:56 +00:00
Jeffrey Yasskin f991bbb0c1 Improve unclear bits and inaccuracies in structure and insertvalue
documentation.

Patch by Dustin Laurence!

llvm-svn: 93170
2010-01-11 19:19:26 +00:00
David Chisnall c8fc573ea0 Fix type mismatch on 64-bit platforms (GNU ObjC).
llvm-svn: 93169
2010-01-11 19:02:35 +00:00
Douglas Gregor 217604ac71 Remove some pointless FIXMEs. No functionality change
llvm-svn: 93168
2010-01-11 19:00:50 +00:00
Jeffrey Yasskin 81e7fb15e9 Update the -tailcallopt description to match djg's improvements to the calling
convention. 

llvm-svn: 93167
2010-01-11 18:53:47 +00:00
Douglas Gregor 133bc74d7a Add support for out-of-line definitions of conversion function
templates. Previously, a little thinko in the code that replaced a
conversion function template with its redeclaration was causing some
very weird lookup behavior.

llvm-svn: 93166
2010-01-11 18:53:25 +00:00
Devang Patel 8992323bb9 s/NextValueNo/NextMDValueNo while processing metadata.
llvm-svn: 93165
2010-01-11 18:52:33 +00:00
Douglas Gregor bb91767b82 Tighten up the "cannot return array or function type" diagnostic to
say either "array type" or "function type", whichever it is. No reason
to make the user guess.

llvm-svn: 93164
2010-01-11 18:46:21 +00:00
Benjamin Kramer 0ef736fef2 Turns out llvm-gcc still uses SplitString with a vector. Add it back until I
have a fix.

llvm-svn: 93163
2010-01-11 18:44:35 +00:00
Douglas Gregor ea0a0a9b3f Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

  struct X { template<typename T> operator T*(); } x;

when we call

  x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

  template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example). 

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.

llvm-svn: 93162
2010-01-11 18:40:55 +00:00
Benjamin Kramer c6fe3c3273 Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.

llvm-svn: 93161
2010-01-11 18:03:24 +00:00
Dan Gohman e99a3c191e Use a 32-bit and with implicit zero-extension instead of a 64-bit and if it
has an immediate with at least 32 bits of leading zeros, to avoid needing to
materialize that immediate in a register first.

FileCheckize, tidy, and extend a testcase to cover this case.

This fixes rdar://7527390.

llvm-svn: 93160
2010-01-11 17:58:34 +00:00
Fariborz Jahanian 9146e44124 Fixup rewrite of ivars accessed via an explicit object
in a function. Fixes radar 7522803.

llvm-svn: 93159
2010-01-11 17:50:35 +00:00
Dan Gohman 3a55686345 Re-instate MOV64r0 and MOV16r0, with adjustments to work with the
new AsmPrinter. This is perhaps less elegant than describing them
in terms of MOV32r0 and subreg operations, but it allows the
current register to rematerialize them.

llvm-svn: 93158
2010-01-11 17:37:57 +00:00
Dan Gohman 31e8637ac2 Generalize this check to avoid depending on a specific register assignment.
llvm-svn: 93157
2010-01-11 17:24:27 +00:00
Dan Gohman 355ebc7f58 Make this test less trivial, to avoid spurious failures.
llvm-svn: 93156
2010-01-11 17:23:56 +00:00
Dan Gohman f6e8369a5b Pattern top-level operators don't need to be restricted to a
single user. The _su forms are intended for non-top-level nodes.

llvm-svn: 93155
2010-01-11 17:21:05 +00:00
Dan Gohman 40ea3e5ce2 Reword this comment to reference a more fundamental issue.
llvm-svn: 93154
2010-01-11 17:14:46 +00:00
Ken Dyck 40775003e6 Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate. 

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, 
fromQuantity(), and getQuantity() for clarity.

llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Evan Cheng 64d9f40557 Select an OR with immediate as an ADD if the input bits are known zero. This allow the instruction to be 3address-fied if needed.
llvm-svn: 93152
2010-01-11 17:03:47 +00:00
David Greene 206351a1ff Implement a feature (-vector-unaligned-mem) to allow targets to
ignore alignment requirements for SIMD memory operands.  This
is useful on architectures like the AMD 10h that do not trap on
unaligned references if a status bit is twiddled at startup time.

llvm-svn: 93151
2010-01-11 16:29:42 +00:00
Sebastian Redl 9a8dd0db89 Make Clang complain about taking the address of an unqualified member function. Fixes PR5985.
llvm-svn: 93150
2010-01-11 15:56:56 +00:00