Commit Graph

43703 Commits

Author SHA1 Message Date
Ted Kremenek 0332558894 Strip 'llvm' from 'llvm::Optional' uses.
llvm-svn: 175701
2013-02-21 01:29:01 +00:00
Richard Trieu 515dc0f100 Remove commented out code.
llvm-svn: 175699
2013-02-21 00:50:43 +00:00
Fariborz Jahanian 134cec62ab objective-C arc IR-gen. Retaining of strong
arguments in function prologue is done
with objc_StoreStrong to pair it with
similar objc_StoreStrong for release in function
epilogue. This is done with -O0 only.
// rdar://13145317

llvm-svn: 175698
2013-02-21 00:40:10 +00:00
David Blaikie f8db6917b3 Mark unimplemented function with LLVM_DELETED_FUNCTION
llvm-svn: 175695
2013-02-21 00:26:17 +00:00
David Blaikie 7d26e7ef51 Doxycomment SVal's getAs/castAs.
Also document TypeLoc's operations similarly, since it's a good idea.

Post-commit CR feedback from Anna Zaks regarding r175594.

llvm-svn: 175694
2013-02-21 00:26:14 +00:00
Jordan Rose 011bda8031 Revert "intmax_t is long long on Darwin, not long."
'long' and 'long long' are different for the purposes of mangling.
This caused <rdar://problem/13254874>.

This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.

llvm-svn: 175681
2013-02-20 22:28:41 +00:00
Jim Grosbach 6f54f787b4 MCParser: Update method names per coding guidelines.
s/ParseMSInlineAsm/parseMSInlineAsm/

llvm-svn: 175680
2013-02-20 22:25:15 +00:00
David Blaikie 05785d1622 Include llvm::Optional in clang/Basic/LLVM.h
Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175679
2013-02-20 22:23:23 +00:00
David Blaikie e359f3caee Remove redundant Optional type in favor of llvm::Optional
llvm-svn: 175678
2013-02-20 22:23:03 +00:00
David Blaikie 0336f5d534 Use op-> directly rather than via Optional<T>::getPointer.
Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175677
2013-02-20 22:23:01 +00:00
David Blaikie fa5eeba1dc Rename SVal::isType functions to SVal::isKind
Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175676
2013-02-20 22:22:59 +00:00
Richard Smith b19337fbe4 PR15311: Finish implementation of the suggested resolution of core issue 1488,
which allows grouping parens in an abstract-pack-declarator. This was already
mostly implemented, but missed some cases. Add an ExtWarn for use of this
extension until CWG ratifies it.

llvm-svn: 175660
2013-02-20 20:19:27 +00:00
Bill Wendling 4467d79ad4 Attempt to clean up tests for non-X86 platforms.
llvm-svn: 175652
2013-02-20 19:30:01 +00:00
Richard Smith 54ecd9863f Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.

llvm-svn: 175649
2013-02-20 19:22:51 +00:00
Chad Rosier 7ef6fd3402 [ms-inline asm] Remove this test while I investigate why eax isn't being clobbered.
llvm-svn: 175637
2013-02-20 17:39:31 +00:00
Manuel Klimek 0c91571d33 Fix regression in string literal alignment.
Now correctly indents (again):
a = a + "a"
        "a"
        "a";

llvm-svn: 175630
2013-02-20 15:32:58 +00:00
Manuel Klimek 02f640a3ab Fixes bug in string literal alignment.
We now indent the following correctly:
1. some + "literal" /* comment */
          "literal";
2. breaking string literals after which we have another string literal.

llvm-svn: 175628
2013-02-20 15:25:48 +00:00
Daniel Jasper dc7d5817e2 Don't remove blank lines within unwrapped lines.
If the code author decides to put empty lines anywhere into the code we
should treat them equally, i.e. reduce them to the configured
MaxEmptyLinesToKeep.

With this change, we e.g. keep the newline in:
SomeType ST = {
  // First value
  a,

  // Second value
  b
};

llvm-svn: 175620
2013-02-20 12:56:39 +00:00
Manuel Klimek 1998ea2c7e Implements breaking of string literals if they stick out.
An alternative strategy to calculating the break on demand when hitting
a token that would need to be broken would be to put all possible breaks
inside the token into the optimizer.

Currently only supports breaking at spaces; more break points to come.

llvm-svn: 175613
2013-02-20 10:15:13 +00:00
Bill Wendling cc5224ceb8 Remove target-specific features.
llvm-svn: 175610
2013-02-20 08:01:34 +00:00
Bill Wendling c33fc4c004 Modify the tests to use attribute group references instead of listing the
function attributes.

llvm-svn: 175606
2013-02-20 07:22:19 +00:00
David Blaikie 2fdacbc5b0 Replace SVal llvm::cast support to be well-defined.
See r175462 for another example/more details.

llvm-svn: 175594
2013-02-20 05:52:05 +00:00
Jordan Rose e2b34142c3 intmax_t is long long on Darwin, not long.
<rdar://problem/11540697>

llvm-svn: 175588
2013-02-20 01:56:21 +00:00
John McCall d041a9bf2d Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.

Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.

The type_visibility work is rdar://11880378

llvm-svn: 175587
2013-02-20 01:54:26 +00:00
Richard Smith 98155ad3b5 Don't repeat the function name in the comment.
llvm-svn: 175586
2013-02-20 01:17:14 +00:00
Argyrios Kyrtzidis 09c9e811de [preprocessor] Split the MacroInfo class into two separate concepts, MacroInfo class
for the data specific to a macro definition (e.g. what the tokens are), and
MacroDirective class which encapsulates the changes to the "macro namespace"
(e.g. the location where the macro name became active, the location where it was undefined, etc.)

(A MacroDirective always points to a MacroInfo object.)

Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but
splitting the concepts allows us to better model the effect of modules to the macro namespace
(also as a bonus it allows better modeling of push_macro/pop_macro #pragmas).
Modules can have their own macro history, separate from the local (current translation unit)
macro history; MacroDirectives will be used to model the macro history (changes to macro namespace).

For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created
to indicate that "FOO" became active at the import location. Module "A" itself will contain another
MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives
will point to the same MacroInfo object.

Introducing the separation of macro concepts is the first part towards better modeling of module macros.

llvm-svn: 175585
2013-02-20 00:54:57 +00:00
Jordan Rose 7bfb415387 [analyzer] Account for the "interesting values" hash table resizing.
RegionStoreManager::getInterestingValues() returns a pointer to a
std::vector that lives inside a DenseMap, which is constructed on demand.
However, constructing one such value can lead to constructing another
value, which will invalidate the reference created earlier.

Fixed by delaying the new entry creation until the function returns.

llvm-svn: 175582
2013-02-20 00:27:26 +00:00
Richard Smith 4c96e99235 PR15300: Support C++11 attributes on base-specifiers. We don't support any such
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.

llvm-svn: 175575
2013-02-19 23:47:15 +00:00
Jordan Rose 111aa9a28b [analyzer] Don't accidentally strip off base object regions for lazy bindings.
If a base object is at a 0 offset, RegionStoreManager may find a lazy
binding for the entire object, then try to attach a FieldRegion or
grandparent CXXBaseObjectRegion on top of that (skipping the intermediate
region). We now preserve as many layers of base object regions necessary
to make the types match.

<rdar://problem/13239840>

llvm-svn: 175556
2013-02-19 20:28:33 +00:00
Daniel Jasper 6db1b7ca16 Add missing clang-format null pointer check..
.. and a test that triggers it in valid albeit questionable code.

llvm-svn: 175554
2013-02-19 20:05:41 +00:00
Argyrios Kyrtzidis e441264019 [modules] Const'ify some functions of ModuleMap.
llvm-svn: 175552
2013-02-19 19:58:45 +00:00
Argyrios Kyrtzidis 8739f7b7f6 [modules] Refactor code from ASTReader::makeModuleVisible() into a new function,
Module::getExportedModules() so it can be reused.

llvm-svn: 175548
2013-02-19 19:34:40 +00:00
Douglas Gregor cb15f086a5 Use MapVector::pop_back() per LLVM r175538.
llvm-svn: 175539
2013-02-19 18:26:28 +00:00
Sean Silva f2a472a321 [docs] Rename to permit wider variety of content.
I don't want to rule out the possibility of linking to e.g. interesting
blog posts about uses of Clang, so avoid restricting the content to
"projects".

This breaks URL compatibility, but this document was committed less than
an hour ago so hopefully nobody has linked to it yet.

llvm-svn: 175535
2013-02-19 17:29:01 +00:00
Sean Silva e3931a1cd4 [docs] Revise content on ExternalProjectsUsingClang page.
llvm-svn: 175534
2013-02-19 17:21:23 +00:00
Daniel Jasper 0047596cb0 Correctly format macro with unfinished template declaration.
We can now format:
  #define A template <typename T>

Before this created a segfault :-/.

llvm-svn: 175533
2013-02-19 17:14:38 +00:00
Edwin Vane 2c197e0939 Support in hasDeclaration for types with getDecl()
Using a new metafunction for detecting the presence of the member
'getDecl' in a type T, added support to hasDeclaration for any such type
T. This allows hasDecl() to be replaced and enables several other
subclasses of clang::Type to use hasDeclaration.

Updated unittests and LibASTMatchersReference.html.

Reviewers: klimek
llvm-svn: 175532
2013-02-19 17:14:34 +00:00
Sean Silva 63c3af69b8 [docs] Introduce ExternalProjectsUsingClang.rst
A couple concrete examples are sure to be a win. If you know of any
other external projects using Clang, please let me know!

Patch by Laszlo Nagy! (with a title tweak by me)

llvm-svn: 175529
2013-02-19 16:58:15 +00:00
Alexey Samsonov d26b3334b1 [Sanitizer] If -fsanitize-blacklist= option is not explicitly specified, make Clang look for the default sanitizer-specific blacklist in the resource directory.
llvm-svn: 175505
2013-02-19 11:25:29 +00:00
Timur Iskhodzhanov 2e9bd807e2 Add the missing 'static' keyword to the test
llvm-svn: 175502
2013-02-19 10:50:44 +00:00
Daniel Jasper 58f427ee41 Fix bug in LineState comparison function.
The key bug was

  if (Other.StartOfLineLevel < StartOfLineLevel) ..

instead of

  if (Other.StartOfLineLevel != StartOfLineLevel) ..

Also cleaned up the function to be more consistent in the comparisons.

llvm-svn: 175500
2013-02-19 09:28:55 +00:00
Eric Christopher 459d271756 More grammar.
llvm-svn: 175492
2013-02-19 06:16:53 +00:00
Aaron Ballman 16cd398a1a Fixing a typo where FixIts was accidentally self-assigning instead of assigning in the parameter Fixits. This fixes several failed assertions with MSVC debug builds.
llvm-svn: 175483
2013-02-19 02:32:05 +00:00
John McCall b4a99d3194 Add support for -fvisibility-ms-compat.
We treat this as an alternative to -fvisibility=<?>
which changes the default value visibility to "hidden"
and the default type visibility to "default".

Expose a -cc1 option for changing the default type
visibility, repurposing -fvisibility as the default
value visibility option (also setting type visibility
from it in the absence of a specific option).

rdar://13079314

llvm-svn: 175480
2013-02-19 01:57:35 +00:00
John McCall a496098bb8 Use the actual class visibility for the ObjC EHTYPE global,
not the global visibility mode.

Noticed by inspection.

llvm-svn: 175479
2013-02-19 01:57:29 +00:00
Bill Wendling 9721035f2d Temporarily revert r175471 for more review.
llvm-svn: 175477
2013-02-19 00:53:07 +00:00
Bill Wendling 63318ce957 Add a 'no-builtin' attribute if we do not want to simplify calls.
llvm-svn: 175471
2013-02-18 23:17:48 +00:00
David Blaikie 7cba50dfd4 Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.
Also removes some redundant DNI comments on function declarations already
using the macro.

llvm-svn: 175465
2013-02-18 23:11:09 +00:00
David Blaikie 6adc78e0df Replace TypeLoc llvm::cast support to be well-defined.
The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

llvm-svn: 175462
2013-02-18 22:06:02 +00:00
Dmitri Gribenko 7d09808818 libclang: don't store nul-terminated strings as StringRefs,
if the nul-terminatedness property is important for clients.

Also, don't return the same CXString multiple times.  This did not create a
correctness issue in practice because the CXString was of an CXS_Unmanaged
kind, and destruction was a no-op.

llvm-svn: 175455
2013-02-18 19:50:38 +00:00