Commit Graph

173123 Commits

Author SHA1 Message Date
Hao Liu cf37110920 [ARM64]Fix a bug when lowering shuffle vector to an EXT instruction.
E.g. Mask like <-1, -1, 1, ...> will generate incorrect EXT index.

llvm-svn: 207485
2014-04-29 01:50:36 +00:00
Jordan Rose 90d09146e0 scan-build: Don't use realpath when the user provides an explicit path.
PR19583

llvm-svn: 207484
2014-04-29 01:37:19 +00:00
Nico Weber f077c51a70 Revert r207482; I fail at reading IRC.
llvm-svn: 207483
2014-04-29 01:25:49 +00:00
Nico Weber 8af28c1e61 Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.
See the bug and the cfe-commits thread "[patch] Let stddef.h redefine NULL if
__need_NULL is set" for discussion.

Fixes PR12997 and is similar to the __need_wint_t bits already in this file.

llvm-svn: 207482
2014-04-29 01:19:21 +00:00
Nick Kledzik 326254f422 Add unwind test case that checks restoring of float registers (such as on AArch64)
llvm-svn: 207481
2014-04-29 01:08:23 +00:00
Adrian Prantl 2cede0f92c Debug info: Improve line table for functions with cleanups an early exit
and no return expr at the end of the function.
The "function has only simple returns" check in FinishFunction tests
whether the number of simple return exprs equals the number of return
exprs, but so far a fallthrough at the end of a function was not counted
as a return, which would result in cleanup code being associated with the
wrong source line.

rdar://problem/16733984.

llvm-svn: 207480
2014-04-29 01:07:59 +00:00
Ben Langmuir c829f19e24 Add missing triple to make -isysroot work
llvm-svn: 207479
2014-04-29 01:04:34 +00:00
Jordan Rose 1057e09432 [analyzer] Clean up the lists of current and potential checkers.
Patch by Anton Yartsev, modified by me.

llvm-svn: 207478
2014-04-29 00:46:17 +00:00
Ben Langmuir be84adbf1b Check -Werror options during module validation
This patch checks whether the diagnostic options that could lead to
errors (principally -Werror) are consistent between when a module was
built and when it is loaded.  If there are new -Werror flags, then the
module is rebuilt.  In order to canonicalize the options we do this
check at the level of the constructed DiagnosticsEngine, which contains
the final set of diag to diagnostic level mappings.  Currently we only
rebuild with the new diagnostic options, but we intend to refine this in
the future to include the union of the new and old flags, since we know
the old ones did not cause errors.  System modules are only rebuilt when
-Wsystem-headers is enabled.

One oddity is that unlike checking language options, we don’t perform
this diagnostic option checking when loading from a precompiled header.
The reason for this is that the compiler cannot rebuild the PCH, so
anything that requires it to be rebuilt effectively leaks into the build
system.  And in this case, that would mean the build system
understanding the complex relationship between diagnostic options and
the underlying diagnostic mappings, which is unreasonable.  Skipping the
check is safe, because these options do not affect the generated AST.
You simply won’t get new build errors due to changed -Werror options
automatically, which is also true for non-module cases.

llvm-svn: 207477
2014-04-29 00:36:53 +00:00
Rui Ueyama 72d57ab32e [PECOFF] Fix _imp_ implicit symbols.
Implicit symbol for local use implemented in r207141 was not fully
compatible with MSVC link.exe. In r207141, I implemented the feature
in such way that implicit symbols are defined only when they are
exported with /EXPORT option.

After that I found that implicit symbols are defined not only for
dllexported symbols but for all defined symbols. Actually _imp_
implicit symbols have no relationship with the dllexport feature. You
could add _imp_ to any symbol to get a pointer to the symbol, whether
the symbol is dllexported or not.  It looks pretty weird to me but
that's what we want if link.exe behaves that way.

Here is a bit about the implementation: Creating all implicit symbols
beforehand is going to be a huge waste of resource. This feature is
rarely used, and MSVC link.exe even prints out a warning message when
it finds this feature is being used. So we create implicit symbols
on demand. There is an archive file that creates implicit symbols when
they are needed.

llvm-svn: 207476
2014-04-29 00:32:00 +00:00
Eric Christopher 612bb69bf7 None of these targets actually define their own CFI_INSTRUCTION
opcode so there's no reason to use the target namespace for it
rather than TargetOpcode.

llvm-svn: 207475
2014-04-29 00:16:46 +00:00
Eric Christopher 40af450562 80-column fixups.
llvm-svn: 207474
2014-04-29 00:16:42 +00:00
Eric Christopher d17374919b 80-column, tab characters, comment fixups.
llvm-svn: 207473
2014-04-29 00:16:40 +00:00
Eric Christopher 4237bf10f3 Fix 80-columns, tab characters, and comments.
llvm-svn: 207472
2014-04-29 00:16:33 +00:00
Chandler Carruth d24465f443 [ADT] Teach PointerUnion to support assignment directly from nullptr to
clear it out.

llvm-svn: 207471
2014-04-29 00:14:27 +00:00
Reid Kleckner 982a589d3a LLVM supports TLS on Windows and we can use it from Clang
Patch by Martell Malone!

Differential Revision: http://reviews.llvm.org/D3421

llvm-svn: 207470
2014-04-29 00:11:30 +00:00
Nick Kledzik d7339b48f7 Fix cast warning
llvm-svn: 207469
2014-04-28 23:49:49 +00:00
Chandler Carruth a468b8ecaf [cleanup] Add some actual positive tests for equality. This unittest
never actually compared for equality two pointer unions that were equal.
Fortunately, things seem to work. =]

llvm-svn: 207468
2014-04-28 23:44:14 +00:00
Nick Kledzik 0c790015df Use return address register from CIE. Move DwarfInstructions::lastRestoreReg() to Register::lastDwarfRegNum().
llvm-svn: 207467
2014-04-28 23:43:21 +00:00
Chandler Carruth 275c5fc9c2 [cleanup] Make this test use a proper fixture rather than globals.
llvm-svn: 207466
2014-04-28 23:42:22 +00:00
Chandler Carruth 1284df1306 [cleanup] Fix the whitespace in this test. Notably, correct spacing
around pointer types.

llvm-svn: 207465
2014-04-28 23:37:53 +00:00
David Blaikie 6ada8e332b Remove DwarfUnit::LabelRange since it's unused.
Seems at some point the intent was to emit fission ranges_base as unique
per CU but the code today emits ranges_base as the start of the ranges
section for all CUs being compiled and all the ranges_base relative
addresses are relative to that. So removing this dead code and leaving
the status quo until there's a reason to change it (perhaps something's
faster if it has distinct ranges for each CU).

llvm-svn: 207464
2014-04-28 23:36:52 +00:00
Nick Kledzik 4141a3bca8 No need to specialize DwarfInstructions::getCFA(). It is the same for all archs
llvm-svn: 207463
2014-04-28 23:12:37 +00:00
Chandler Carruth c71b2c3c7f Revert r207271 for now. This commit introduced a test case that ran
clang directly from the LLVM test suite! That doesn't work. I've
followed up on the review thread to try and get a viable solution sorted
out, but trying to get the tree clean here.

llvm-svn: 207462
2014-04-28 23:07:49 +00:00
Alexey Samsonov a08b161970 [DWARF parser] DWARFDebugFrame: Make FrameEntry struct smaller.
FrameEntry doesn't need to hold a reference to the section it is
located in. Instead, pass DataExtractor as an argument of parsing
function.

No functionality change.

llvm-svn: 207461
2014-04-28 23:00:06 +00:00
David Blaikie b2133cb88d AddressPool::HasBeenUsed: Add comment explaining the use-case for this flag.
Based on code review by Eric Christopher on r207323

llvm-svn: 207460
2014-04-28 22:52:50 +00:00
Alexey Samsonov e0d954d51d [DWARF parser] DWARFDebugFrame: use unique_ptr instead of raw pointer
llvm-svn: 207459
2014-04-28 22:52:24 +00:00
David Blaikie 46f8201187 DIE: Document some learnings about why the world isn't perfect.
llvm-svn: 207458
2014-04-28 22:41:39 +00:00
Alexey Samsonov fee0ee24c8 [DWARF parser] Simplify DWARFDebugAranges generation.
There is no need to keep the whole contents of .debug_aranges section
in memory when we build address ranges table. Memory optimization that
used to be in this code (precalculate the size of vector of ranges before
filling it) is not really needed - later we will compact and resize this
vector anyway.

llvm-svn: 207457
2014-04-28 22:27:46 +00:00
David Blaikie d67ffe8b73 Satisfy sub-optimal GCC warning.
(Clang doesn't warn here because it knows the string is benign - the
assert still checks what it's intended to - though putting the correct
parens does make clang-format format the code a little better)

llvm-svn: 207456
2014-04-28 22:27:26 +00:00
Eric Christopher 83dd2fad2a We already calculate WideVT above, just reuse it.
Patch by Jan Vesely <jan.vesely@rutgers.edu>.

llvm-svn: 207455
2014-04-28 22:24:57 +00:00
Paul Robinson f44157d6ab When Driver::generateCompilationDiagnostics is filtering the list of
inputs to the preprocessor, check for invalid types first because not
all linker inputs have an option value to retrieve.

llvm-svn: 207454
2014-04-28 22:24:44 +00:00
Eli Bendersky 3468d9d929 Move all CUDA testing inputs to Inputs/ subdirectory inside the tests.
llvm-svn: 207453
2014-04-28 22:21:28 +00:00
Eli Bendersky 6ae9883eeb Add (...) around && clause to appeace gcc 4.8's warning
llvm-svn: 207452
2014-04-28 22:19:12 +00:00
David Majnemer 27d69dbbd0 CodeGen: Fix linkage of reference temporaries
Summary:
A reference temporary should inherit the linkage of the variable it
initializes.  Otherwise, we may hit cases where a reference temporary
wouldn't have the same value in all translation units.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3515

llvm-svn: 207451
2014-04-28 22:17:59 +00:00
Dan Liew 923cecab5c Teach add_sphinx_target() to respect the LLVM_INSTALL_TOOLCHAIN_ONLY CMake
option.

llvm-svn: 207450
2014-04-28 22:06:20 +00:00
Ed Maste abb813275f Address warnings in EmulateInstructionARM64
- Remove default for switch which covers all enumeration values

- Remove unused functions
  LSL_C is left in the source under #if 0, as it may be needed in the
  future for emulating other instructions.

Differential Revision: http://reviews.llvm.org/D3528

llvm-svn: 207449
2014-04-28 21:34:04 +00:00
David Blaikie bd57905321 DebugInfo: Just store the DIE by value in the DwarfUnit
Since all 4 ctor calls in DwarfDebug just pass in a trivially
constructed DIE with the right tag type, sink the tag selection down
into the Dwarf*Unit ctors (removing the argument entirely from callers
in DwarfDebug) and initialize the DIE member in DwarfUnit.

llvm-svn: 207448
2014-04-28 21:14:27 +00:00
David Blaikie 92a2f8a836 Pass DIEs to DwarfUnit constructors by unique_ptr.
llvm-svn: 207447
2014-04-28 21:04:29 +00:00
Justin Bogner f24d9c9158 [cleanup] Fix an 80-column violation
llvm-svn: 207446
2014-04-28 20:58:58 +00:00
Rafael Espindola bc91d7e25a Add an option for evaluating past symbols.
When evaluating an assembly expression for a relocation, we want to
stop at MCSymbols that are in the symbol table, even if they are variables.
This is needed since the semantics may require that the relocation use them.

That is not the case when computing the value of a symbol in the symbol table.
There are no relocations in this case and we have to keep going until we hit
a section or find out that the expression doesn't have an assembly time
value.

llvm-svn: 207445
2014-04-28 20:53:11 +00:00
Eric Christopher 793c7479b5 Reformat, 80-col, tab characters, etc.
llvm-svn: 207444
2014-04-28 20:42:22 +00:00
Alexey Samsonov d94e87db3f [Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interceptors
llvm-svn: 207443
2014-04-28 20:40:25 +00:00
David Blaikie f244922f43 Improve explicit memory ownership of DIEs
Now that the subtle constructScopeDIE has been refactored into two
functions - one returning memory to take ownership of, one returning a
pointer to already owning memory - push unique_ptr through more APIs.

I think this completes most of the unique_ptr ownership of DIEs.

llvm-svn: 207442
2014-04-28 20:36:45 +00:00
David Blaikie d8f0ac7b4a DwarfDebug: Omit DW_AT_object_pointer on inlined_subroutines
While refactoring out constructScopeDIE into two functions I realized we
were emitting DW_AT_object_pointer in the inlined subroutine when we
didn't need to (GCC doesn't, and the abstract subprogram definition has
the information already).

So here's the refactoring and the bug fix. This is one step of
refactoring to remove some subtle memory ownership semantics. It turns
out the original constructScopeDIE returned ownership in its return
value in some cases and not in others. The split into two functions now
separates those two semantics - further cleanup (unique_ptr, etc) will
follow.

llvm-svn: 207441
2014-04-28 20:27:02 +00:00
Duncan P. N. Exon Smith 295b5e7481 blockfreq: Remove more extra typenames from r207438
llvm-svn: 207440
2014-04-28 20:22:29 +00:00
Duncan P. N. Exon Smith a375e711f6 blockfreq: Remove extra typename from r207438
llvm-svn: 207439
2014-04-28 20:08:23 +00:00
Duncan P. N. Exon Smith c5a3139ebd Reapply "blockfreq: Approximate irreducible control flow"
This reverts commit r207287, reapplying r207286.

I'm hoping that declaring an explicit struct and instantiating
`addBlockEdges()` directly works around the GCC crash from r207286.
This is a lot more boilerplate, though.

llvm-svn: 207438
2014-04-28 20:02:29 +00:00
Simon Atanasyan 0804610e9f [Mips] Rename the test case.
llvm-svn: 207437
2014-04-28 19:34:46 +00:00
Simon Atanasyan 9b5e5d7942 [Mips] Rewrite the R_MIPS_COPY relocation test using yaml2obj tool.
llvm-svn: 207436
2014-04-28 19:34:39 +00:00