Commit Graph

110151 Commits

Author SHA1 Message Date
Sean Callanan 763d72a1fd Fixed a bug in which the DWARF reader did not distinguish
appropriately between C++ static methods and non-static
methods.  This bug made it impossible to call most static
methods, either because Clang did not recognize that a
method could be called without providing a "this"
parameter, or because Clang did not properly mangle the
name of the method when searching for it in the target.

Also added a testcase.

llvm-svn: 136733
2011-08-02 22:21:50 +00:00
Nick Lewycky e8ae02dfb9 Teach InstCombine that lifetime intrincs aren't a real user on the result of a
malloc call.

llvm-svn: 136732
2011-08-02 22:08:01 +00:00
Jakob Stoklund Olesen d2a7d1ed97 Extend the SpillPlacement interface with two new features.
The PrefBoth constraint is used for blocks that ideally want a live-in
value both on the stack and in a register. This would be used by a block
that has a use before interference forces a spill.

Secondly, add the ChangesValue flag to BlockConstraint. This tells
SpillPlacement if a live-in value on the stack can be reused as a
live-out stack value for free. If the block redefines the virtual
register, a spill would be required for that.

This extra information will be used by SpillPlacement to more accurately
calculate spill costs when a value can exist both on the stack and in a
register.

The simplest example is a basic block that reads the virtual register,
but doesn't change its value. Spilling around such a block requires a
reload, but no spill in the block.

The spiller already knows this, but the spill placer doesn't. That can
sometimes lead to suboptimal regions.

llvm-svn: 136731
2011-08-02 21:53:03 +00:00
Bill Wendling bbcb7cde34 Add the documentation for the 'landingpad' instruction. Improve the 'invoke'
instruction's documentation to reference the landingpad and resume instructions.

llvm-svn: 136729
2011-08-02 21:52:38 +00:00
Rafael Espindola 56a7dab0c4 Update for LLVM change in PassManagerBuilder.
llvm-svn: 136728
2011-08-02 21:51:02 +00:00
Rafael Espindola 3ea478b7ac Move methods in PassManagerBuilder offline.
llvm-svn: 136727
2011-08-02 21:50:27 +00:00
Rafael Espindola 591eaa481e move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,
but it solves a layering violation since things in Support are not supposed to
use things in Transforms.

llvm-svn: 136726
2011-08-02 21:50:24 +00:00
Chris Lattner f51dae0378 disable array bounds overflow warning for cases where an array
has a single element.  This disables the warning in cases where
there is a clear bug, but this is really rare (who uses arrays
with one element?) and it also silences a large class of false
positive issues with C89 code that is using tail padding in structs.

A better version of this patch would detect when an array is in
a tail position in a struct, but at least patch fixes the huge
false positives that are hitting postgres and other code.

llvm-svn: 136724
2011-08-02 21:44:23 +00:00
Eli Friedman 366bccefad Add new atomic instructions to SCCP. No functional change, but stops debug spam.
llvm-svn: 136723
2011-08-02 21:35:16 +00:00
Nick Lewycky 99890a225f Lifetime intrinsics on undef are dead.
llvm-svn: 136722
2011-08-02 21:19:27 +00:00
Chad Rosier 8c9d9b2f0f Update the default bug report url in autoconf.
llvm-svn: 136721
2011-08-02 20:53:43 +00:00
Johnny Chen 8f3d8384be Patch by David Forsythe to build lldb on FreeBSD!
I did not take the patch for ClangExpressionParser.cpp since there was a
recent change by Peter for the same line.  Feel free to disagree. :-)

Reference:
----------------------------------------------------------------------
r136580 | pcc | 2011-07-30 15:42:24 -0700 (Sat, 30 Jul 2011) | 3 lines

Add reloc arg to standard JIT createJIT()

Fixes non-__APPLE__ build.  Patch by Matt Johnson!
----------------------------------------------------------------------

Also, I ignore the part of the patch to remove the RegisterContextDarwin*.h/.cpp.

llvm-svn: 136720
2011-08-02 20:52:42 +00:00
Chad Rosier 7b15b2e828 Fix cmake for r136702 (at least for the most part). Chandler has been kind
enough to offer to investigate the underlying issue.  Thanks to Doug for his
assistance as well.

llvm-svn: 136719
2011-08-02 20:44:34 +00:00
Chris Lattner d3d65ab791 no need to count the terminators.
llvm-svn: 136718
2011-08-02 20:29:13 +00:00
Fariborz Jahanian c7c346fd13 objective-c rewrite: Fixes rewriting of objective-c collection
statement inside a block. // rdar://9878420

llvm-svn: 136717
2011-08-02 20:28:46 +00:00
Rafael Espindola c48e10cd54 Assume .cfi_startproc is the first thing in a function. If the function is
externally visable, create a local symbol to use in the CFE. If not, use the
function label itself.

Fixes PR10420.

llvm-svn: 136716
2011-08-02 20:24:22 +00:00
Greg Clayton 819122dc1a Remove libEnhancedDisassembly.dylib
llvm-svn: 136713
2011-08-02 19:00:17 +00:00
Eli Friedman 04c5025cd5 Don't create a ridiculous EXTRACT_ELEMENT. PR10563.
The testcase looks extremely fragile, so I'm adding an assertion which should catch any cases like this.

llvm-svn: 136711
2011-08-02 18:38:35 +00:00
Chad Rosier edbb3ef902 Temporarily revert parts of r136702 to make cmake builds happy.
Someone with more cmake experience want to throw me a bone? :)

llvm-svn: 136709
2011-08-02 18:33:29 +00:00
Douglas Gregor 3b65ed0a5c Change the hashing function for DeclContext lookup within an AST file
by eliminating the type ID from constructor, destructor, and
conversion function names. There are several reasons for this change:
  - A given type (say, int*) isn't guaranteed to have a single, unique
  type ID within a chain of PCH files. Hence, we could end up hashing
  based on the wrong type ID, causing name lookup to fail.

  - The mapping from types back to type IDs required one DenseMap
  entry for every type that was ever deserialized, which was an
  unacceptable cost to support just the name lookup of constructors,
  destructors, and conversion functions. Plus, this mapping could
  never actually work with chained or multiple PCH, based on the first
  bullet.

Once we have eliminated the type from the hash function, these
problems go away, as does my horrible "reverse type remap" hack, which
was doomed from the start (see bullet #1 above) and far too
complicated. 

However, note that removing the type from the hash function means that
all constructors, destructors, and conversion functions have the same
hash key, so I've updated the caller to double-check that the
declarations found have the appropriate name.

llvm-svn: 136708
2011-08-02 18:32:54 +00:00
Owen Anderson 713406f88d Fix the broken encodings for the VFP vmov.f32 and vmov.f64 instructions, as well as the comments that explain them incorrectly.
llvm-svn: 136707
2011-08-02 18:30:00 +00:00
Ted Kremenek 9a2001a817 [analyzer] Drastically simplify ExprEngine::VisitInitListExpr() by assuming all initializer expressions have already been evaluated.
llvm-svn: 136706
2011-08-02 18:27:05 +00:00
Jim Grosbach c8c63914c5 Tidy up. 80 columns.
llvm-svn: 136705
2011-08-02 18:16:36 +00:00
Jim Grosbach 9ec152b6bf ARM: rename addrmode7 to addr_offset_none.
Use a more descriptive name so the code is more self-documenting.

llvm-svn: 136704
2011-08-02 18:07:32 +00:00
Eli Friedman b23533db13 PR10566: Make sure codegen for deleting an pointer to an incomplete type actually works.
llvm-svn: 136703
2011-08-02 18:05:30 +00:00
Chad Rosier be10f9853c When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623

llvm-svn: 136702
2011-08-02 17:58:04 +00:00
Jonathan D. Turner db1c9e3226 Following up the earlier refactoring/cleanup work by fixing up how we manage the virtual files the ASTReader has to handle. Specifically, this occurs when the reader is reading AST files that were created in memory and not written to disk. For example, when a user creates a chained PCH using command line flags. These virtual files are stored in MemoryBuffers in ChainIncludeSource.cpp, and then read back in by the ASTReader. This patch moves the management of these buffers into the ModuleManager, so that it becomes the authority on where these buffers are located.
llvm-svn: 136697
2011-08-02 17:40:32 +00:00
Enrico Granata c3e320a7a0 Fixed a bug where a variable could not be formatted in a summary if its datatype already had a custom format
Fixed a bug where Objective-C variables coming out of the expression parser could crash the Python synthetic providers:
 - expression parser output has a "frozen data" component, which is a byte-exact copy of the value (in host memory),
   if trying to read into memory based on the host address, LLDB would crash. we are now passing the correct (target)
   pointer to the Python code
Objective-C "id" variables are now formatted according to their dynamic type, if the -d option to frame variable is used:
 - Code based on the Objective-C 2.0 runtime is used to obtain this information without running code on the target

llvm-svn: 136695
2011-08-02 17:27:39 +00:00
Anna Zaks 9ab728bb05 KeychainAPI checker: only check the paths on which the allocator function returned noErr. (+ minor cleanup)
llvm-svn: 136694
2011-08-02 17:11:03 +00:00
Douglas Gregor 5204bded1d Implement a proper local -> global type ID remapping scheme in the AST
reader. This scheme permits an AST file to be loaded with its type IDs
shifted anywhere in the type ID space. 

At present, the type indices are still allocated in the same boring
way they always have been, just by adding up the number of types in
each PCH file within the chain. However, I've done testing with this
patch by randomly sliding the base indices at load time, to ensure
that remapping is occurring as expected. I may eventually formalize
this in some testing flag, but loading multiple (non-chained) AST
files at once will eventually exercise the same code.

There is one known problem with this patch, which involves name lookup
of operator names (e.g., "x.operator int*()") in cases where multiple
PCH files in the chain. The hash function itself depends on having a
stable type ID, which doesn't happen with chained PCH and *certainly*
doesn't happen when sliding type IDs around. We'll need another
approach. I'll tackle that next.

llvm-svn: 136693
2011-08-02 16:26:37 +00:00
Roman Divacky 11a044634a Comment out the PPC relocation offset adjustment. It must be done differently.
This unbreaks some tests.

llvm-svn: 136692
2011-08-02 16:15:32 +00:00
Bruno Cardoso Lopes 5ada908140 Make this kind of lowering to be supported by 256-bit instructions:
shuffle (scalar_to_vector (load (ptr + 4))), undef, <0, 0, 0, 0>
To:
  shuffle (vload ptr)), undef, <1, 1, 1, 1>
Fix PR10494

llvm-svn: 136691
2011-08-02 16:06:18 +00:00
Roman Divacky e6a11dcc72 Remove trailing semicolon.
llvm-svn: 136690
2011-08-02 15:54:03 +00:00
Roman Divacky 038c1a1a73 Sketch out PowerPC ELF writer. This is enough to get clang -integrated-as
to compile a working hello world on FreeBSD/PPC32.

llvm-svn: 136689
2011-08-02 15:51:38 +00:00
Douglas Gregor 1cc9c0675c Add a debugging dump for Module (also emitted as part of the AST
reader statistics), to show the local-to-global mappings. The only
such mapping we have (at least, for now) is for source location
offsets.

llvm-svn: 136687
2011-08-02 11:12:41 +00:00
Douglas Gregor 006599011d Generalize the module offset map to include mapping information for
all of the kinds of IDs that can be offset. No effectively
functionality change; this is preparation for adding remapping for
IDs.

llvm-svn: 136686
2011-08-02 10:56:51 +00:00
Tobias Grosser bd2b2c7117 Add a vect target to the polly testsuite
Contributed by: Sebastian Pop <sebpop@gmail.com>

llvm-svn: 136685
2011-08-02 07:22:05 +00:00
Bill Wendling 6bc7caa334 Duncan's english is better than mine. :-)
llvm-svn: 136684
2011-08-02 06:39:13 +00:00
Bill Wendling 46ffaa95bd Remove the LLVMBuildUnwind C API function.
The 'unwind' function is going away with the new EH rewrite. This is step 0 in
keeping front-ends from using it.

llvm-svn: 136683
2011-08-02 06:20:17 +00:00
Nick Kledzik 2dfc79b19e make cxxabi.h safe for C code to include
llvm-svn: 136682
2011-08-02 05:15:26 +00:00
Nick Kledzik 1c839a945b use LIBCXXABI_NORETURN
llvm-svn: 136681
2011-08-02 05:01:31 +00:00
Nick Kledzik 12a10bc046 make LIBCXXABI_NORETURN be the right attribute
llvm-svn: 136680
2011-08-02 05:01:17 +00:00
Benjamin Kramer 3c05b7c161 Make helper functions static.
llvm-svn: 136679
2011-08-02 04:50:49 +00:00
Richard Trieu cfc491d308 Fix formatting of SemaExpr.cpp, mainly fixing lines greater than 80 characters.
No functional change.

llvm-svn: 136678
2011-08-02 04:35:43 +00:00
Andrew Trick 77c55428fa Use consistent terminology for loop exit/exiting blocks. Name change only.
llvm-svn: 136677
2011-08-02 04:23:35 +00:00
Benjamin Kramer c4189ff0fc Remove empty test.
llvm-svn: 136675
2011-08-02 02:47:45 +00:00
Owen Anderson bddf40e082 Revert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildbots on i386. Devang is looking into the root cause.
llvm-svn: 136674
2011-08-02 02:23:42 +00:00
John McCall c26ea5a51a I am the code owner for Clang's IR generation; this has been true
for awhile, but it's good to make this official.  

Just to be clear, Doug and Ted "elected" me to this position.

Might as well add myself to the credits list while I'm at it.

llvm-svn: 136673
2011-08-02 01:38:19 +00:00
Nick Kledzik 7cb4926da1 use abort_message() for pthread errors in __cxa_get_globals
llvm-svn: 136672
2011-08-02 01:34:26 +00:00
Nick Kledzik 18ab5f4164 use abort_message()
llvm-svn: 136671
2011-08-02 01:19:07 +00:00