Commit Graph

148442 Commits

Author SHA1 Message Date
Dmitri Gribenko b8f9f3ef0b Documentation: Change UTF-8 ellipsis character to ASCII ... sequence
Patch by Dimitry Andric

llvm-svn: 180674
2013-04-27 16:26:29 +00:00
Benjamin Kramer 34463cf41d Silence a silly sign compare warning from GCC.
llvm-svn: 180673
2013-04-27 15:07:53 +00:00
Dmitri Gribenko d3c5a51e9d Documentation: add an idea for a cpp14-migrate transform for N3421
llvm-svn: 180672
2013-04-27 13:41:02 +00:00
Tim Northover 72e122607f AArch64: convert MC-layer test to .s file
The CodeGen aspects of this test are already covered by cfi-frame.ll;
making it an assembly file reduces the risk of incidental changes
affecting the test.

llvm-svn: 180671
2013-04-27 11:56:14 +00:00
Benjamin Kramer 85f5aa1e6d Exit early when $PWD isn't set. Remove unused unistd.h include.
llvm-svn: 180670
2013-04-27 08:42:33 +00:00
Benjamin Kramer 698d7c86f0 Use LLVM's preferred current_path API instead of calling getcwd(3) directly.
The existing code also failed to allocate a buffer for it so getcwd corrupted
the stack. sys::fs::current_path takes care of the memory management.

llvm-svn: 180669
2013-04-27 08:12:29 +00:00
Michael Gottesman b33b6cb84a [objc-arc] Test cleanups.
Mainly adding paranoid checks for the closing brace of a function to
help with FileCheck error readability. Also some other minor changes.

No actual CHECK changes.

llvm-svn: 180668
2013-04-27 05:25:54 +00:00
Andrew Trick 85058af650 Generalize the MachineTraceMetrics public API.
Naturally, we should be able to pass in extra instructions, not just
extra blocks.

llvm-svn: 180667
2013-04-27 03:54:20 +00:00
Andrew Trick bcda43135c Add target flags to MachineMemOperands.
This seems to me an obvious place to allow target passes to annotate
memory operations. There are plenty of bits, and I'm not aware of
another good way for early target passes to propagate hints along to
later passes. Target independent transforms can simply preserve them,
the way they preserve the other flags. Like MachineMemOperands in
general, if the target flags are lost we must still generate correct
code.

This has lots of uses, but I want this flexibility now to make it
easier to work with the new MachineTraceMetrics
analysis. MachineTraceMetrics can gather a lot of information about
instructions based on the surrounding code. This information can be
used to influence postRA machine passes that don't work on SSA form.

llvm-svn: 180666
2013-04-27 03:54:17 +00:00
Andrew Trick 94c08a7b66 whitespace
llvm-svn: 180665
2013-04-27 03:54:14 +00:00
Sean Callanan df56540a58 Performance optimizations to ClangUserExpression,
mostly related to management of the stack frame
for the interpreter.

  - First, if the expression can be interpreted,
    allocate the stack frame in the target process
    (to make sure pointers are valid) but only
    read/write to the copy in the host's memory.

  - Second, keep the memory allocations for the
    stack frame and the materialized struct as
    member variables of ClangUserExpression.  This
    avoids memory allocations and deallocations
    each time the expression runs.

<rdar://problem/13043685>

llvm-svn: 180664
2013-04-27 02:19:33 +00:00
Sean Callanan 956dca9288 Fixed a crash when we tried dyn_cast<>ing a
null pointer.

<rdar://problem/13745684>

llvm-svn: 180663
2013-04-27 01:57:44 +00:00
Sean Callanan a30b5b7a97 Fixed the anonymous testcase. It was testing
access to 'z' where 'z' was not in scope.

llvm-svn: 180662
2013-04-27 01:53:20 +00:00
Chad Rosier 1675c0e6e3 [driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
make the gdb tests and the Windows bots happy.

The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so 
r180652 causes a gdb tests to fail.  On the other hand, <sys/param.h> 
isn't defined on Windows systems, so that causes Windows builds to fail.
rdar://12237559

llvm-svn: 180661
2013-04-27 01:14:43 +00:00
Eric Christopher 203e12bf9e Use the target triple from the target machine rather than the module
to determine whether or not we're on a darwin platform for debug code
emitting.

Solves the problem of a module with no triple on the command line
and no triple in the module using non-gdb ok features on darwin. Fix
up the member-pointers test to check the correct things for cross
platform (DW_FORM_flag is a good prefix).

Unfortunately no testcase because I have no ideas how to test something
without a triple and without a triple in the module yet check
precisely on two platforms. Ideas welcome.

llvm-svn: 180660
2013-04-27 01:07:52 +00:00
Eric Christopher b2a602d730 Move the XFAIL out of the middle of a comment.
llvm-svn: 180659
2013-04-27 01:07:22 +00:00
Chad Rosier df001f7fb2 Fix the dangling pointer.
llvm-svn: 180658
2013-04-27 00:57:18 +00:00
Rafael Espindola 1357ab74e5 Make all darwin ppc stubs local.
This fixes pr15763.
Patch by David Fang.

llvm-svn: 180657
2013-04-27 00:43:16 +00:00
Manman Ren 0e52166bed Struct-path aware TBAA: fix handling of may_alias attribute.
llvm-svn: 180656
2013-04-27 00:39:37 +00:00
Enrico Granata cd67f97cb7 <rdar://problem/12529989>
Synthetic children provider for NSOrderedSet

llvm-svn: 180655
2013-04-27 00:27:20 +00:00
Manman Ren 5c37106d65 Struct-path aware TBAA: change the format of TBAAStructType node.
We switch the order of offset and field type to make TBAAStructType node
(name, parent node, offset) similar to scalar TBAA node (name, parent node).
TypeIsImmutable is added to TBAAStructTag node.

llvm-svn: 180654
2013-04-27 00:26:11 +00:00
Manman Ren a6b7303e4c Struct-path aware TBAA: change the format of TBAAStructType node.
We switch the order of offset and field type to make TBAAStructType node
(name, parent node, offset) similar to scalar TBAA node (name, parent node).

llvm-svn: 180653
2013-04-27 00:26:07 +00:00
Chad Rosier 5a8341d6be [driver] Use the llvm equivalent of getcwd(). Hopefully, this makes the Windows
bots recover.
rdar://12237559

llvm-svn: 180652
2013-04-27 00:11:10 +00:00
Argyrios Kyrtzidis 04703a6efd Fix an assertion hit in Sema::CheckObjCMethodOverrides.
llvm-svn: 180651
2013-04-27 00:10:12 +00:00
Fariborz Jahanian 5a2e4a2dc1 documenttion parsing. Provide a c-index test
and limit comment extraction to public c++
bases. // rdar://13647476

llvm-svn: 180646
2013-04-26 23:34:36 +00:00
Sean Callanan e5270598ba Hardening to avoid null-pointer crashes in the
presence of malformed class types.

<rdar://problem/13740646>

llvm-svn: 180645
2013-04-26 22:54:19 +00:00
Sean Callanan 969c5bd2d8 In the ASTImporter, when checking whether two
structs are compatible, check whether the fields
of the structs have the same name.  This prevents
erroneous coalescing of (in particular) anonymous
structs.

llvm-svn: 180644
2013-04-26 22:49:25 +00:00
Argyrios Kyrtzidis 12fdb9e34b [libclang] Introduce clang_Module_getASTFile function that returns the module file where a module object came from.
rdar://13743084

llvm-svn: 180643
2013-04-26 22:47:49 +00:00
Benjamin Kramer 62498ab4d5 Move helper classes into anonymous namespaces.
llvm-svn: 180642
2013-04-26 22:01:47 +00:00
Adrian Prantl d4c0dd4776 Cleanup and document MachineLocation.
Clarify documentation and API to make the difference between register and
register-indirect addressed locations more explicit. Put in a comment
to point out that with the current implementation we cannot specify
a register-indirect location with offset 0 (a breg 0 in DWARF).
No functionality change intended.

rdar://problem/13658587

llvm-svn: 180641
2013-04-26 21:57:17 +00:00
Jordan Rose 9de821ebfd [analyzer] An ObjC for-in loop runs 0 times if the collection is nil.
In an Objective-C for-in loop "for (id element in collection) {}", the loop
will run 0 times if the collection is nil. This is because the for-in loop
is implemented using a protocol method that returns 0 when there are no
elements to iterate, and messages to nil will result in a 0 return value.

At some point we may want to actually model this message send, but for now
we may as well get the nil case correct, and avoid the false positives that
would come with this case.

<rdar://problem/13744632>

llvm-svn: 180639
2013-04-26 21:43:01 +00:00
Jordan Rose 9661c1d18a [analyzer] Model casts to bool differently from other numbers.
Casts to bool (and _Bool) are equivalent to checks against zero,
not truncations to 1 bit or 8 bits.

This improved reasoning does cause a change in the behavior of the alpha
BoolAssignment checker. Previously, this checker complained about statements
like "bool x = y" if 'y' was known not to be 0 or 1. Now it does not, since
that conversion is well-defined. It's hard to say what the "best" behavior
here is: this conversion is safe, but might be better written as an explicit
comparison against zero.

More usefully, besides improving our model of booleans, this fixes spurious
warnings when returning the address of a local variable cast to bool.

<rdar://problem/13296133>

llvm-svn: 180638
2013-04-26 21:42:55 +00:00
Jordan Rose 0541159d68 [analyzer] Consolidate BoolAssignmentChecker tests by using two RUN lines.
llvm-svn: 180637
2013-04-26 21:42:47 +00:00
Daniel Malea 25029a00ca skip randomly failing test to avoid buildbot noise
llvm-svn: 180636
2013-04-26 21:39:11 +00:00
Argyrios Kyrtzidis d3afa0c7fb [PCH/modules] Require the preprocessing record option to match the used PCH, if modules are enabled.
The preprocessing record becomes important when modules are enabled, since it is used to calculate the
module cache hash.

llvm-svn: 180635
2013-04-26 21:33:40 +00:00
Argyrios Kyrtzidis e5edbf9a16 [Modules] Fix an issue where the reconstructed redeclaration chain was incomplete, missing the definition from a module.
-Make sure that a deserialized external decl gets added to the TU scope.
-When associating an identifier with a set of decls, use the most recent local ones,
  if they exist, otherwise associating decls from modules (that came after a local one)
  will lead to an incomplete reconstructed re-declaration chain.

rdar://13712705

llvm-svn: 180634
2013-04-26 21:33:35 +00:00
Argyrios Kyrtzidis 24ec769058 [frontend] Make -chain-include work when used with modules.
llvm-svn: 180633
2013-04-26 21:33:27 +00:00
Benjamin Kramer 139cfc2e63 ArrayRefize code. No functionality change.
llvm-svn: 180632
2013-04-26 21:32:52 +00:00
Bill Wendling 55a9c97c9c Micro-optimization
TLVs probably won't be as common as the other types of variables. Check for them
last before defaulting to "DATA".

llvm-svn: 180631
2013-04-26 21:15:08 +00:00
Benjamin Kramer 5259bbde82 Make CHECK lines a bit less strict so they also match code generated for win64.
Hopefully brings the windows buildbots back to life.

llvm-svn: 180630
2013-04-26 21:04:21 +00:00
Fariborz Jahanian e970c1b12a document parsing. When a sub-class (c++ Objective-C) missing
a comment, grab the first comment found in its class
heirarchy. Also, when a category is mossing a comment,
grab comment of its primary class. // rdar://13647476

llvm-svn: 180629
2013-04-26 20:55:38 +00:00
Chad Rosier a35d5a38fe [driver] Implement the -fdebug-compilation-dir in a way that is compatible with
gcc.  No test case included as I'm having problems finding a test case where
the inode/dev don't match.

llvm-svn: 180628
2013-04-26 20:49:50 +00:00
Dmitri Gribenko 148fdf2ed1 Documentation: improve description of make_shared transformation, as suggested by David Blaikie
llvm-svn: 180627
2013-04-26 20:20:30 +00:00
Nadav Rotem be0e89d9e8 Teach the interpreter to handle vector compares and additional vector arithmetic operations.
Patch by Yuri Veselov.

llvm-svn: 180626
2013-04-26 20:19:41 +00:00
Dmitri Gribenko e9585628ae Comment parsing: -fparse-all-comments: recognize empty line comments
In -fparse-all-comments mode empty '//' comments were recognized as
RCK_Invalid, and were not merged with next and previous lines.

Patch by Amin Shali.

llvm-svn: 180625
2013-04-26 20:12:49 +00:00
Rafael Espindola 6e040c0be2 Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser.
For Mach-O there were 2 implementations for parsing object files. A
standalone llvm/Object/MachOObject.h and llvm/Object/MachO.h which
implements the generic interface in llvm/Object/ObjectFile.h.

This patch adds the missing features to MachO.h, moves macho-dump to
use MachO.h and removes ObjectFile.h.

In addition to making sure that check-all is clean, I checked that the
new version produces exactly the same output in all Mach-O files in a
llvm+clang build directory (including executables and shared
libraries).

To test the performance, I ran macho-dump over all the files in a
llvm+clang build directory again, but this time redirecting the output
to /dev/null. Both the old and new versions take about 4.6 seconds
(2.5 user) to finish.

llvm-svn: 180624
2013-04-26 20:07:33 +00:00
Matt Kopec 23a03de34d Mark tests as expected fail for Linux due to not being able to call/print c++ demangled functions in the global namespace (bugzilla 15854).
llvm-svn: 180623
2013-04-26 20:04:24 +00:00
Rafael Espindola 03ee04bef6 The exception demo needs its symbols exported.
llvm-svn: 180622
2013-04-26 19:07:40 +00:00
Andrew Kaylor d693c19a73 Fixing a typo in the SBThread::Suspend documentation
llvm-svn: 180621
2013-04-26 18:34:17 +00:00
Tom Stellard 456adc6c4e R600: Initialize AMDGPUMachineFunction::ShaderType to ShaderType::COMPUTE
We need to intialize this to something and since clang does not set
the shader type attribute and clang is used only for compute shaders,
initializing it to COMPUTE seems like the best choice.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 180620
2013-04-26 18:32:24 +00:00