Commit Graph

40517 Commits

Author SHA1 Message Date
NAKAMURA Takumi 453807fffe IvarInvalidationChecker.cpp: Remove an unused member, InterfD. [-Wunused-private-field]
llvm-svn: 164745
2012-09-27 01:52:00 +00:00
Argyrios Kyrtzidis 4fcd2885de Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

llvm-svn: 164743
2012-09-27 01:42:07 +00:00
Jordan Rose 8ba0fba28a Use %clang_cc1 so that the test works even if the target isn't available.
Xcode-style clang builds only support Xcode's architectures, so mips
isn't available and the driver tries to use gcc instead. cc1 will go
ahead and do -fsyntax-only for any platform it knows about even if it
can't actually compile.

llvm-svn: 164742
2012-09-27 01:40:12 +00:00
Argyrios Kyrtzidis 5c8b1cd220 [libclang] Always report a CXCursor_MacroDefinition for code-completion
results for a macro name, not CXCursor_NotImplemented.

llvm-svn: 164740
2012-09-27 00:24:09 +00:00
Bill Wendling 3af41e6c5f Use a variable to stop us from building clang testing tools.
<rdar://problem/11202465>

llvm-svn: 164739
2012-09-27 00:11:09 +00:00
Nick Lewycky 2099bbb24b Turn off this test, as the new and old SROA cause it produce different output.
Left in a note that we need to turn it back on once the SROA fallout is cleared
up.

llvm-svn: 164733
2012-09-26 22:48:46 +00:00
Bill Wendling 6fe7b78db4 Update to new function attribute querying syntax.
llvm-svn: 164726
2012-09-26 21:59:46 +00:00
Benjamin Kramer 2715fce524 Allow -MF to be used in combination with -E -M or -E -MM.
Fixes PR13851. Patch by Dimitry Andric!

llvm-svn: 164717
2012-09-26 19:01:49 +00:00
Anna Zaks 9802f9fb2a [analyzer] Add experimental ObjC invalidation method checker.
This checker is annotation driven. It checks that the annotated
invalidation method accesses all ivars of the enclosing objects that are
objects of type, which in turn contains an invalidation method.

This is driven by
__attribute((annotation("objc_instance_variable_invalidator")).

llvm-svn: 164716
2012-09-26 18:55:16 +00:00
Anna Zaks a3683dd69e [analyzer] Commit a test case for r164579.
llvm-svn: 164715
2012-09-26 18:55:09 +00:00
Ted Kremenek f81b0e387a Have set-xcode-analyer report an error if no xcspec file could be found.
llvm-svn: 164713
2012-09-26 18:19:55 +00:00
Ted Kremenek 66dfa34404 Make set-xcode-analyzer more tolerant of the naming differenes reported by xcode-select.
llvm-svn: 164712
2012-09-26 18:13:03 +00:00
Ted Kremenek 8971b028e7 Revert "Use sep instead of ' '."
This isn't correct, as Jordan correctly points out.

llvm-svn: 164711
2012-09-26 18:06:08 +00:00
DeLesley Hutchins f39c0c2487 Fix template instantiation of attributes. More specifically, fix the case
where an attribute is attached to a forward declaration of a template function,
and refers to parameters of that declaration, but is then inherited by the
definition of that function.  When the definition is instantiated, the
parameter references need to be remapped.

llvm-svn: 164710
2012-09-26 17:57:31 +00:00
Ted Kremenek 2de0a9919b Use sep instead of ' '.
llvm-svn: 164709
2012-09-26 17:23:31 +00:00
Jordan Rose 17df40d484 Make our mini-stdint.h platform-independent by using predefined macros.
This also adds a definition for uint64_t, which was causing build failures
on some platforms. (I'm actually surprised this didn't happen on more
builders, but maybe the search paths are different.)

llvm-svn: 164706
2012-09-26 16:41:11 +00:00
Argyrios Kyrtzidis 9ae3956f22 [libclang] Remove the ParentKind cursor kind from code-completion results.
This is to reduce dependency to cursors for the code-completion results.

llvm-svn: 164705
2012-09-26 16:39:56 +00:00
Argyrios Kyrtzidis 39a76387e0 Have ASTUnit::Save() return a bool to indicate save error.
Removes a dependency of ASTUnit to clang-c/Index.h.

llvm-svn: 164704
2012-09-26 16:39:46 +00:00
Logan Chien 35795cf9c1 Fix build failure and enhance the testcase for unwind.h.
llvm-svn: 164683
2012-09-26 09:40:37 +00:00
Benjamin Kramer 010f114093 Run test in a freestanding environment so it doesn't accidentally pick up system headers for the wrong target.
While there add a test that verifies that the header parses in C++ mode.

llvm-svn: 164679
2012-09-26 09:10:53 +00:00
Nico Weber c05ecd5b17 Fix two more tests that didn't do anything.
Found with
  find test -type f | xargs grep RUN: | grep '%clang' | grep -iv '%s' | grep -v '%t' | grep -v '\\$'

llvm-svn: 164678
2012-09-26 09:09:17 +00:00
Nico Weber f666b2a547 Make this test actually test something
llvm-svn: 164677
2012-09-26 09:02:07 +00:00
Nico Weber dd9602fe93 Revert r163022, it caused PR13924.
Add a test for PR13924. Do not revert the test added in r163022,
it surprisingly still passes even after reverting the code changes.

llvm-svn: 164672
2012-09-26 08:19:01 +00:00
Logan Chien 774442162d Add struct keyword before _Unwind_Context.
In the C programming language, we have to add the
"struct" keyword.  Otherwise, the compiler will
emit error message.

llvm-svn: 164665
2012-09-26 06:35:17 +00:00
Ted Kremenek a808e165b2 Remove unnecessary ASTContext& parameter from SymExpr::getType().
llvm-svn: 164661
2012-09-26 06:00:14 +00:00
Nico Weber ca496f34a2 Add codegen support for the __debugbreak intrinsic.
llvm-svn: 164660
2012-09-26 05:40:16 +00:00
Eli Friedman 15681d6852 Fix an edge case of mangling involving the combination of a lambda and typeid.
typeid (and a couple other non-standard places where we can transform an
unevaluated expression into an evaluated expression) is special
because it introduces an an expression evaluation context,
which conflicts with the mechanism to compute the current
lambda mangling context.  PR12123.

I would appreciate if someone would double-check that we get the mangling
correct with this patch.

llvm-svn: 164658
2012-09-26 04:34:21 +00:00
Eli Friedman b826a00857 Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.

llvm-svn: 164656
2012-09-26 02:36:12 +00:00
Richard Smith 6e0605d654 Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType
for a type alias template can appear as sugar at any level of desugaring, just
like a TypedefType.

llvm-svn: 164655
2012-09-26 02:18:13 +00:00
Ted Kremenek bc8cd06865 Update checker build.
llvm-svn: 164649
2012-09-25 23:58:39 +00:00
Michael J. Spencer 9d1221a281 [Options] Store the option ID in OptTable::Info.
llvm-svn: 164644
2012-09-25 23:12:48 +00:00
Ted Kremenek 15a4bea41e Remove 'const' version of getBasicVals(), which is useless.
llvm-svn: 164643
2012-09-25 23:12:12 +00:00
Jordan Rose de584de370 Rename CanFitInto64Bits to alwaysFitsInto64Bits per discussion on IRC.
This makes the behavior clearer concerning literals with the maximum
number of digits. For a 32-bit example, 4,000,000,000 is a valid uint32_t,
but 5,000,000,000 is not, so we'd have to count 10-digit decimal numbers
as "unsafe" (meaning we have to check for overflow when parsing them,
just as we would for numbers with 11 digits or higher). This is the same,
only with 64 bits to play with.

No functionality change.

llvm-svn: 164639
2012-09-25 22:32:51 +00:00
Chad Rosier c30eb1c282 [driver] Add support for the -fno-fast-math option.
rdar://12299433

llvm-svn: 164638
2012-09-25 22:03:25 +00:00
Argyrios Kyrtzidis 341de09dcd [libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.
llvm-svn: 164626
2012-09-25 19:29:50 +00:00
Argyrios Kyrtzidis 2f45853f2f Improve upon r164450 and localize the logic of updating the type of
a function decl inside the ASTNodeImporter::VisitFunctionDecl function.

llvm-svn: 164625
2012-09-25 19:26:39 +00:00
Dmitri Gribenko 511288b2b5 Optimize NumericLiteralParser::GetIntegerValue().
It does a conservative estimate on the size of numbers that can fit into
uint64_t.  This bound is improved.

llvm-svn: 164624
2012-09-25 19:09:15 +00:00
Jordan Rose 902f02db72 [analyzer] Add tests for symbolic expression liveness.
There are very few tests here because SValBuilder is fairly aggressive
about not building SymExprs that we can't evaluate, which saves memory
and CPU but also makes it very much tied to the current constraint
manager. We should probably scale back here and let things decay to
UnknownVal later on.

bitwise-ops.c tests that for the SymExprs we do create, we persist our
assumptions about them. traversal-path-unification.c tests that we do
clean out constraints on arbitrary SymExprs once they have actually died.

llvm-svn: 164623
2012-09-25 19:03:09 +00:00
Jordan Rose db72e2fc37 Reapply "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Previously, we'd just keep constraints around forever, which means we'd
never be able to merge paths that differed only in constraints on dead
symbols.

Because we now allow constraints on symbolic expressions, not just single
symbols, this requires changing SymExpr::symbol_iterator to include
intermediate symbol nodes in its traversal, not just the SymbolData leaf
nodes.

This depends on the previous commit to be correct. Originally applied in
r163444, reverted in r164275, now being re-applied.

llvm-svn: 164622
2012-09-25 19:03:06 +00:00
Jordan Rose 60d704ab4a [analyzer] Calculate liveness for symbolic exprs as well as atomic symbols.
No tests, but this allows the optimization of removing dead constraints.
We can then add tests that we don't do this prematurely.

<rdar://problem/12333297>

Note: the added FIXME to investigate SymbolRegionValue liveness is
tracked by <rdar://problem/12368183>. This patch does not change the
existing behavior.

llvm-svn: 164621
2012-09-25 19:03:01 +00:00
Douglas Gregor 24ff3bc392 Under certain terrible circumstances (<rdar://problem/10805775>),
top-level frameworks can actually be symlinked over to embedded
frameworks, and accessed via the top-level framework's headers. In
this case, we need to determine that the framework was *actually* an
embedded framework, so we can load the appropriate top-level module.

llvm-svn: 164620
2012-09-25 18:29:14 +00:00
Alexander Kornienko 1d26c02722 Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.
Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules.

Reviewers: doug.gregor

Reviewed By: alexfh

CC: cfe-commits, rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D41

llvm-svn: 164610
2012-09-25 17:18:14 +00:00
Bob Wilson 24719e3236 Examine the last, not the first, instruction from the MC matcher.
If an MS-style inline asm is matched to multiple instructions, e.g., with a
a WAIT-prefix, then we need to examine the operands of the last instruction
instruction, not the prefix instruction.

llvm-svn: 164608
2012-09-25 16:30:16 +00:00
Douglas Gregor e6a82d9018 -iframework should allow separate arguments.
llvm-svn: 164607
2012-09-25 16:13:41 +00:00
Douglas Gregor c83de30add Introduce builtin macros to determine whether we're building a
specific module (__building_module(modulename)) and to get the name of
the current module as an identifier (__MODULE__). 

Used to help headers behave differently when they're being included as
part of building a module. Oh, the irony.

llvm-svn: 164605
2012-09-25 15:44:52 +00:00
Alexander Kornienko dcaf4a3a4b A minor doc fix.
llvm-svn: 164601
2012-09-25 12:42:05 +00:00
Hans Wennborg c980408c71 Fix failing test/Sema/wchar.c on ARM.
Currently Sema/wchar.c fails because WCHAR_T_TYPE is defined as int,
however on ARM wchar_t is unsigned int.

This patch changes that, so this test passes for ARM.

Patch by Joey Gouly!

llvm-svn: 164598
2012-09-25 10:11:17 +00:00
John McCall 82fb892019 When performing a ::delete of an object with a virtual destructor,
be sure to delete the complete object pointer, not the original
pointer.  This is necessary if the base being deleted is at a
non-zero offset in the complete object.  This is only required
for objects with virtual destructors because deleting an object
via a base-class subobject when the base does not have a virtual
destructor is undefined behavior.

Noticed while reviewing the last four years of cxx-abi-dev
activity.

llvm-svn: 164597
2012-09-25 10:10:39 +00:00
NAKAMURA Takumi 924ce0d9aa clang/test/CodeGenCXX/microsoft-*: Fix for -Asserts.
llvm-svn: 164594
2012-09-25 09:53:18 +00:00
John McCall f652e9a6b0 Implement Mike Herrick's proposed noexcept mangling.
llvm-svn: 164593
2012-09-25 09:10:17 +00:00