Commit Graph

148631 Commits

Author SHA1 Message Date
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
Adrian Prantl a8aa97d310 cleanup testcase some more
rdar://problem/13056109

llvm-svn: 180619
2013-04-26 18:10:54 +00:00
Adrian Prantl d00333a4b2 fix a typo that due to cu&paste quadrupled itself
rdar://problem/13056109

llvm-svn: 180618
2013-04-26 18:10:50 +00:00
Quentin Colombet a83d5e9f91 ARM: Fix encoding of hint instruction for Thumb.
"hint" space for Thumb actually overlaps the encoding space of the CPS
instruction. In actuality, hints can be defined as CPS instructions where imod
and M bits are all nil.

Handle decoding of permitted nop-compatible hints (i.e. nop, yield, wfi, wfe,
sev) in DecodeT2CPSInstruction.

This commit adds a proper diagnostic message for Imm0_4 and updates all tests.

Patch by Mihail Popa <Mihail.Popa@arm.com>.

llvm-svn: 180617
2013-04-26 17:54:54 +00:00
Rafael Espindola 37212578ee Add missing ':'.
llvm-svn: 180616
2013-04-26 17:54:46 +00:00
Adrian Prantl 29b9de7bf1 Bugfix for the debug intrinsic handling in InstCombiner:
Since we can't guarantee that the original dbg.declare instrinsic
is removed by LowerDbgDeclare(), we need to make sure that we are
not inserting the same dbg.value intrinsic over and over.
This removes tons of redundant DIEs when compiling optimized code.

rdar://problem/13056109

llvm-svn: 180615
2013-04-26 17:48:33 +00:00
Matt Kopec 750dcc3323 Change Malloc to request an aligned memory size.
This fixes a problem on Linux where allocated memory would get overun in some use cases (ie. in TestExprs2.py).

llvm-svn: 180614
2013-04-26 17:48:01 +00:00
Andrew Kaylor a5d0f84694 Removing invalid test cases from thread state test
llvm-svn: 180613
2013-04-26 17:47:10 +00:00
Andrew Kaylor 5916d45add Fixing lldb log list text for commands category
llvm-svn: 180612
2013-04-26 17:44:41 +00:00
Ulrich Weigand 136ac22eaa PowerPC: Use RegisterOperand instead of RegisterClass operands
In the default PowerPC assembler syntax, registers are specified simply
by number, so they cannot be distinguished from immediate values (without
looking at the opcode).  This means that the default operand matching logic
for the asm parser does not work, and we need to specify custom matchers.
Since those can only be specified with RegisterOperand classes and not
directly on the RegisterClass, all instructions patterns used by the asm
parser need to use a RegisterOperand (instead of a RegisterClass) for
all their register operands.

This patch adds one RegisterOperand for each RegisterClass, using the
same name as the class, just in lower case, and updates all instruction
patterns to use RegisterOperand instead of RegisterClass operands.

llvm-svn: 180611
2013-04-26 16:53:15 +00:00
Richard Smith 74aeef50a0 Implement C++1y decltype(auto).
llvm-svn: 180610
2013-04-26 16:15:35 +00:00
Silviu Baranga af7e8c367f Re-write the address propagation code for pre-indexed loads/stores to take into account some previously misssed cases (PRE_DEC addressing mode, the offset and base address are swapped, etc). This should fix PR15581.
llvm-svn: 180609
2013-04-26 15:52:24 +00:00