Commit Graph

78912 Commits

Author SHA1 Message Date
Dan Gohman e790b61ebd Add more information to the getSizeOf comment.
llvm-svn: 97140
2010-02-25 15:55:28 +00:00
Dan Gohman 91bf1914da Remove this paragraph. Vectors may not always have the same layout as
arrays now.

llvm-svn: 97139
2010-02-25 15:53:42 +00:00
Jakob Stoklund Olesen 5a8f9acaa8 Revert patches r97122 r97127 r97129 r97131.
They were breaking clang-x86_64-darwin10-selfhost

llvm-svn: 97138
2010-02-25 15:47:53 +00:00
Dan Gohman 9b80f86e5b Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.

llvm-svn: 97137
2010-02-25 15:20:39 +00:00
Gabor Greif 5c07926d44 Add "template" keyword at strategic position to fix
compilation using g++ v3.4.

I'll watch the buildbots and back out if necessary.
Feel free to do the same if something breaks.

Without this patch I get (on g++ 3.4.6) following error:

In file included from clang/lib/Sema/SemaTemplate.cpp:14:
clang/lib/Sema/TreeTransform.h: In member function `clang::ASTOwningResult<&clang::ActionBase::DeleteExpr> clang::TreeTransform<Derived>::RebuildCXXPseudoDestructorExpr(clang::ASTOwningResult<&clang::ActionBase::DeleteExpr>, clang::SourceLocation, bool, clang::NestedNameSpecifier*, clang::SourceRange, clang::TypeSourceInfo*, clang::SourceLocation, clang::SourceLocation, clang::PseudoDestructorTypeStorage)':
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before '>' token
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before ')' token
make[4]: *** [clang/lib/Sema/Release/SemaTemplate.o] Error 1

llvm-svn: 97136
2010-02-25 13:04:33 +00:00
John McCall 21b57fa4e5 When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't
initialize it.

Fixes PR6421, which is such a very straightforward extension of PR6398 that I
should have worked it into the last test case (and therefore caught it then).
Ah well.

llvm-svn: 97135
2010-02-25 10:46:05 +00:00
Chandler Carruth b306bcc266 Fix a really trivial crasher and begin fleshing out one of the namespace test
cases.

llvm-svn: 97134
2010-02-25 09:32:59 +00:00
Daniel Dunbar 0076d94466 Add a minimal C interpreter example.
- Demonstrates how to build a standalone tool which loads source code using the
   Driver and Frontend libraries, and then uses CodeGen and the JIT to actually
   execute the code.

 - Still more complicated than it should be, but hey its only 153 lines. :)

--
ddunbar@ozzy:tmp$ cat hello.c
#include <stdio.h>
int main() { printf("hello world\n"); return 0; }
ddunbar@ozzy:tmp$ clang-interpreter hello.c
hello world
--

llvm-svn: 97133
2010-02-25 08:49:05 +00:00
Nick Lewycky a72e1af8bf Make the side-numbering of instructions used by metadata (which is needed to
keep track of instructions that return void) per-function. This fixes PR5278.

This breaks backwards compatibility with the metadata format. That's okay
because we haven't released the metadata bitcode yet.

llvm-svn: 97132
2010-02-25 08:30:17 +00:00
Zhongxing Xu ee29cc3b66 Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.
llvm-svn: 97131
2010-02-25 07:57:35 +00:00
Chris Lattner 62702da070 Implement the first half of redundancy factoring: efficiently
splitting all the patterns under scope nodes into equality sets
based on their first node.  The second step is to rewrite the
graph info a form that exposes the sharing.  Before I do this, 
I want to redesign the Scope node.

llvm-svn: 97130
2010-02-25 07:45:24 +00:00
Zhongxing Xu 9516feac36 Move the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().
llvm-svn: 97129
2010-02-25 07:36:34 +00:00
Chandler Carruth 8fa1e7eec4 Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.

llvm-svn: 97128
2010-02-25 07:20:54 +00:00
Zhongxing Xu 2fa52b06d0 Add comments.
llvm-svn: 97127
2010-02-25 07:03:08 +00:00
Dan Gohman a9c205cc88 Make LoopSimplify change conditional branches in loop exiting blocks
which branch on undef to branch on a boolean constant for the edge
exiting the loop. This helps ScalarEvolution compute trip counts for
loops.

Teach ScalarEvolution to recognize single-value PHIs, when safe, and
ForgetSymbolicName to forget such single-value PHI nodes as apprpriate
in ForgetSymbolicName.

llvm-svn: 97126
2010-02-25 06:57:05 +00:00
Chris Lattner 1f2adb6f35 factor the print method better.
llvm-svn: 97125
2010-02-25 06:53:39 +00:00
Nick Lewycky ba8ec9a9e4 Dump the presence of attached metadata even if we don't know what it is. This
format is not parsable, even if the module is legal. To get parsable output,
dump the module instead of the function or smaller, since metadata kind are
attached to the module (not the context).

llvm-svn: 97124
2010-02-25 06:53:04 +00:00
Chris Lattner 212e8c87ae add methods to do equality checks and get hashes of Matchers
llvm-svn: 97123
2010-02-25 06:49:58 +00:00
Zhongxing Xu 14863610f9 Call inliner improvements:
This patch implements the CallEnter/CallExit idea of Ted.

Add two interfaces to GRSubEngine: ProcessCallEnter, ProcessCallExit.

The CallEnter program point uses caller's location context. The
CallExit program point uses callee's location context.

CallEnter is built by GRStmtNodeBuilder. CallExit is built by
GREndPathNodeBuilder.

llvm-svn: 97122
2010-02-25 06:46:30 +00:00
Nick Lewycky 614fb949b9 Modernize comment.
llvm-svn: 97121
2010-02-25 06:39:10 +00:00
Nick Lewycky dc835c4361 Correct whitespace.
llvm-svn: 97120
2010-02-25 06:38:51 +00:00
Jeffrey Yasskin 6b718f73a5 Try r96559 for the third time. This time the shared library is only built if
--enable-shared is passed to configure.

llvm-svn: 97119
2010-02-25 06:34:33 +00:00
Ted Kremenek b663ffe5f8 Add MacOSXAPIChecker, a meta checker to include various precondition checks for calls
to various MacOS X functions.  The checks in BasicObjCFoundationChecks.cpp will
gradually be migrated here.

As a first check, check that when 'dispatch_once()' is passed a predicate value
that has non-local storage.

llvm-svn: 97116
2010-02-25 05:44:09 +00:00
Ted Kremenek 5563dea713 When generating error node, check to see if we already cached out.
llvm-svn: 97115
2010-02-25 05:44:05 +00:00
Sanjiv Gupta 9ac3092d34 Targets (like pic16) may have mangled the name of global variables,
so get the name from Var rather than the original decl.

llvm-svn: 97114
2010-02-25 05:20:44 +00:00
Douglas Gregor 5a6872400b Update CMake makefiles
llvm-svn: 97113
2010-02-25 04:52:01 +00:00
Douglas Gregor cd3f49fc88 Restore the invariant that a nested-name-specifier can only contain
class types, dependent types, and namespaces. I had previously
weakened this invariant while working on parsing pseudo-destructor
expressions, but recent work in that area has made these changes
unnecessary.

llvm-svn: 97112
2010-02-25 04:46:04 +00:00
Daniel Dunbar 400a6939a8 Frontend: Add CodeGenAction::takeModule().
llvm-svn: 97111
2010-02-25 04:37:50 +00:00
Daniel Dunbar cea0c70f12 Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.
This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

llvm-svn: 97110
2010-02-25 04:37:45 +00:00
Anders Carlsson 01bbef516e Remove dead code.
llvm-svn: 97109
2010-02-25 03:57:50 +00:00
Sanjiv Gupta ad117dac4b Each field of auxiliary debug entry is only 1 byte long.
llvm-svn: 97108
2010-02-25 03:54:49 +00:00
Anders Carlsson 422f778ba1 Move the vcall and vbase offset layout code out into its own class.
llvm-svn: 97107
2010-02-25 03:45:56 +00:00
Daniel Dunbar 3babf5df64 Driver: Allow driver title (for --help) to be overridden by clients.
llvm-svn: 97106
2010-02-25 03:31:53 +00:00
Johnny Chen 90adefcf7e Added tNOP for disassembly only.
llvm-svn: 97105
2010-02-25 03:28:51 +00:00
Ted Kremenek d98d22b9af Enhance the unused ivar checker to not consider an ivar to be accidentally unused
when it is explicitly marked as unused via __attribute__((unused)).

llvm-svn: 97104
2010-02-25 03:26:55 +00:00
Ted Kremenek 6bf658abef Allow __attribute__((unused)) to be applied to ObjC ivars.
llvm-svn: 97103
2010-02-25 03:26:51 +00:00
Daniel Dunbar 12ee380a61 Driver: Use TextDiagnosticPrinter instead of a custom one.
llvm-svn: 97102
2010-02-25 03:23:43 +00:00
Daniel Dunbar aa7d55a3fe Add TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
messages with.

llvm-svn: 97101
2010-02-25 03:23:40 +00:00
Dan Gohman ec4e1b67bf Truncate from i64 to i32 is "free" on x86-32, because it involves
just discarding one of the registers.

llvm-svn: 97100
2010-02-25 03:04:36 +00:00
Scott Michel 4a99c34873 Revert this patch for the time being. Needs more testing.
llvm-svn: 97099
2010-02-25 02:32:54 +00:00
Johnny Chen 57656da73f Added tSVC and tTRAP for disassembly only.
llvm-svn: 97098
2010-02-25 02:21:11 +00:00
Chris Lattner fef371d2f6 formatting.
llvm-svn: 97097
2010-02-25 02:09:00 +00:00
Chris Lattner 2c3f6492b0 rename fooMatcherNode to fooMatcher.
llvm-svn: 97096
2010-02-25 02:04:40 +00:00
Douglas Gregor 6aade28fd3 Remove some oogly code made dead by the pseudo-destructor
instantiation changes.

llvm-svn: 97095
2010-02-25 02:00:27 +00:00
Chris Lattner c36ab923c6 add some noop code to push it out of my tree.
llvm-svn: 97094
2010-02-25 01:57:41 +00:00
Chris Lattner ac55f9df88 rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.

llvm-svn: 97093
2010-02-25 01:56:48 +00:00
Douglas Gregor 678f90df09 Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

  p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.

llvm-svn: 97092
2010-02-25 01:56:36 +00:00
Scott Michel 0ab0ad93bd Large stack frame patch for the CellSPU: handle stack frames that exceed 8176
(511*16) bytes register displacement (D-form).

NOTE: This is a potential headache, given the SPU's local core limitations,
allowing the software developer to commit stack overrun suicide unknowingly.
Also, large SPU stack frames will cause code size explosion. But, one presumes
that the software developer knows what they're doing...

Contributed by Kalle.Raiskila@nokia.com, edited slightly before commit.

llvm-svn: 97091
2010-02-25 01:53:17 +00:00
John McCall 65eb879d22 Catch more uses of uninitialized implicit conversion sequences.
When diagnosing bad conversions, skip the conversion for ignored object
arguments.  Fixes PR 6398.

llvm-svn: 97090
2010-02-25 01:37:24 +00:00
Jeffrey Yasskin e776fbfb82 Filter the future all-of-llvm shared library out of the llvm-config
results.  I'm checking this in before the shared library so that I can
tell if it breaks anything on its own.

llvm-svn: 97089
2010-02-25 01:21:38 +00:00