Commit Graph

136130 Commits

Author SHA1 Message Date
Eric Christopher c33f622c6f Grammar.
llvm-svn: 166485
2012-10-23 17:19:15 +00:00
Lang Hames dd8574e8fb Use ilist rather than std::list for Node and Edge lists in the PBQP graph. This
should fix an issue (described at http://stackoverflow.com/questions/10065384/instantiation-of-a-list-with-an-incomplete-type-in-a-typedef)
that was preventing LLVMCodeGen from building with libc++ in C++11 mode.

llvm-svn: 166484
2012-10-23 17:10:51 +00:00
Rafael Espindola 1ad26f0423 Handle -pthread, -pg and -shared correctly on bitrig.
Patch by David Hill.

llvm-svn: 166483
2012-10-23 17:07:31 +00:00
Sean Silva d901e82ec4 Fix some mdoc nits
Patch by Eitan Adler!

llvm-svn: 166482
2012-10-23 16:35:44 +00:00
Quentin Colombet 301d05a55c Test commit access
llvm-svn: 166481
2012-10-23 16:03:18 +00:00
Bill Schmidt 57d6de5fd9 This is another TLC patch for separating code for the Darwin and ELF ABIs
for the PowerPC target, and factoring the results.  This will ease future
maintenance of both subtargets.

PPCTargetLowering::LowerCall_Darwin_Or_64SVR4() has grown a lot of special-case
code for the different ABIs, making maintenance difficult.  This is getting
worse as we repair errors in the 64-bit ELF ABI implementation, while avoiding
changes to the Darwin ABI logic.  This patch splits the routine into
LowerCall_Darwin() and LowerCall_64SVR4(), allowing both versions to be
significantly simplified.  I've factored out chunks of similar code where it
made sense to do so.  I also performed similar factoring on
LowerFormalArguments_Darwin() and LowerFormalArguments_64SVR4().

There are no functional changes in this patch, and therefore no new test
cases have been developed.

Built and tested on powerpc64-unknown-linux-gnu with no new regressions.

llvm-svn: 166480
2012-10-23 15:51:16 +00:00
Daniel Jasper b0c7b61730 Make hasDeclaration() matcher work inside the memberExpr() matcher.
llvm-svn: 166479
2012-10-23 15:46:39 +00:00
NAKAMURA Takumi 660489c49f clang/test/PCH/pch-dir.c: Update a comment for msvc. msvc(*-win32) implies -std=c++11.
llvm-svn: 166478
2012-10-23 10:43:00 +00:00
Manuel Klimek 7fca93b428 Implements the thisExpr matcher.
Patch by Gabor Horvath.

llvm-svn: 166477
2012-10-23 10:40:50 +00:00
Duncan Sands 5ed3900d77 Fix typo that somehow escaped both testing and code inspection.
llvm-svn: 166475
2012-10-23 09:07:02 +00:00
Duncan Sands 533c8ae79f Transform code like this
%V = mul i64 %N, 4
 %t = getelementptr i8* bitcast (i32* %arr to i8*), i32 %V
into
 %t1 = getelementptr i32* %arr, i32 %N
 %t = bitcast i32* %t1 to i8*
incorporating the multiplication into the getelementptr.
This happens all the time in dragonegg, for example for
  int foo(int *A, int N) {
    return A[N];
  }
because gcc turns this into byte pointer arithmetic before it hits the plugin:
  D.1590_2 = (long unsigned int) N_1(D);
  D.1591_3 = D.1590_2 * 4;
  D.1592_5 = A_4(D) + D.1591_3;
  D.1589_6 = *D.1592_5;
  return D.1589_6;
The D.1592_5 line is a POINTER_PLUS_EXPR, which is turned into a getelementptr
on a bitcast of A_4 to i8*, so this becomes exactly the kind of IR that the
transform fires on.

An analogous transform (with no testcases!) already existed for bitcasts of
arrays, so I rewrote it to share code with this one.

llvm-svn: 166474
2012-10-23 08:28:26 +00:00
NAKAMURA Takumi 500d87159b clang/test/PCH/pch-dir.c: Mark it as XFAIL:msvc. It doesn't fail (virtually xpass) on msvc.
llvm-svn: 166473
2012-10-23 07:47:51 +00:00
Jim Ingham a7dfb665e3 Watchpoints remember the type of the expression or variable they were set with, and use
it to print the old and new values.
Temporarily disable the "out of scope" checking since it didn't work correctly, and was
not what people generally expected watchpoints to be doing.  

llvm-svn: 166472
2012-10-23 07:20:06 +00:00
NAKAMURA Takumi 0a08aa91d5 clang/test/PCH/pch-dir.c: Relax expressions of path separators for Win32.
llvm-svn: 166471
2012-10-23 07:01:50 +00:00
Richard Smith 6289a4e85e Per the C++ standard, we need to include the definition of llvm::Calculate in
every TU where it's implicitly instantiated, even if there's an implicit
instantiation for the same types available in another TU.

llvm-svn: 166470
2012-10-23 06:19:46 +00:00
Douglas Gregor fc9e7a2969 If the precompiled header named by "-include" is actually a directory,
check each of the files within that directory to determine if any of
them is an AST file that matches the language and target options. If
so, the first matching AST file is loaded. This fixes a longstanding
discrepency with GCC's precompiled header implementation.

llvm-svn: 166469
2012-10-23 06:18:24 +00:00
Matt Beaumont-Gay abf836cffa Fix -Wunused-value to not warn on expressions that have unresolved lookups due
to dependent arguments.

llvm-svn: 166468
2012-10-23 06:15:26 +00:00
Nadav Rotem 58df27cb2e Add a comment which explains why the assert fired and how to fix it.
llvm-svn: 166467
2012-10-23 04:35:40 +00:00
Argyrios Kyrtzidis 118fafa301 [libclang] Add an environment variable to disable thread background priotity, for testing
llvm-svn: 166466
2012-10-23 04:09:38 +00:00
Jason Molenda 7cd5e831e5 Change how the UnwindAssemblyInstEmulation class tracks the setup of
the function's prologue instructions so we can re-instate that prologue
if we hit an early return mid-function.  Add some additional heuristics
to differentiate between prologue and epilogue instruction sequences.

This fixes the specific problem of correctly unwinding through a function
which has an epilogue one instruction after the last prologue setup
instruction has completed.
<rdar://problem/12091139> 

llvm-svn: 166465
2012-10-23 03:08:31 +00:00
Jason Molenda a7dcb33716 Clean up help/usage messages for kdp-remote / gdb-remote a little bit.
llvm-svn: 166464
2012-10-23 03:05:16 +00:00
Eli Friedman d5d136be5b [ms-inline-asm] Add handling for errors coming out of the backend.
llvm-svn: 166463
2012-10-23 02:43:30 +00:00
Enrico Granata db8142b8e8 Fixing a compiler warning about has_children being used before being initialized
llvm-svn: 166462
2012-10-23 02:07:54 +00:00
Rafael Espindola e2a9e90c88 Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting the
regression.

llvm-svn: 166461
2012-10-23 02:04:01 +00:00
Greg Clayton 4a792072ce <rdar://problem/12493007>
Added a new API call to help efficiently determine if a SBValue could have children:

     bool
     SBValue::MightHaveChildren ();
     
This is inteneded to be used bui GUI programs that need to show if a SBValue needs a disclosure triangle when displaying a hierarchical type in a tree view without having to complete the type (by calling SBValue::GetNumChildren()) as completing the type is expensive.

llvm-svn: 166460
2012-10-23 01:50:10 +00:00
Reed Kotler 164bb37c7b implement setXX patterns
llvm-svn: 166459
2012-10-23 01:35:48 +00:00
Michael J. Spencer 7ccb6d9f8a [Options] Fix two options I mistransformed.
llvm-svn: 166458
2012-10-23 01:25:21 +00:00
Sean Callanan d94773972c Improved support for language types as command
options:

- added help ("help language") listing the
  possible options;

- added the possibility of synonyms for language
  names, in this case "ObjC" for "Objective-C";
  and

- made matching against language names case
  insensitive.

This should improve discoverability.

<rdar://problem/12552359>

llvm-svn: 166457
2012-10-23 00:50:09 +00:00
Julien Lerouge a302b6d95e Fix typo.
llvm-svn: 166456
2012-10-23 00:38:15 +00:00
Richard Smith 2ddcbab8ff Ugly ugly hack for libstdc++-4.6 and libstdc++-4.7 compatibility. These
libraries have an incorrect definition of std::common_type (inherited from a
bug in the standard -- see LWG issue 2141), whereby they produce reference
types when they should not.

If we instantiate a typedef named std::common_type<...>::type, which is defined
in a system header as decltype(... ? ... : ...), and the decltype produces a
reference type, convert it to the non-reference type. (This doesn't affect any
LWG2141-conforming implementation of common_type, such as libc++'s, because the
default implementation of common_type<...>::type isn't supposed to produce a
reference type.)

This is horrible. I'm really sorry. :( Better ideas appreciated!

llvm-svn: 166455
2012-10-23 00:32:41 +00:00
Julien Lerouge d7fa5e420d Explain why DenseMap is still used here instead of MapVector.
llvm-svn: 166454
2012-10-23 00:23:46 +00:00
Enrico Granata bc08ab450a <rdar://problem/12500212> Test case for the new plugin feature
llvm-svn: 166453
2012-10-23 00:09:02 +00:00
Douglas Gregor c2d984c823 Handle implicitly-included PCH files the same way as
implicitly-included PTH files during initialization, delaying the
mapping down to the "original source file" until after later in the
initialization process.

llvm-svn: 166452
2012-10-22 23:59:45 +00:00
Eli Friedman 0f4871d487 [ms-inline-asm] Implement _emit directive (which is roughly equivalent to .byte).
<rdar://problem/12470345>.

llvm-svn: 166451
2012-10-22 23:58:19 +00:00
Sean Callanan ec979baef7 Added support for zero-length arrays at the end
of structures, and added a testcase.

<rdar://problem/12551591>

llvm-svn: 166450
2012-10-22 23:56:48 +00:00
Douglas Gregor 4b29c16eec Allow clients of the AST reader to specify what kinds of AST load
failures they know how to tolerate, e.g., out-of-date input files or
configuration/version mismatches. Suppress the corresponding
diagnostics if the client can handle it.

No clients actually use this functionality, yet.

llvm-svn: 166449
2012-10-22 23:51:00 +00:00
Bill Wendling 12cda50f1f When a block ends in an indirect branch, add its successors to the machine basic block.
The CFG of the machine function needs to know that the targets of the indirect
branch are successors to the indirect branch.
<rdar://problem/12529625>

llvm-svn: 166448
2012-10-22 23:30:04 +00:00
Douglas Gregor 4750b77ea1 Collapse ASTReader::ReadSLocEntryRecord() into its only caller,
ReadSLocEntry(). No functionality change.

llvm-svn: 166447
2012-10-22 22:53:10 +00:00
Douglas Gregor c9ad5fb604 Distinguish the various kinds of AST file loading failures:
file corruption, compiler version mismatch, target/language
configuration mismatch, out-of-date AST file. No functionality change
yet.

llvm-svn: 166446
2012-10-22 22:50:17 +00:00
Kevin Enderby 62183c4e18 Add support for annotated disassembly output for X86 and arm.
Per the October 12, 2012 Proposal for annotated disassembly output sent out by
Jim Grosbach this set of changes implements this for X86 and arm.  The llvm-mc
tool now has a -mdis option to produced the marked up disassembly and a couple
of small example test cases have been added.

rdar://11764962

llvm-svn: 166445
2012-10-22 22:31:46 +00:00
Michael J. Spencer 929fccd476 [Options] Add prefixes to options.
Each option has a set of prefixes. When matching an argument such as
-funroll-loops. First the leading - is removed as it is a prefix. Then
a lower_bound search for "funroll-loops" is done against the option table by
option name. From there each option prefix + option name combination is tested
against the argument.

This allows us to support Microsoft style options where both / and - are valid
prefixes. It also simplifies the cases we already have where options come in
both - and -- forms. Almost every option for gnu-ld happens to have this form.

llvm-svn: 166444
2012-10-22 22:13:48 +00:00
Enrico Granata dbeb0f0e0c Proper copyright notice
llvm-svn: 166443
2012-10-22 22:03:16 +00:00
NAKAMURA Takumi 395a574ea2 ASTReader.cpp: Fix a warning. [-Wunused-variable]
llvm-svn: 166442
2012-10-22 21:50:39 +00:00
Eli Friedman 01e4d5937a Testcase change for r166440.
llvm-svn: 166441
2012-10-22 20:50:45 +00:00
Eli Friedman 15e9b33678 [ms-inline asm] Don't rewrite out parts of an inline-asm skipped by .if 0 and friends.
It's unnecessary and makes the generated assembly less faithful to the original source.

llvm-svn: 166440
2012-10-22 20:50:25 +00:00
Greg Clayton e4c1ef55ce <rdar://problem/12524810>
Fixed a crasher where if an invalid SBTarget was passed to:

lldb::addr_t
SBAddress::GetLoadAddress (const SBTarget &target) const;

We would crash.

llvm-svn: 166439
2012-10-22 20:49:35 +00:00
Richard Trieu da031982b8 Fix for PR13334. This prevents crashes that result from badly formed
expressions involving __has_include

llvm-svn: 166438
2012-10-22 20:28:48 +00:00
Chad Rosier 5bca3f9b8e [ms-inline asm] Add the isOffsetOf() function.
Part of rdar://12470317

llvm-svn: 166436
2012-10-22 19:50:35 +00:00
Julien Lerouge 8cf84fa4e2 Iterating over a DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*> is not
deterministic, replace it with a DenseMap<std::pair<unsigned, unsigned>,
PHINode*> (we already have a map from BasicBlock to unsigned).

<rdar://problem/12541389>

llvm-svn: 166435
2012-10-22 19:43:56 +00:00
Chad Rosier f7000f8c5b [ms-inline asm] Test case for r166433.
llvm-svn: 166434
2012-10-22 19:43:17 +00:00