Commit Graph

43725 Commits

Author SHA1 Message Date
Ted Kremenek 9ddfa89bed [scan-build] fix xcode version parsing to handle dot releases. Fixes <rdar://problem/13265300>.
llvm-svn: 175781
2013-02-21 19:33:30 +00:00
Chad Rosier 3e263e40e9 [driver] Handle the processing of the QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGS
before the DiagnosticsEngine is instantiated.  Otherwise, warning options are
not handled correctly.
rdar://13254743

llvm-svn: 175779
2013-02-21 18:56:55 +00:00
Jordan Rose cb8a1aca35 Preprocessor: preserve whitespace in -traditional-cpp mode.
Note that unlike GNU cpp we currently do not preserve whitespace in macros
(even in -traditional-cpp mode).

<rdar://problem/12897179>

llvm-svn: 175778
2013-02-21 18:53:19 +00:00
Chad Rosier 50f0c80341 [driver] Add a dump method for ArgList.
llvm-svn: 175777
2013-02-21 18:40:49 +00:00
Daniel Jasper 37905f711c Allow breaking between type and name in for loops.
This fixes llvm.org/PR15033.

Also: Always break before a parameter, if the previous parameter was
split over multiple lines. This was necessary to make the right
decisions in for-loops, almost always makes the code more readable and
also fixes llvm.org/PR14873.

Before:
for (llvm::ArrayRef<NamedDecl *>::iterator I = FD->getDeclsInPrototypeScope()
         .begin(), E = FD->getDeclsInPrototypeScope().end();
     I != E; ++I) {
}
foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
        ccccccccccccccccccccccccccccc), d, bar(e, f));

After:
for (llvm::ArrayRef<NamedDecl *>::iterator
         I = FD->getDeclsInPrototypeScope().begin(),
         E = FD->getDeclsInPrototypeScope().end();
     I != E; ++I) {
}
foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
        ccccccccccccccccccccccccccccc),
    d, bar(e, f));

llvm-svn: 175741
2013-02-21 15:00:29 +00:00
Evgeniy Stepanov 54b54e4772 Add MSan to the list of targets in Makefile-based builds.
llvm-svn: 175738
2013-02-21 13:59:14 +00:00
Joey Gouly c975cdcc58 Add a 64-bit triple to these tests, to fix 32-bit bots.
llvm-svn: 175736
2013-02-21 13:42:33 +00:00
Joey Gouly 15eeddebdc Fix an OpenCL test case. Pointer arguments to kernels must be declared with the
__global, __constant or __local qualifier.

llvm-svn: 175735
2013-02-21 12:06:32 +00:00
Joey Gouly 7d00f00f1d Add support to Sema and CodeGen for floating point vector types in OpenCL.
llvm-svn: 175734
2013-02-21 11:49:56 +00:00
David Blaikie 1c19139ae0 Correct spelling of 'enumerator'.
Post commit code review feedback to r175705 from Jordan Rose.

llvm-svn: 175725
2013-02-21 06:12:38 +00:00
David Blaikie 3a3c4e0f84 Avoid implicit conversions of Optional<T> to bool.
This is a precursor to making Optional<T>'s operator bool 'explicit' when
building Clang & LLVM as C++11.

llvm-svn: 175722
2013-02-21 06:05:05 +00:00
NAKAMURA Takumi a7a7e15d0d StaticAnalyzer/Core: Suppress warnings. [-Wunused-variable, -Wunused-function]
llvm-svn: 175721
2013-02-21 04:40:10 +00:00
NAKAMURA Takumi d4a50704b3 Whitespace.
llvm-svn: 175720
2013-02-21 04:40:04 +00:00
Jordan Rose 599f85ab85 [analyzer] Record whether a base object region represents a virtual base.
This allows MemRegion and MemRegionManager to avoid asking over and over
again whether an class is a virtual base or a non-virtual base.

Minor optimization/cleanup; no functionality change.

llvm-svn: 175716
2013-02-21 03:12:32 +00:00
Jordan Rose e6a8cedd2c [analyzer] Add another reinterpret_cast behavior test.
The test is similar to <rdar://problem/13239840> but doesn't actually test
the case that fails there. It's still a good test, though.

llvm-svn: 175715
2013-02-21 03:12:26 +00:00
Jordan Rose 55219d55a6 [analyzer] Tidy up a few uses of Optional in RegionStore.
Some that I just added needed conversion to use 'None', others looked
better using Optional<SVal>::create.

No functionality change.

llvm-svn: 175714
2013-02-21 03:12:21 +00:00
NAKAMURA Takumi c2b5d1f9b9 CIndex.cpp: Appease g++-4.4. "if (Optional<unsigned> Minor = In.getMinor())" did not work as expected.
llvm-svn: 175711
2013-02-21 02:32:34 +00:00
Richard Smith 8acb4044d8 libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard against
being included in C++. Don't define alignof or alignas in this case. Note that
the C++11 standard is broken in various ways here (it refers to the contents
of <stdalign.h> in C99, where that header did not exist, and doesn't mention
the alignas macro at all), but we do our best to do what it intended.

llvm-svn: 175708
2013-02-21 02:17:58 +00:00
Nick Lewycky fd8eac66fa Respect -fno-canonical-prefixes when deciding where to generate .gcno and .gcda
files.

llvm-svn: 175706
2013-02-21 02:02:50 +00:00
David Blaikie 7a30dc53c5 Use None rather than Optional<T>() where possible.
llvm-svn: 175705
2013-02-21 01:47:18 +00:00
David Blaikie c4071fe13d Rename TypeLoc's isType to isKind
Matches changes made to SVal's similar functions based on Jordan Rose's review
feedback to r175594.

Also change isKind to take a reference rather than a non-null pointer, while I'm
at it. (& make TypeLoc::isKind private)

llvm-svn: 175704
2013-02-21 01:47:08 +00:00
Jordan Rose d1c7cf26ae [analyzer] Tighten up safety in the use of lazy bindings.
- When deciding if we can reuse a lazy binding, make sure to check if there
  are additional bindings in the sub-region.
- When reading from a lazy binding, don't accidentally strip off casts or
  base object regions. This slows down lazy binding reading a bit but is
  necessary for type sanity when treating one class as another.

A bit of minor refactoring allowed these two checks to be unified in a nice
early-return-using helper function.

<rdar://problem/13239840>

llvm-svn: 175703
2013-02-21 01:34:51 +00:00
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