Commit Graph

186227 Commits

Author SHA1 Message Date
Rui Ueyama 30804c4220 [PECOFF] Fix SECREL relocations.
SECREL relocation's value is the offset to the beginning of the section.
Because of the off-by-one error, if a SECREL relocation target is at the
beginning of a section, it got wrong value.

Added a test that would have caught this.

llvm-svn: 221420
2014-11-06 01:03:23 +00:00
Lang Hames aa0f673413 [Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.
The old examples had missing/incorrect flags that were causing failures on newer
versions of clang and the tutorial code.

llvm-svn: 221419
2014-11-06 00:31:04 +00:00
Tobias Grosser ec7d67ede0 Extract SCEV generation into subfunction
This makes the code more readable and will be reused in subsequent OpenMP
patches.

llvm-svn: 221418
2014-11-06 00:27:01 +00:00
Fariborz Jahanian 5a29e6aadb Patch for small addition to availability attribute.
This is to accept "NA" in place of vesion number for availability
attribute. Used on introduced=NA to mean unavailable
and deprecated=NA to mean nothing (not deprecated).
rdar://18804883

llvm-svn: 221417
2014-11-05 23:58:55 +00:00
Greg Clayton 81eed943a3 Fixed the C++ method name class to be a bit more picky about what it identifies as a C++ method.
This was done by using regular expressions on any basename we find to ensure it is valid.

This fixed setting breakpoints by name with values like '[J]com.robovm.debug.server.apps.SleepLoop.startingUp()V'. This was previously triggering the C++ method name class to identify the string as C++ with a basename of '[J]com.robovm.debug.server.apps.SleepLoop.startingUp' which was obviously incorrect. 

The changes also fixed errors in templated function names like "void foo<int>(...)" where "void foo<int>" was being identified incorrectly as the basename. We also handle more C++ operators correctly now.

llvm-svn: 221416
2014-11-05 23:56:37 +00:00
Reid Kleckner 7bfd8bccb5 cmake: Only export targets in the standalone build
Trying to fix bots that didn't like the fact that I exported targets
that depended on LLVM without exporting targets from LLVM.

llvm-svn: 221415
2014-11-05 23:51:45 +00:00
Nick Kledzik 80118548d2 Fix shadowed variable warning
llvm-svn: 221414
2014-11-05 23:40:04 +00:00
Reid Kleckner ee3c175e6b cmake: Make the LLDB standalone build work for me
This allows me to generate a Visual Studio solution that builds LLDB if
you have standalone builds of LLVM and Clang lying around.
Unfortunately, you have to pass *four* CMake variables in, but it means
you don't have to take the extra step of installing Clang and LLVM to
some package prefix.

Hopefully this will generate a more usable XCode project too.

llvm-svn: 221413
2014-11-05 23:23:18 +00:00
David Majnemer 31fb9edc00 MachO: Remove an unused variable from processSection
The local variable `cfi` became dead in r220730 when it's use was
obviated; it was replaced with a call to read32.

No functionality change intended.

llvm-svn: 221412
2014-11-05 23:22:41 +00:00
Reid Kleckner ed8bca4f42 Make it easier to build against a pre-built Clang package with CMake
Installing <prefix>/share/clang/cmake/ClangConfig.cmake makes CMake's
builtin find_package() utility work with Clang. This also allows
downstream consumers of Clang to statically link against libraries like
clangAST and have that pull in dependencies like clangBasic and
LLVMSupport.

See the CMake docs on packages:
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

llvm-svn: 221411
2014-11-05 23:14:59 +00:00
DeLesley Hutchins 6d41f38c74 Thread Safety Analysis: move warnings on range-based for loops out of beta
and into -Wthread-safety.

llvm-svn: 221410
2014-11-05 23:09:28 +00:00
Alexey Samsonov 70f3897b0a [Sanitizer] Introduce generic stack frame rendering machinery
Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.

Test Plan: compiler-rt test suite

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 221409
2014-11-05 22:44:36 +00:00
Petar Jovanovic 35f05747f3 [mips64] Fix MIPS64 exception personality encoding
Remove dynamic relocations of __gxx_personality_v0 from the .eh_frame.
The MIPS64 follow-up of the MIPS32 fix (rL209907).

Patch by Vladimir Stefanovic.

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

llvm-svn: 221408
2014-11-05 22:42:31 +00:00
Simon Pilgrim 1fc483d991 [X86][SSE] Vector integer to float conversion memory folding
Added missing memory folding for the (V)CVTDQ2PS instructions - we can safely fold these (but not the (V)CVTDQ2PD versions which have a register/memory size discrepancy in the source operand). I've added a test case demonstrating that stack folding now works.

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

llvm-svn: 221407
2014-11-05 22:28:25 +00:00
Sean Silva 15ee408a91 [docs] Document usage of Inputs/ for extra test files.
llvm-svn: 221406
2014-11-05 22:17:18 +00:00
Zachary Turner 742346a22f Decouple ProcessWindows from the Windows debug driver thread.
In the llgs world, ProcessWindows will eventually go away and
we'll implement a different protocol.  This patch decouples
ProcessWindows from the core debug loop so that this transition
will not be more difficult than it needs to be.

llvm-svn: 221405
2014-11-05 22:16:28 +00:00
Fariborz Jahanian 1839abdabe This patch fixes a crash after rebuilding call AST of
an __unknown_anytype(...). In this case, we rebuild the
vararg function type specially to convert the call expression
to  something that IRGen can handle. However, FunctionDecl
as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and
results in crash when accessing its params later on. This
patch fixes the crash by rebuilding the FunctionDecl to match
its new resolved type. rdar://15297105.
John McCall, please review post-commit. 

llvm-svn: 221404
2014-11-05 21:50:22 +00:00
Sean Silva e727f57d37 [Linker] Add some test coverage for llvm.ident merging
llvm-svn: 221403
2014-11-05 21:33:34 +00:00
Enrico Granata ab0e831485 Allow inline test case to register actually useful teardown hooks by allowing a hook to be passed back the test instance, were it not to be already bound to self. Use this ability to make the reversal of escape-non-printables a teardown hook for added reliability of the testing logic
llvm-svn: 221402
2014-11-05 21:31:57 +00:00
Michael Ilseman a7202bdbed Fix heap-use-after-free bug in expandSDiv when the operands are
constants, as discovered by ASAN.

Patch by Mehdi Amini!

llvm-svn: 221401
2014-11-05 21:28:24 +00:00
Sean Callanan 43270c34d5 Fixed the Objective-C stripped ivar test to ensure
that we load debug information properly.  If we don't
explicitly add-dsym, sometimes Spotlight will help out
and tell us about the dSYM but we shouldn't be relying
on that.  Thanks to Jim for catching this.

<rdar://problem/16424661>

llvm-svn: 221400
2014-11-05 21:24:27 +00:00
Enrico Granata ebdc1ac014 Add a setting escape-non-printables that drives whether the StringPrinter should or should not escape sequences such as \t, \n, .. and generally any non-printing character
The recent StringPrinter changes made this behavior the default, and the setting defaults to yes
If you want to change this behavior and see non-printables unescaped (e.g. "a\tb" as "a    b"), set it to false

Fixes rdar://12969594

llvm-svn: 221399
2014-11-05 21:20:48 +00:00
Eric Fiselier d4bc0bf3a3 Fix rvalue bug in __has_operator_addressof
llvm-svn: 221398
2014-11-05 21:20:10 +00:00
Simon Atanasyan 7b1a5af229 [ELF] Use getVisibility() function to access st_other field
The st_other field can contains not only visibility flag so we should
retrieve a visibility flag using a bit-mask.

llvm-svn: 221397
2014-11-05 21:09:53 +00:00
Steven Wu d994b8aaa4 Remove obsolete ARM intrinsics vclz and vcnt
Both of the intrinsics get autoupgraded to target independent
intrinsics.

llvm-svn: 221396
2014-11-05 21:02:55 +00:00
Eric Fiselier c7e48bec0e Fix operator & detection trait to check for free function overloads as well
llvm-svn: 221395
2014-11-05 20:59:18 +00:00
Tobias Grosser 16371acdc4 BlockGenerator: Recompute values from SCEV before handing back the original values
This patch moves the SCEV based (re)generation of values before the checking for
scop-constant terms. It enables us to provide SCEV based replacements, which
are necessary to correctly generate OpenMP subfunctions when using the SCEV
based code generation.

When recomputing a new value for a value used in the code of the original scop,
we previously directly returned the same original value for all scop-constant
expressions without even trying to regenerate these values using our SCEV
expression. This is correct when the newly generated code remains fully in the
same function, however in case we want to outline parts of the newly generated
scop into subfunctions, this approach means we do not have any opportunity to
update these values in the SCEV based code generation. (In the non-SCEV based
code generation, we can provide such updates through the GlobalMap). To ensure
we have this opportunity, we first try to regenerate scalar terms with our SCEV
builder and will only return scop-constant expressions if SCEV based code
generation was not possible.

This change should not affect the results of the existing code generation
passes. It only impacts the upcoming OpenMP based code generation.

This commit also adds a test case. This test case passes before and after this
commit. It was added to ensure test coverage for the changed code.

llvm-svn: 221393
2014-11-05 20:48:56 +00:00
Simon Atanasyan 68a79a790c Add accessor to get 'visibility' part of st_other field
This new `getVisibility()` function will also be used in the LLD code.

llvm-svn: 221392
2014-11-05 20:47:35 +00:00
Reid Kleckner dd43a5c41f cmake: Conditionalize CodeGen's dependency on intrinsics_gen
Custom targets in cmake cannot be exported, and this dependency is only
needed in the combined build to ensure that Intrinsics.gen is created
before compiling CodeGen. In the standalone, all of LLVM is build first.

llvm-svn: 221391
2014-11-05 20:30:55 +00:00
Derek Schuff 059e525970 Fix test breakage from r221386
llvm-svn: 221389
2014-11-05 20:02:05 +00:00
Tobias Grosser d213a8b810 BlockGenerator: inline lookupAvailableValue into getValue [NFC]
There was no good reason why this code was split accross two functions.

In subsequent changes we will change the order in which values are looked up.
Doing so would make the split into two functions even more arbitrary.

We also slightly improve the documentation.

llvm-svn: 221388
2014-11-05 19:46:04 +00:00
Matt Arsenault f2676a5afc R600/SI: Fix omod display for VOP3b
llvm-svn: 221387
2014-11-05 19:35:00 +00:00
Derek Schuff a54222045e [x86 fast-isel] Materialize allocas with the correct-sized lea for ILP32
Summary:
X86FastISel::fastMaterializeAlloca was incorrectly conditioning its
opcode selection on subtarget bitness rather than pointer size.

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

llvm-svn: 221386
2014-11-05 19:27:21 +00:00
Frederic Riss b1ab28c949 [DebugInfo] Do not record artificial global initializer functions in the DeclCache.
When we are generating the global initializer functions, we call
CGDebugInfo::EmitFunctionStart() with a valid decl which is describing
the initialized global variable. Do not update the DeclCache with this
key as it will overwrite the the cached variable DIGlobalVariable with
the newly created artificial DISubprogram.

One could wonder if we should put artificial subprograms in the DIE tree
at all (there are vaild uses for them carrying line information though).

llvm-svn: 221385
2014-11-05 19:19:04 +00:00
Matt Arsenault b6e51ff1e7 R600/SI: Add testcase I forgot to commit from months ago
llvm-svn: 221384
2014-11-05 19:01:22 +00:00
Matt Arsenault f3cd4512ac R600/SI: Move all rsrc building functions to SIISelLowering
llvm-svn: 221383
2014-11-05 19:01:19 +00:00
Matt Arsenault 485defe58c R600/SI: Remove SI_ADDR64_RSRC
llvm-svn: 221382
2014-11-05 19:01:17 +00:00
Kuba Brecka fe4e7c1716 Fix failing allow_user_segv.cc test on OS X 10.10
The current ASan testcase Posix/allow_user_segv.cc expects SIGBUS to be triggered on 32-bit Darwin. This has apparently changed on 10.10 to trigger SIGSEGV instead, just as on 64-bit. Let's just install handlers for both SIGSEGV and SIGBUS instead of #ifdef'ing.

Reviewed at http://reviews.llvm.org/D6121

llvm-svn: 221381
2014-11-05 18:58:41 +00:00
Kuba Brecka 0078cea792 Extend the OS X pthread_get_stacksize_np workaround to 10.10
Fixes a failing ASan testcase (TestCases/stack-use-after-return.cc) on OS X 10.10.

Reviewed at http://reviews.llvm.org/D6120

llvm-svn: 221380
2014-11-05 18:55:38 +00:00
Kuba Brecka f4bdbde26f Extend Mac OS versions to Yosemite
This also fixes the test/asan/TestCases/Darwin/malloc_zone-protected.cc test failure on OS X 10.10.

Reviewed at http://reviews.llvm.org/D6119

llvm-svn: 221379
2014-11-05 18:53:22 +00:00
Zachary Turner 0d594e136e Fix LLDB build as a result of upstream LLVM changes.
llvm-svn: 221378
2014-11-05 18:37:53 +00:00
Justin Holewinski 3d140fcfd1 [NVPTX] Add NVPTXLowerStructArgs pass
This works around the limitation that PTX does not allow .param space
loads/stores with arbitrary pointers.

If a function has a by-val struct ptr arg, say foo(%struct.x *byval %d), then
add the following instructions to the first basic block :

%temp = alloca %struct.x, align 8
%tt1 = bitcast %struct.x * %d to i8 *
%tt2 = llvm.nvvm.cvt.gen.to.param %tt2
%tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) *
%tv = load %struct.x addrspace(101) * %tempd
store %struct.x %tv, %struct.x * %temp, align 8

The above code allocates some space in the stack and copies the incoming
struct from param space to local space. Then replace all occurences of %d
by %temp.

Fixes PR21465.

llvm-svn: 221377
2014-11-05 18:19:30 +00:00
Duncan P. N. Exon Smith 2b049767b3 IR: MDNode => Value: Update for LLVM API change in r221375
llvm-svn: 221376
2014-11-05 18:16:35 +00:00
Duncan P. N. Exon Smith c5754a65e6 IR: MDNode => Value: NamedMDNode::getOperator()
Change `NamedMDNode::getOperator()` from returning `MDNode *` to
returning `Value *`.  To reduce boilerplate at some call sites, add a
`getOperatorAsMDNode()` for named metadata that's expected to only
return `MDNode` -- for now, that's everything, but debug node named
metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change.  This
is part of PR21433.

Note that there's a follow-up patch to clang for the API change.

llvm-svn: 221375
2014-11-05 18:16:03 +00:00
Sanjay Patel 8f093f4138 remove extra breaks; NFC
llvm-svn: 221374
2014-11-05 18:00:07 +00:00
Duncan P. N. Exon Smith 21efe02e59 IR: MDNode => Value: AsmWriter SlotTracker API
Change `SlotTracker::CreateMetadataSlot()` and
`SlotTracker::getMetadataSlot()` to use `Value` instead of `MDNode`.
Part of PR21433.

llvm-svn: 221373
2014-11-05 17:56:28 +00:00
Tilmann Scheller 30c5ca25a5 [ARM] Remove more dead code.
Dead code identified by the Clang static analyzer.

llvm-svn: 221372
2014-11-05 17:45:04 +00:00
Zoran Jovanovic 06c9d55123 ps][microMIPS] Implement CodeGen support for ANDI16 instruction
llvm-svn: 221371
2014-11-05 17:43:00 +00:00
Colin LeMahieu 816ef086f6 [Hexagon] [NFC] Alphabetizing cmake files.
llvm-svn: 221370
2014-11-05 17:38:48 +00:00
Zoran Jovanovic 9f99723d92 ps][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
llvm-svn: 221369
2014-11-05 17:38:31 +00:00