Commit Graph

102975 Commits

Author SHA1 Message Date
Ted Kremenek 49c79790de Rework checker "packages" and groups to be more hierarchical.
llvm-svn: 128187
2011-03-24 00:28:47 +00:00
Johnny Chen f949d8e13d The r128103 fix to cope with the removal of addressing modes from the MC instructions
were incomplete.  The assert stmt needs to be updated and the operand index incrment is wrong.
Fix the bad logic and add some sanity checking to detect bad instruction encoding;
and add a test case.

llvm-svn: 128186
2011-03-24 00:28:38 +00:00
John McCall c23308ceea Call out ObjC parameter types as a different kind of declarator context
from a normal type-spec, just for completeness.

llvm-svn: 128185
2011-03-23 23:43:04 +00:00
Jim Grosbach 67d3d915cc Runtime dylib simple ARM 24-bit branch relocation support.
llvm-svn: 128184
2011-03-23 23:35:17 +00:00
Devang Patel abc77347a7 Enable GlobalMerge on darwin.
llvm-svn: 128183
2011-03-23 23:34:19 +00:00
Jim Grosbach c7ca640529 Fix comments.
llvm-svn: 128182
2011-03-23 23:32:48 +00:00
Andrew Trick 4ab9a16569 Revert r128175.
I'm backing this out for the second time. It was supposed to be fixed by r128164, but the mingw self-host must be defeating the fix.

llvm-svn: 128181
2011-03-23 23:11:02 +00:00
David Chisnall 76803410c2 Fixed type error in last commit (forgot that now that selectors are not
accessed via the indirect pointer, they don't need to be pointers to pointers).

Finished moving the message lookup code into separate subclasses for each
runtime.  Also performed a few smallish related tidies.

We're now bitcasting the result of the message lookup functions, rather than
casting the lookup functions themselves, so the messages.m test needed updating
to reflect this.

llvm-svn: 128180
2011-03-23 22:52:06 +00:00
Evan Cheng 425489d397 Cmp peephole optimization isn't always safe for signed arithmetics.
int tries = INT_MAX;    
while (tries > 0) {
      tries--;
}

The check should be:
        subs    r4, #1
        cmp     r4, #0
        bgt     LBB0_1

The subs can set the overflow V bit when r4 is INT_MAX+1 (which loop
canonicalization apparently does in this case). cmp #0 would have cleared
it while not changing the N and Z bits. Since BGT is dependent on the V
bit, i.e. (N == V) && !Z, it is not safe to eliminate the cmp #0.

rdar://9172742

llvm-svn: 128179
2011-03-23 22:52:04 +00:00
Caroline Tice ca1176aaee Add missing cases to switch statements & remove 'default'.
llvm-svn: 128177
2011-03-23 22:31:13 +00:00
Eli Friedman 4c192305bf PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND.
Also cleaning up some duplicated code while I'm here.

llvm-svn: 128176
2011-03-23 22:18:48 +00:00
Andrew Trick 4046a0de91 Reapply Eli's r127852 now that the pre-RA scheduler can spill EFLAGS.
(target-specific branchless method for double-width relational comparisons on x86)

llvm-svn: 128175
2011-03-23 22:16:02 +00:00
Jim Grosbach c80099aa04 Split out relocation resolution into target-specific bits.
llvm-svn: 128173
2011-03-23 22:06:06 +00:00
Owen Anderson 8543d4f8a1 The high bit of a Thumb2 ADR's offset is stored in bit 26, not bit 25.
This fixes 464.h264ref with the integrated assembler.

llvm-svn: 128172
2011-03-23 22:03:44 +00:00
Jim Grosbach 98775c4358 Fix double-free of Module.
The ExecutionEngine constructor already added the module, so there's no
need to call addModule() directly. Doing so causes a double-free of the
Module at program termination.

llvm-svn: 128171
2011-03-23 21:35:02 +00:00
Ted Kremenek dcc4c38970 Fix CFG-construction bug when run from AnalysisBasedWarnings::IssueWarnings() where block-level expressions that need
to be recorded in the Stmt*->CFGBlock* map were not always done so.  Fixes <rdar://problem/9171946>.

llvm-svn: 128170
2011-03-23 21:33:21 +00:00
Owen Anderson ab234158b8 Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like BLX, rather than a 2-byte instruction like B.
llvm-svn: 128169
2011-03-23 21:19:56 +00:00
Douglas Gregor 336a15e041 Unbreak test
llvm-svn: 128168
2011-03-23 21:19:43 +00:00
Johnny Chen 74af4bc134 Silence clang warnings.
llvm-svn: 128167
2011-03-23 21:03:44 +00:00
Andrew Trick 13acae040c Ensure that def-side physreg copies are scheduled above any other uses
so the scheduler can't create new interferences on the copies
themselves. Prior to this fix the scheduler could get stuck in a loop
creating copies.
Fixes PR9509.

llvm-svn: 128164
2011-03-23 20:42:39 +00:00
Andrew Trick a8846e0540 whitespace
llvm-svn: 128163
2011-03-23 20:40:18 +00:00
Johnny Chen ac77f3b2ac Turns out that the test failure wrt:
rdar://problem/9173060 lldb hangs while running unique-types

disappears if running with clang version >= 3.  Modify the TestUniqueTypes.py
to detect if we are running with clang version < 3 and, if true, skip the test.

Update the lldbtest.system() function to return a tuple of (stdoutdata, stderrdata)
since we need the stderr data from "clang -v" command.  Modify existing clients of
lldbtest.system() to now use, for example:

         # First, capture the golden output emitted by the oracle, i.e., the
         # series of printf statements.
-        go = system("./a.out", sender=self)
+        go = system("./a.out", sender=self)[0]
         # This golden list contains a list of (variable, value) pairs extracted
         # from the golden output.
         gl = []

And add two utility functions to lldbutil.py.

llvm-svn: 128162
2011-03-23 20:28:59 +00:00
Jim Grosbach 6a85a05130 Start of relocation resolution for the runtime dyld library.
llvm-svn: 128161
2011-03-23 19:52:00 +00:00
Jim Grosbach c114d89ea2 Make sure to report any errors from the runtime dyld.
llvm-svn: 128160
2011-03-23 19:51:34 +00:00
Fariborz Jahanian 16f92ce539 Support for Transparent unions used as overloadable
function parameter. // rdar:// 9129552
and PR9406.

llvm-svn: 128159
2011-03-23 19:50:54 +00:00
Marshall Clow e7deac8cdc Add a test for !ptr-to-member (should fail)
llvm-svn: 128158
2011-03-23 19:44:36 +00:00
Andrew Trick 4a3ee93447 Revert r128156 because of CodeGenObjC/messages.m and Coverage/codegen-gnu.m.
llvm-svn: 128157
2011-03-23 19:43:59 +00:00
David Chisnall f1a38cf32d Remove the redundant loads / stores to globals that we were generating for selectors (GNU runtimes).
llvm-svn: 128156
2011-03-23 18:39:12 +00:00
Jakob Stoklund Olesen a87d80cdca Don't coalesce identical DBG_VALUE instructions prematurely.
Each of these instructions may have a RegsClobberInsn entry that can't be
ignored. Consecutive ranges are coalesced later when DwarfDebug::emitDebugLoc
merges entries.

llvm-svn: 128155
2011-03-23 18:37:30 +00:00
Oscar Fuentes 465f93645f Supports building with a list of targets that does not contain
X86. Fixes PR9533.

llvm-svn: 128154
2011-03-23 17:42:13 +00:00
Justin Holewinski 06c8a38223 PTX: Improve support for 64-bit addressing
- Fix bug in ADDRrr/ADDRri/ADDRii selection for 64-bit addresses
- Add comparison selection for i64
- Add zext selection for i32 -> i64
- Add shl/shr/sha support for i64

llvm-svn: 128153
2011-03-23 16:58:51 +00:00
David Chisnall d7972f5bf8 Initial work on refactoring GNU runtime code (long overdue - it's quite obvious
that I hadn't used C++ for several years before writing most of this code).
Still lots more to do.  This set of changes includes:

- Remove the distinction between typed and untyped selectors.  More accurately
  reflect what the runtime does, by using typed selectors everywhere, with an
  empty type field if the types are unknown.  Now we just store a small list of
  types for each selector (in theory, this should always be exactly one, but
  this constraint was not enforced back in 1986 when it should have been).

- Add some consistency to how runtime functions are created.  These are all
  generated via the LazyRuntimeFunction class (which might be useful outside
  CGObjCGNU - feel free to move it into a header if it is).  This function
  stores the types of a function, looks it up the first time it's used, and
  caches the result.  This means that we're now not wasting time constructing
  the llvm::FunctionType every time some of the functions are looked up, but
  also not inserting references to runtime functions into the module if they're
  not actually used.

- Started separating out the fragile and non-fragile ABI behaviours into two
  subclasses of CGObjCGNU: CGObjCGCC for the legacy GCC runtime ABI and
  CGObjCGNUstep for the new GNUstep ABI.  Not all of the differences in
  behaviour are factored out yet, but they will be in future commits.

- Removed all of the CodeGen:: things: we've been using namespace CodeGen in
  this file for ages, so having explicit namespace specifiers is just a bit
  confusing.

- Added a few more comments.

- Used llvm::StringRef instead of std::string in a few places.

- Finally got around to storing the module path in the module structure.  The
  ABI says that the compiler should do this, although it's not used in the
  runtime or exposed outside the runtime, so it's pretty useless.  

Still to do:

- We currently have two code paths for generating try blocks, one for ObjC and
  one for ObjC++.  Not only are these substantially similar, they are also very
  similar to the CGObjCMac version.  These need factoring out into a single
  parameterised implementation, either in CGObjCRuntime or CodeGenFunction.
  The EmitObjCXXTryStmt() function was added so that the changes to fix a bug
  in time for the 2.9 release would be self-contained and reduce the chances of
  breaking anything else, but these should be done properly as soon as
  possible.

- Split up some large functions (e.g. GenerateClass()) into smaller functions
  for generating the various data structures.

- The method lookup code into the two subclasses, removing the conditionals in
  the message send functions.

- Add doxygen comments on the remaining undocumented functions.

- We seem to be generating global pointer variables for selectors, then storing
  a pointer to the selector, then generating a load of this pointer (and then a
  load of the real selector later) every time a static selector is used.  I can
  only assume I was asleep or drunk when I did this - we should just be
  referencing the selectors directly in the selector array.

llvm-svn: 128152
2011-03-23 16:36:54 +00:00
Devang Patel 2b54299705 Test case for r128150.
llvm-svn: 128151
2011-03-23 16:30:03 +00:00
Devang Patel 945b8aed2a Update type cache when a type is completed.
Radar 9168773

llvm-svn: 128150
2011-03-23 16:29:39 +00:00
Anders Carlsson c4f0ab397c Revert r128140 for now.
llvm-svn: 128149
2011-03-23 15:51:12 +00:00
Douglas Gregor 899b68fdf5 Teach DelayedDiagnostic to copy its string, rather than hope that the
string itself lives longer than the DelayedDiagnostic. Fixes a recent
use-after-free regression due to my availability attribute work. 

llvm-svn: 128148
2011-03-23 15:13:44 +00:00
Douglas Gregor d71149a453 Ignore weak_import on Objective-C property and method declarations on
all platforms, not just darwin. Fixes the regression in this test case.

llvm-svn: 128147
2011-03-23 13:27:51 +00:00
Cameron Zwarich 10ebc189ee Fix PR9464 by correcting some math that just happened to be right in most cases
that were hit in practice.

llvm-svn: 128146
2011-03-23 05:25:55 +00:00
Jakob Stoklund Olesen b993f6394f Notify the delegate before removing dead values from a live interval.
The register allocator needs to know when the range shrinks.

llvm-svn: 128145
2011-03-23 04:43:16 +00:00
Jakob Stoklund Olesen f7eb955046 Allow the allocation of empty live ranges that have uses.
Empty ranges may represent undef values.

llvm-svn: 128144
2011-03-23 04:32:51 +00:00
Jakob Stoklund Olesen 710656d7b3 Dump the register map before rewriting.
llvm-svn: 128143
2011-03-23 04:32:49 +00:00
Chris Lattner ce6c42f65f switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
llvm-svn: 128142
2011-03-23 04:04:01 +00:00
Chris Lattner 89d3b337b8 remove a dead variable.
llvm-svn: 128141
2011-03-23 04:03:30 +00:00
Anders Carlsson 9ed8d93f55 A global variable with internal linkage where all uses are in one function and whose address is never taken is a non-escaping local object and can't alias anything else.
llvm-svn: 128140
2011-03-23 02:19:48 +00:00
Ted Kremenek 1ba9bbc149 Fix crash in clang_getInstantiationLoc() when SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid
FileID on invalid code.  Fixes <rdar://problem/9164623>.

llvm-svn: 128139
2011-03-23 02:16:44 +00:00
Ted Kremenek d6f4ad1579 std::vector::data() is not portable to VS. Use a gross hack instead.
llvm-svn: 128138
2011-03-23 02:16:41 +00:00
Stephen Wilson 26977167bc linux: simple support for process input and output
llvm-svn: 128137
2011-03-23 02:14:42 +00:00
Stephen Wilson 0c16aa6d39 Eliminate a pile of "type qualifiers ignored on function return type" warnings.
llvm-svn: 128136
2011-03-23 02:12:10 +00:00
Stephen Wilson e9b1491d49 Update autogen'd LLDB_vers.c.
The makefile build uses scripts/generate-vers.pl to build an appropriate
LLDB_vers.c file.  The declarations for these symbols now carry a liblldb_core
prefix so update the script to generate the correct names.

llvm-svn: 128135
2011-03-23 02:07:56 +00:00
Stephen Wilson ad65c0511f Add a missing include needed on Linux and remove a trailing comma.
llvm-svn: 128134
2011-03-23 02:02:29 +00:00