Commit Graph

96025 Commits

Author SHA1 Message Date
Rafael Espindola b58867ccba Change some methods in MCDwarf.cpp to be able to handle an arbitrary
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.

This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.

llvm-svn: 119777
2010-11-19 02:26:16 +00:00
Howard Hinnant 348bb56a82 type_traits intrinsics design
llvm-svn: 119776
2010-11-19 01:48:13 +00:00
Howard Hinnant 4b88967b70 type_traits intrinsics design
llvm-svn: 119775
2010-11-19 01:38:58 +00:00
Bill Wendling 945b776b6e Add MC encodings for some Thumb instructions. Test for a few of them. The "bx
lr" instruction cannot be tested just yet. It requires matching a "condition
code", but adding one of those makes things go south quickly...

llvm-svn: 119774
2010-11-19 01:33:10 +00:00
Jakob Stoklund Olesen 09770251f6 Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.

llvm-svn: 119773
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen 6d89171dcc Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119772
2010-11-19 01:14:40 +00:00
Greg Clayton 1b95a6ff95 Added some logging back and cleaned up the code to match LLDB's coding
conventions.

llvm-svn: 119771
2010-11-19 01:05:25 +00:00
Dale Johannesen 461e704a2c Aligned and unaligned copies of the same string
were not hashing to the same value.  Analysis
and patch by Frits van Bommel!

llvm-svn: 119770
2010-11-19 00:48:58 +00:00
Bill Wendling 20b5ea9858 Use array_pod_sort because the list is contiguous.
llvm-svn: 119769
2010-11-19 00:38:19 +00:00
Owen Anderson f53e4d9fd1 Provide Thumb2 encodings for strex and ldrex.
llvm-svn: 119768
2010-11-19 00:28:38 +00:00
Jim Grosbach 2aeb8b9361 Minor cleanups to a few llvm_unreachable() calls.
llvm-svn: 119767
2010-11-19 00:27:09 +00:00
Argyrios Kyrtzidis 0f530099cb Remove Diagnostic's get/setNumErrors() and getNumErrorsSuppressed().
Anyone wanting to use it should probably use DiagnosticClient's getNumErrors() instead.

llvm-svn: 119766
2010-11-19 00:19:20 +00:00
Argyrios Kyrtzidis 5c26cda273 getNumErrors() -> hasErrorOccurred()
llvm-svn: 119765
2010-11-19 00:19:18 +00:00
Argyrios Kyrtzidis f51ec1d12b Refactoring. Get FunctionScopeInfo to use DiagnosticErrorTrap.
llvm-svn: 119764
2010-11-19 00:19:15 +00:00
Argyrios Kyrtzidis 1865342442 Refactoring.
Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope.

llvm-svn: 119763
2010-11-19 00:19:12 +00:00
Bill Wendling 2ecfcbd2aa An 'unreachable' shouldn't have a '0 &&' prefix.
llvm-svn: 119762
2010-11-19 00:05:15 +00:00
Bill Wendling 2063b84297 Add support for parsing the writeback ("!") token.
llvm-svn: 119761
2010-11-18 23:43:05 +00:00
Jason W Kim 5a97bd873e Fix .o emission of ARM movt/movw. MCSymbolRefExpr::VK_ARM_(HI||LO)16 for the .o path now works for ARM.
Note: lo16AllZero remains in ARMInstrInfo.td - It can be factored out when Thumb movt is repaired.
Existing tests cover this update.

llvm-svn: 119760
2010-11-18 23:37:15 +00:00
Bill Wendling 4a08e563d7 Give the exclamation point a name instead of a number.
llvm-svn: 119759
2010-11-18 23:36:54 +00:00
Johnny Chen 835a88cb15 Add Python API tests for file and class static variables, too.
llvm-svn: 119758
2010-11-18 23:33:43 +00:00
Greg Clayton 99d0faf27e Cleaned up code that wasn't using the Initialize and Terminate paradigm by
changing it to use it. There was an extra parameter added to the static
accessor global user settings controllers that wasn't needed. A bool was being
used as a parameter to the accessor just so it could be used to clean up 
the global user settings controller which is now fixed by splitting up the
initialization into the "static void Class::Initialize()", access into the
"static UserSettingsControllerSP & Class::GetSettingsController()", and
cleanup into "static void Class::Terminate()".

Also added initialize and terminate calls to the logging code to avoid issues
when LLDB is shutting down. There were cases after the logging was switched
over to use shared pointers where we could crash if the global destructor
chain was being run and it causes the log to be destroyed and any any logging
occurred.

llvm-svn: 119757
2010-11-18 23:32:35 +00:00
Owen Anderson 690fa953e1 More tests.
llvm-svn: 119756
2010-11-18 23:30:10 +00:00
Owen Anderson 3517585249 Fix encodings for pkhbt, and fix some tests where I accidentally tested ARM mode instead of Thumb2.
llvm-svn: 119755
2010-11-18 23:29:56 +00:00
Anton Korobeynikov 14ee344944 Move getInitialFrameState() to TargetFrameInfo
llvm-svn: 119754
2010-11-18 23:25:52 +00:00
Jim Grosbach a391c97bd0 ARM Encoding information for UXTAH and friends.
llvm-svn: 119753
2010-11-18 23:24:22 +00:00
Fariborz Jahanian 148d113e55 Fix a bug where write-barriers for assignment through reference
types was not being generated for objc pointers.
// rdar://8681766.

llvm-svn: 119751
2010-11-18 22:39:16 +00:00
Sean Callanan 7a55a32108 Fixed the logic in IRForTarget that recognizes
externally-defined variables to match up with
the code in ClangASTSource that produces them.

llvm-svn: 119750
2010-11-18 22:21:58 +00:00
Tanya Lattner cd68095650 Fix bug in DAGCombiner for ARM that was trying to do a ShiftCombine on illegal types (vector should be split first).
Added test case.

llvm-svn: 119749
2010-11-18 22:06:46 +00:00
Bob Wilson 2acd1621f4 Use a signed vector type for the shift amount operand of unsigned shifts.
Neon shifts allow a mix of positive and negative shift amounts to shift
left or right, respectively, so the shift amount vector should always be
signed.  PR8482 (Radar 8603521).

llvm-svn: 119748
2010-11-18 21:51:10 +00:00
Bill Wendling 0ab0f67925 Don't allocate the SmallVector of Registers. It gets messy figuring out who
should delete what when the object gets copied around. It's also making valgrind
upset.

llvm-svn: 119747
2010-11-18 21:50:54 +00:00
Argyrios Kyrtzidis 31448a415e Use hasErrorOccurred() instead of getNumErrors() where it makes sense.
llvm-svn: 119746
2010-11-18 21:47:07 +00:00
Argyrios Kyrtzidis 8d5038c1b3 Get the number of errors reported from the diagnostic client, in clang_parseTranslationUnit_Impl.
llvm-svn: 119745
2010-11-18 21:47:04 +00:00
Owen Anderson 10839cb62c Provide Thumb2 encodings for mov's that come from MOVCC SDNodes.
llvm-svn: 119744
2010-11-18 21:46:31 +00:00
Jim Grosbach 1b91ae18ed Add ARM encoding information for LDRH post-increment.
llvm-svn: 119743
2010-11-18 21:43:37 +00:00
Bob Wilson 4e22a38759 Change the 'x' type modifier for Neon intrinsics to force a signed integer.
This makes it symmetric with the 'u' modifier that forces an unsigned type.
This is needed for unsigned vector shifts, where the shift amount still needs
to be signed.  PR8482 (Radar 8603521).

llvm-svn: 119742
2010-11-18 21:43:22 +00:00
Benjamin Kramer fc305988b8 Update CMake build.
llvm-svn: 119741
2010-11-18 21:19:52 +00:00
Anton Korobeynikov 0eecf5d201 Move hasFP() and few related hooks to TargetFrameInfo.
llvm-svn: 119740
2010-11-18 21:19:35 +00:00
Duncan Sands c92331b984 Fix thinko: we must turn select(anyext, sext) into sext(select)
not anyext(select).  Spotted by Frits van Bommel.

llvm-svn: 119739
2010-11-18 21:16:28 +00:00
Bob Wilson 7d47133ff7 Split up ARM LowerShift function.
This function was being called from two different places for completely
unrelated reasons.  During type legalization, it was called to expand 64-bit
shift operations.  During operation legalization, it was called to handle
Neon vector shifts.  The vector shift code was not written to check for
illegal types, since it was assumed to be only called after type legalization.
Fixed this by splitting off the 64-bit shift expansion into a separate
function.  I don't have a particular testcase for this; I just noticed it
by inspection.

llvm-svn: 119738
2010-11-18 21:16:28 +00:00
Owen Anderson 3fec5ff14b More Thumb2 encodings.
llvm-svn: 119737
2010-11-18 21:15:19 +00:00
Argyrios Kyrtzidis bc4679335c Remove the hack where, to get the return status, we had special case for VerifyDiagnosticsClient
and just check the number of errors from the DiagnosticClient.

llvm-svn: 119736
2010-11-18 21:13:57 +00:00
Argyrios Kyrtzidis 6d35b5a210 Keep track of errors/warnings in FixItRewriter.
llvm-svn: 119735
2010-11-18 21:13:54 +00:00
Johnny Chen 3df7f94fd0 Add a test for displaying file and class static variables.
llvm-svn: 119734
2010-11-18 20:35:54 +00:00
Owen Anderson 3625098459 Fill out the set of Thumb2 multiplication operator encodings.
llvm-svn: 119733
2010-11-18 20:32:18 +00:00
Johnny Chen b4d59f477b Remove whitespace chars.
llvm-svn: 119732
2010-11-18 20:20:18 +00:00
Argyrios Kyrtzidis c79346a57c Since multiple diagnostics can share one diagnostic client, have the client keeping track
of the total number of warnings/errors reported.

llvm-svn: 119731
2010-11-18 20:06:46 +00:00
Argyrios Kyrtzidis d004064864 Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Argyrios Kyrtzidis 4fadc5b20a Copy the LangOptions in PrintingPolicy to avoid pointing to a LangOptions that is long gone.
llvm-svn: 119729
2010-11-18 20:06:30 +00:00
Duncan Sands 12f3b3b44f The DAGCombiner was threading select over pairs of extending loads even
if the extension types were not the same.  The result was that if you
fed a select with sext and zext loads, as in the testcase, then it
would get turned into a zext (or sext) of the select, which is wrong
in the cases when it should have been an sext (resp. zext).  Reported
and diagnosed by Sebastien Deldon.

llvm-svn: 119728
2010-11-18 20:05:18 +00:00
Duncan Sands aef146b890 Factor code for testing whether replacing one value with another
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class.  Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form.  Fixes PR8622.

llvm-svn: 119727
2010-11-18 19:59:41 +00:00