Commit Graph

24457 Commits

Author SHA1 Message Date
Daniel Dunbar ea3813fbc9 Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Gray.

llvm-svn: 109994
2010-08-01 23:13:54 +00:00
Daniel Dunbar 88979914d7 Driver: Keep track of a separate "install dir", which is the path where clang
was invoked from (which may not be where the executable itself is).
 - This allows having e.g., /Developer/usr/bin/clang be a symlink to some other
   location, while still making sure the Driver finds 'as', 'ld', etc. relative
   to itself.

llvm-svn: 109989
2010-08-01 22:29:51 +00:00
Daniel Dunbar 5863fa5215 Simplify.
llvm-svn: 109988
2010-08-01 22:29:47 +00:00
Eli Friedman 60307d2072 PR7777: Set EnabledByDefault to something useful, instead of setting it
randomly.  This makes us consistently show "-pedantic" as the warning option
for a warning where appropriate.

llvm-svn: 109987
2010-08-01 22:13:15 +00:00
John McCall 81c9cea24b Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.

llvm-svn: 109986
2010-08-01 21:51:45 +00:00
John McCall 47e40931c9 Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.

llvm-svn: 109984
2010-08-01 20:20:59 +00:00
John McCall 6602bb1115 Instantiate attributes from the pattern record when instantiating
a class template.  Fixes rdar://problem/8243419.

llvm-svn: 109967
2010-08-01 02:01:53 +00:00
John McCall a755f0f74a Fix indentation.
llvm-svn: 109965
2010-08-01 01:25:24 +00:00
John McCall d4e1b767f3 Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.

llvm-svn: 109964
2010-08-01 01:24:59 +00:00
John McCall a95172baa0 Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function.  Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++.  rdar://problem/7702918

llvm-svn: 109962
2010-08-01 00:26:45 +00:00
Nick Lewycky 82bef970cf Iterate typeloc's for class bases.
llvm-svn: 109961
2010-07-31 23:26:36 +00:00
John McCall 42227edc79 Fix fragile-ABI ObjC exceptions in the presence of optimization with
the magic of inline assembly.  Essentially we use read and write hazards
on the set of local variables to force flushing locals to memory
immediately before any protected calls and to inhibit optimizing locals
across the setjmp->catch edge.  Fixes rdar://problem/8160285

llvm-svn: 109960
2010-07-31 23:20:56 +00:00
Daniel Dunbar b6ab76b82f build: Don't pass -avoid-version or -no-undefined on Darwin, they don't do
anything.

llvm-svn: 109958
2010-07-31 21:33:01 +00:00
Daniel Dunbar cb82acb884 Parser: Add support for #pragma align, which is just another spelling of #pragma
options align.

llvm-svn: 109952
2010-07-31 19:17:07 +00:00
Ted Kremenek d21139a34f After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking. Patch by Andrew McGregor!
llvm-svn: 109939
2010-07-31 01:52:11 +00:00
Douglas Gregor 0e11955c7a Implement dependency analysis for the precompiled preamble. If any of
the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.

llvm-svn: 109937
2010-07-31 00:40:00 +00:00
Ted Kremenek e92d2749b8 Update checker build.
llvm-svn: 109907
2010-07-30 23:07:20 +00:00
Tom Care fe1a4944b1 Test case for PR7763.
llvm-svn: 109895
2010-07-30 21:42:31 +00:00
Tom Care 18f67e669f Uncomment unfinished work bailout in IdempotentOperationsChecker.
llvm-svn: 109893
2010-07-30 21:14:15 +00:00
Douglas Gregor 15ba0b34a9 Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING environment variable is set.
llvm-svn: 109890
2010-07-30 20:58:08 +00:00
Sebastian Redl 671eee9e68 Correctly deal with using names for both functions and structs in chained PCH.
llvm-svn: 109871
2010-07-30 17:25:10 +00:00
Peter Collingbourne 7957c73f0b Add specialisation iterators for {Class,Function}TemplateDecl
This patch introduces the ClassTemplateDecl::spec_{begin,end}()
and FunctionTemplateDecl::{,partial_}spec_{begin,end}() member
functions as a public interface for iterating over the declarations'
specialisation sets.

llvm-svn: 109870
2010-07-30 17:09:11 +00:00
Peter Collingbourne b498ed6e0b Refactor find*Specialization functions using SpecEntryTraits
This patch reimplements the find*Specialization family of member
functions of {Class,Function}TemplateDecl in terms of a common
implementation that uses SpecEntryTraits to obtain the most recent
declaration.

llvm-svn: 109869
2010-07-30 17:09:04 +00:00
Peter Collingbourne e3de2ebe75 Introduce RedeclarableTemplateDecl::SpecEntryTraits
SpecEntryTraits describes how to obtain the most recent declaration
of a specialisation from an entry in a specialisation FoldingSet.

llvm-svn: 109868
2010-07-30 17:08:56 +00:00
Sebastian Redl 3df5a08b99 Safely get a data pointer for vectors that might be empty.
llvm-svn: 109867
2010-07-30 17:03:48 +00:00
Fariborz Jahanian 7b70eb4bb1 Tighten the rules when deciding if an ivar must be
auto-synthesized (nonfragile-abi2 specific).
Fixes radar 8251648.

llvm-svn: 109866
2010-07-30 16:59:05 +00:00
Abramo Bagnara ed5b6899ab Fixed typedef inside extern "C".
llvm-svn: 109865
2010-07-30 16:47:02 +00:00
Daniel Dunbar 14eb7bd769 tests: Use env instead of assuming bash.
llvm-svn: 109864
2010-07-30 16:40:29 +00:00
Ted Kremenek 73e2df464f Update checker build.
llvm-svn: 109862
2010-07-30 16:27:57 +00:00
Argyrios Kyrtzidis 98d045eb68 When we are deserializing the lexical decls of a DeclContext from PCH, notify the PCHReader to hold off passing Decls
to the consumer until the DeclContext is fully prepared.

Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would
form a cycle and we would enter infinite loop territory.

llvm-svn: 109857
2010-07-30 10:03:23 +00:00
Argyrios Kyrtzidis b24355af87 Refactor the way PCHReader tracks whether we are in recursive loading.
-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
  to ExternalASTSource.

These are preparation for the next commit.

llvm-svn: 109856
2010-07-30 10:03:16 +00:00
John McCall 413021a8c7 Improve error recovery when presented with an ill-formed template-id
(e.g. due to a broken template argument) following template parameters.

Fixes rdar://problem/8254267

llvm-svn: 109853
2010-07-30 06:26:29 +00:00
John McCall 0925714eca If a TST_typename has a null type, mark the declarator invalid. Prevents
some downstream crashes, among them rdar://problem/8229840.

llvm-svn: 109850
2010-07-30 05:17:22 +00:00
John McCall 45d494785d Emit global destructors even if the destroyed object has no initializers or has
an initializer requiring temporary object disposal.

Fixes rdar:://problem/8246444.

llvm-svn: 109849
2010-07-30 04:56:58 +00:00
Chris Lattner 8a2f3c778e fix PR5179 and correctly fix PR5831 to not miscompile.
The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example.  This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes).  In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.

This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to 
handle an argument value in registers being accessed at an
offset from the memory value.

This is the last x86-64 calling convention related miscompile
that I'm aware of.

llvm-svn: 109848
2010-07-30 04:02:24 +00:00
Daniel Dunbar b8cba97cde There is no reason for this test to invoke 'llc'.
llvm-svn: 109847
2010-07-30 03:30:55 +00:00
Ted Kremenek d5cd0f3fac Add test case for crash reported in <rdar://problem/8236270> (which has since been fixed in trunk).
llvm-svn: 109834
2010-07-30 01:10:48 +00:00
Ted Kremenek 28e1c9155e Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.
llvm-svn: 109833
2010-07-30 00:47:46 +00:00
Sebastian Redl 07a89a83d4 Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.
llvm-svn: 109823
2010-07-30 00:29:29 +00:00
Ted Kremenek 0c7476ad59 Add clang_isPODType() for querying if the CXType is POD. Implements <rdar://problem/8250669>.
llvm-svn: 109822
2010-07-30 00:14:11 +00:00
Daniel Dunbar cda4307308 Revert "Re-apply fixed version of 108749, correctly conditionalizing the new
sections on", this change uncovered a possible linker bug which resulted in the
wrong messages getting dispatched. Backing this out while we investigate...

llvm-svn: 109817
2010-07-29 22:57:21 +00:00
Daniel Dunbar 328913c17d CMake: Clang test targets depend on the {FileCheck,not,count} tools.
llvm-svn: 109816
2010-07-29 22:57:17 +00:00
Nate Begeman 1194bd2bd8 Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.
llvm-svn: 109814
2010-07-29 22:48:34 +00:00
Douglas Gregor b607393ac8 Teach isIncompleteType() to look through sugar when it is dealing with
Objective-C object and interface types. This is part of PR7741.

llvm-svn: 109808
2010-07-29 22:17:04 +00:00
Chris Lattner 1f3a063f00 move the last hunk of getCoerceResult into the place
that needs it and remove getCoerceResult.

llvm-svn: 109807
2010-07-29 21:42:50 +00:00
Chris Lattner 60fbd7744f now that direct and coerce are merged, getCoerceResult gets simpler.
llvm-svn: 109805
2010-07-29 21:29:53 +00:00
Chris Lattner 09794695ef now that GetSSETypeAtOffset handles passing SSE class values as
float, the special case hack in getCoerceResult can go away.

llvm-svn: 109804
2010-07-29 21:22:50 +00:00
Argyrios Kyrtzidis c904933aac Change the name to something less terrible; suggestion by Doug. No functionality change.
llvm-svn: 109797
2010-07-29 20:08:05 +00:00
Argyrios Kyrtzidis 6e03a7476f Weak references and variables that are not definitions are not required for early codegen/deserialization.
llvm-svn: 109796
2010-07-29 20:07:52 +00:00
Chris Lattner e556a71859 Implement the clang-side of detection for when to pass as
<2 x float> instead of double.  This works but can't be turned
on until I teach codegen to pass <2 x float> as one XMM register
instead of two.

llvm-svn: 109790
2010-07-29 18:39:32 +00:00