Commit Graph

74633 Commits

Author SHA1 Message Date
Eli Friedman 36623cc253 Fix an issue in googletest where a name was used before it was defined.
llvm-svn: 91718
2009-12-18 21:38:44 +00:00
Evan Cheng b175de6356 Increase opportunities to optimize (brcond (srl (and c1), c2)).
llvm-svn: 91717
2009-12-18 21:31:31 +00:00
Daniel Dunbar d2d3c7efe3 C++Tests: Add target paths for LLVM-Code-Compile checks as well.
llvm-svn: 91716
2009-12-18 21:27:23 +00:00
Eli Friedman 3a7cdaca33 Fix gcc warning.
llvm-svn: 91715
2009-12-18 21:07:18 +00:00
Daniel Dunbar 91b640abfc Fix a few MSVC warnings.
llvm-svn: 91714
2009-12-18 20:58:47 +00:00
Rafael Espindola 2c5792a6bd Catch more cases of a pointer being marked garbage twice. This helps when
debugging some leaks (PR5770 in particular).

llvm-svn: 91713
2009-12-18 20:35:38 +00:00
Bob Wilson 532cd232fb Reapply 91459 with a simple fix for the problem that broke the x86_64-darwin
bootstrap.  This also replaces the WeakVH references that Chris objected to
with normal Value references.

llvm-svn: 91711
2009-12-18 20:14:40 +00:00
Ted Kremenek af1bdd71af Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.
llvm-svn: 91710
2009-12-18 20:13:39 +00:00
Bob Wilson a8e2997aa0 Fix another parallel make race condition.
llvm-svn: 91709
2009-12-18 20:12:14 +00:00
Victor Hernandez 0471abd58b Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().

llvm-svn: 91708
2009-12-18 20:09:14 +00:00
Daniel Dunbar 45281870ef Use System/DataTypes.h, stdint.h isn't portable.
llvm-svn: 91707
2009-12-18 20:00:49 +00:00
Daniel Dunbar cf7744e44d Fix Win32 Path.inc for API update.
llvm-svn: 91706
2009-12-18 19:59:48 +00:00
Daniel Dunbar c454ecf9d0 ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

llvm-svn: 91705
2009-12-18 19:57:13 +00:00
Douglas Gregor b3fa919c2d Extend code-completion results with the type of each result
llvm-svn: 91702
2009-12-18 18:53:37 +00:00
Dan Gohman 51f13056bd Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
associative either.

llvm-svn: 91701
2009-12-18 18:45:31 +00:00
Daniel Dunbar acde99ea52 ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
- This should be done leveraging the backend, but I'm a little refactored
   out. I'll fix it one day, I promise.

llvm-svn: 91700
2009-12-18 18:42:37 +00:00
John McCall b48971d63f When diagnosing that a decl ref expr is not a value, note the declaration
with "declared at" rather than "previous declaration is here".

llvm-svn: 91699
2009-12-18 18:35:10 +00:00
Torok Edwin d0139fd3e5 Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.
llvm-svn: 91698
2009-12-18 17:43:54 +00:00
Douglas Gregor 4a2ce65dbf Try to de-bork DISABLE_SMART_POINTERS build
llvm-svn: 91696
2009-12-18 17:31:58 +00:00
Anders Carlsson 28a133d602 CK_UserDefinedConversion is a valid kind when doing copy ctor elision.
llvm-svn: 91695
2009-12-18 17:29:21 +00:00
Torok Edwin 029707885c Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.

llvm-svn: 91694
2009-12-18 17:29:14 +00:00
Rafael Espindola b73b4fd30e Fix libstdc++ build on ARM linux and part of PR5770.
MI was not being used but it was also not being deleted, so it was kept in the garbage list. The memory itself was freed once the function code gen was done.

Once in a while the codegen of another function would create an instruction on the same address. Adding it to the garbage group would work once, but when another pointer was added it would cause an assert as "Cache" was about to be pushed to Ts.

For a patch that make us detect problems like this earlier, take a look at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092758.html

With that patch we assert as soon and the new instruction is added to the garbage set.

llvm-svn: 91691
2009-12-18 16:59:39 +00:00
Douglas Gregor f72b6ac87f Change clang_codeComplete API to return the results in a structure on
the heap, so that clients are not forced to copy the results during
the initial iteration. A separate clang_disposeCodeCompleteResults
function frees the returned results.

llvm-svn: 91690
2009-12-18 16:20:58 +00:00
Ken Dyck 01e620efaa Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing 
quantities that are in bit and character units.

llvm-svn: 91689
2009-12-18 15:55:54 +00:00
Ken Dyck acfe6aa83a Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.

llvm-svn: 91688
2009-12-18 15:24:05 +00:00
Anders Carlsson 0087bc851c Fix regression I introduced when dynamic_cast-ing to a reference type.
llvm-svn: 91687
2009-12-18 14:55:04 +00:00
Anders Carlsson b396f43520 It's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions.
llvm-svn: 91686
2009-12-18 14:42:03 +00:00
John Thompson 6f8dba7f9e Tweaks for PS3 target.
llvm-svn: 91685
2009-12-18 14:21:08 +00:00
John Thompson 551446b31b Removing trailing directory separator, to make stat work
llvm-svn: 91684
2009-12-18 14:18:21 +00:00
Ken Dyck d4d4d6931c Initial implementation of CharUnits, an opaque value class for representing
sizes, offsets, and alignments in character units.

llvm-svn: 91683
2009-12-18 13:39:46 +00:00
Tilmann Scheller 5b2df8dcb5 Fix wrong frame pointer save offset in the 64-bit PowerPC SVR4 ABI.
Patch contributed by Ken Werner of IBM!

llvm-svn: 91681
2009-12-18 13:00:34 +00:00
Tilmann Scheller 79fef9349c Add support for calls through function pointers in the 64-bit PowerPC SVR4 ABI.
Patch contributed by Ken Werner of IBM!

llvm-svn: 91680
2009-12-18 13:00:15 +00:00
Mikhail Glushenkov d7015906d0 Make 'set_option' work with list options.
This works now: (set_option "list_opt", ["val_1", "val_2", "val_3"])

llvm-svn: 91679
2009-12-18 11:27:26 +00:00
John McCall d43784feae Set up the semantic context correctly when declaring a friend class template.
llvm-svn: 91678
2009-12-18 11:25:59 +00:00
John McCall c3f09ad253 Look through using decls when checking whether a name is an acceptable
nested-name specifier name.

I accidentally checked in the test case for this in the last commit ---
fortunately, that refactor was inspired by having debugged this problem already,
so I can fix the bug quick (though probably not fast enough for the buildbots).

llvm-svn: 91677
2009-12-18 10:48:10 +00:00
John McCall ea305edd63 Pull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
different functions and pick the function at lookup initialization time.
In theory we could actually divide the criteria functions into N different
functions for the N cases, but it's so not worth it.

Among other things, lets us invoke LookupQualifiedName without recomputing
IDNS info every time.

Do some refactoring in SemaDecl to avoid an awkward special case in LQN
that was only necessary for redeclaration testing for anonymous structs/unions ---
which could be done more efficiently with a scoped lookup anyway.

llvm-svn: 91676
2009-12-18 10:40:03 +00:00
Eli Friedman 86b9d75dc8 Optimize icmp of null and select of two constants even if the select has
multiple uses.  (The construct in question was found in gcc.)

llvm-svn: 91675
2009-12-18 08:22:35 +00:00
Evan Cheng 4cf30b72bf On recent Intel u-arch's, folding loads into some unary SSE instructions can
be non-optimal. To be precise, we should avoid folding loads if the instructions
only update part of the destination register, and the non-updated part is not
needed. e.g. cvtss2sd, sqrtss. Unfolding the load from these instructions breaks
the partial register dependency and it can improve performance. e.g.

movss (%rdi), %xmm0
cvtss2sd %xmm0, %xmm0

instead of
cvtss2sd (%rdi), %xmm0

An alternative method to break dependency is to clear the register first. e.g.
xorps %xmm0, %xmm0
cvtss2sd (%rdi), %xmm0

llvm-svn: 91672
2009-12-18 07:40:29 +00:00
Daniel Dunbar a7d0231b66 clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
llvm-svn: 91671
2009-12-18 06:30:12 +00:00
Douglas Gregor 357b6fd3e5 Address some of Anders comments
llvm-svn: 91670
2009-12-18 05:19:44 +00:00
Douglas Gregor e1314a64b8 Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

  - InitializationSequence now has a "C conversion sequence" category
    and step kind, which falls back to
  - Changed the diagnostics for returns to always have the result type
    of the function first and the type of the expression second.
    CheckSingleAssignmentConstraints to peform checking in C. 
  - Improved ASTs for initialization of return values. The ASTs now
    capture all of the temporaries we need to create, but
    intentionally do not bind the tempoary that is actually returned,
    so that it won't get destroyed twice.
  - Make sure to perform an (elidable!) copy of the class object that
    is returned from a class.
  - Fix copy elision in CodeGen to properly see through the
    subexpressions that occur with elidable copies.
  - Give "new" its own entity kind; as with return values and thrown
    objects, we don't bind the expression so we don't call a
    destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.

llvm-svn: 91669
2009-12-18 05:02:21 +00:00
Dan Gohman 7a2dab8826 Revert this use of NSW; this one isn't actually safe. NSW addition
is not reassociative.

llvm-svn: 91667
2009-12-18 03:57:04 +00:00
Dan Gohman 57e808628c Eliminte unnecessary uses of <cstdio>.
llvm-svn: 91666
2009-12-18 03:25:51 +00:00
Dan Gohman 4e3b29e309 Add utility routines for NSW multiply.
llvm-svn: 91664
2009-12-18 03:10:26 +00:00
Dan Gohman 4ab4420d7a Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.

llvm-svn: 91662
2009-12-18 02:58:50 +00:00
Daniel Dunbar 24c7f5efc5 Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
 - Used by parts of Darwin build process to check compiler flags, etc.
 - <rdar://problem/7256886> clang does not emit AT_APPLE_flags

llvm-svn: 91661
2009-12-18 02:43:17 +00:00
Dan Gohman 916fec41fb Delete an unused variable.
llvm-svn: 91659
2009-12-18 02:14:37 +00:00
Mike Stump 0da53228e6 Handle case when DestPtr is 0.
llvm-svn: 91658
2009-12-18 02:14:27 +00:00
Eric Christopher 4c155350f1 Fix typo.
llvm-svn: 91657
2009-12-18 02:12:53 +00:00
Dan Gohman b256ccfbe5 Preserve NSW information in more places.
llvm-svn: 91656
2009-12-18 02:09:29 +00:00