Commit Graph

10858 Commits

Author SHA1 Message Date
Daniel Dunbar c7a67b7877 Driver: When linking, don't warn about unused arguments which are obviously only
used during compilation.
 - There is no easy way to define this group properly, unfortunately, and maybe
   this is a losing strategy. For now this is unambiguous more friendly, though.

llvm-svn: 91940
2009-12-22 23:19:32 +00:00
Chris Lattner 801fda871b implement -W[no-]fatal-errors, patch by Christian Adåker!
llvm-svn: 91938
2009-12-22 23:12:53 +00:00
Douglas Gregor 19fc0b753a Make sure that reinterpret_cast gets a CastKind on all successful
paths. Fixes "cannot compile this unexpected cast lvalue yet" error in
llvm/lib/Analysis/IPA/GlobalsModRef.cpp.

llvm-svn: 91932
2009-12-22 22:47:22 +00:00
John McCall a1d8550778 Add using shadow decls to the "instantiated locals" map, fixing PR5847.
llvm-svn: 91928
2009-12-22 22:26:37 +00:00
Douglas Gregor b6ea60872d Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence
llvm-svn: 91927
2009-12-22 22:17:25 +00:00
Ted Kremenek e19711d223 Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.
llvm-svn: 91926
2009-12-22 22:13:46 +00:00
Daniel Dunbar 42fe663e3b ARM: Remove a FIXME, it's not actually more complicated than that.
llvm-svn: 91924
2009-12-22 21:59:17 +00:00
Douglas Gregor 0a70c4d9a2 Switch parameter passing for overloaded binary operators to
InitializationSequence. Fixes the -fsyntax-only failure in
llvm/lib/Transforms/Scalar/InstructionCombining.cpp.

llvm-svn: 91921
2009-12-22 21:44:34 +00:00
Douglas Gregor dc72875d25 Serialize the NoReturn bit on FunctionTypes for precompiled headers
llvm-svn: 91911
2009-12-22 18:11:50 +00:00
Douglas Gregor 613bf10470 Enter the scope of an initializer for direct-initialization as well as
for copy-initialization.

llvm-svn: 91909
2009-12-22 17:47:17 +00:00
Douglas Gregor 2e9c795df0 When transforming a C++ "new" expression that was not explicitly given
a size, check whether the transformed type is itself an array type. If
so, take the major array bound as the size to allocate. Fixes PR5833.

llvm-svn: 91907
2009-12-22 17:13:37 +00:00
Douglas Gregor bbeb5c391c Switch parameter-passing for calls via function pointers (where we
don't have a FunctionDecl) over to InitializationSequence.

llvm-svn: 91906
2009-12-22 16:09:06 +00:00
Douglas Gregor 1b3039344b Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs
llvm-svn: 91905
2009-12-22 15:35:07 +00:00
Ken Dyck 8c89d59c82 Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
avoid #including CharUnits.h in ASTContext.h.

llvm-svn: 91903
2009-12-22 14:23:30 +00:00
Douglas Gregor 96596c98fb Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

  - Make sure to use the adjusted parameter type for initialization of
  function parameters.
  - Implement transparent union calling semantics in C

llvm-svn: 91902
2009-12-22 07:24:36 +00:00
Anders Carlsson 8a35c7982c Make sure that we mangle overloaded operators that are member functions correctly, giving them the correct arity.
With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being).

llvm-svn: 91893
2009-12-22 06:36:32 +00:00
Anders Carlsson 3caa2b486d Work around PR5514.
llvm-svn: 91891
2009-12-22 06:13:42 +00:00
Chris Lattner d806cbc98d fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
who prefers to be stealthy and mysterious.

llvm-svn: 91888
2009-12-22 06:00:13 +00:00
Anders Carlsson 9c45ad7a1b When we simply return a retained member expression when instantiating, we must also mark the member decl as referenced.
llvm-svn: 91887
2009-12-22 05:24:09 +00:00
Eli Friedman e2808379b8 Zap CheckInitializerTypes.
llvm-svn: 91884
2009-12-22 02:50:30 +00:00
Eli Friedman 5f101b95c6 Switch default arguments over to InitializationSequence.
llvm-svn: 91883
2009-12-22 02:46:13 +00:00
Eli Friedman a553d4ac95 Switch compound literals over to InitializationSequence.
llvm-svn: 91882
2009-12-22 02:35:53 +00:00
Eli Friedman 463e523ad8 Switch file-scope assignment initialization over to InitializationSequence.
llvm-svn: 91881
2009-12-22 02:10:53 +00:00
Daniel Dunbar 3780f0b680 x86_64: Structures with no fields but which have padding should be classified as
integer.
 - This is consistent, but may not be correct. I will revisit x86_64 ABI handling for C++ as a whole at some point.
 - PR5831.

llvm-svn: 91874
2009-12-22 01:19:25 +00:00
Douglas Gregor da8cdbce35 Centralize the emission/suppression/delay of diagnostics describing runtime before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.
llvm-svn: 91870
2009-12-22 01:01:55 +00:00
John McCall 463e10cbd5 Stop diagnosing the use of inner classes as friends. ddunbar asked whether
this was useful, and on review Doug and I decided it was probably on the level
of a bug in the standard and therefore not worth a warning even in -pedantic.
If someone disagrees and urgently wants clang++ to warn about this in strict
c++98 mode, we can talk about it.

llvm-svn: 91868
2009-12-22 00:59:39 +00:00
Fariborz Jahanian 8120346c57 Template code for rewrite of __block variables - wip.
llvm-svn: 91865
2009-12-22 00:48:54 +00:00
Douglas Gregor 507eb87f05 Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl
llvm-svn: 91862
2009-12-22 00:34:07 +00:00
Douglas Gregor 4141d5bea2 When converting from a type to itself or one of its base classes via a
constructor call, the conversion is only a standard conversion
sequence if that constructor is a copy constructor. This fixes PR5834
in a semi-lame way, because the "real" fix will be to move over to
InitializationSequence. That will happen "soonish", but not now.

llvm-svn: 91861
2009-12-22 00:21:20 +00:00
Douglas Gregor 2bb0765bb4 When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.

llvm-svn: 91858
2009-12-22 00:05:34 +00:00
Fariborz Jahanian e175eeb117 Providing support for rewriting of block copy/dispose of
imported block variables. WIP.

llvm-svn: 91856
2009-12-21 23:31:42 +00:00
Daniel Dunbar 0def3d17cb ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

llvm-svn: 91855
2009-12-21 23:28:17 +00:00
Douglas Gregor 8364e6b568 When a template-id refers to a single function template, and the
explicitly-specified template arguments are enough to determine the
instantiation, and either template argument deduction fails or is not
performed in that context, we can resolve the template-id down to a
function template specialization (so sayeth C++0x
[temp.arg.explicit]p3). Fixes PR5811.

llvm-svn: 91852
2009-12-21 23:17:24 +00:00
Douglas Gregor 3985791d62 Introduce an assertion to ensure that template argument deduction does
not deduce an "overload" type. Such a deduction indicates a failure in
semantic analysis  (e.g., PR5811) that currently isn't caught until
code-generation time. This assertions makes it clearer that this
particular issue is a semantic-analysis problem, not a code-gen problem.

llvm-svn: 91844
2009-12-21 21:27:38 +00:00
Douglas Gregor 0f139a1df1 Improve on my previous fix for debug information. Rather than
recursing in CGDebugInfo::CreateTypeNode, teach
CanonicalizeTypeForDebugInfo---now called UnwrapTypeForDebugInfo---to
keep unwrapping the type until we hit something that can be
represented by debug information. Thanks to Anders for pointing this out!

llvm-svn: 91840
2009-12-21 20:18:30 +00:00
Douglas Gregor 0915b43ac2 Teach debug info generation to handle TemplateSpecializationType,
ElaboratedType, QualifiedNameType, and SubstTemplateTypeParmType type
nodes. Also, produce an "unsupported" diagnostic for C++0x type nodes
and "typeof" nodes, rather than asserting nondescriptly.

llvm-svn: 91837
2009-12-21 19:57:21 +00:00
Daniel Dunbar 083edf70a5 Add ToolChain::getDriver() and use it instead of going through the HostInfo
object.

llvm-svn: 91830
2009-12-21 18:54:17 +00:00
Fariborz Jahanian ffc420cb51 Allow comparison of 'void *' with function pointer
as a g++ extension (fixes radar 7481987).

llvm-svn: 91827
2009-12-21 18:19:17 +00:00
John McCall b5a0d316dc Reorganize the base-lookup bits of ActOnMemInitializer in order to better
support diagnostics and error recovery.

llvm-svn: 91825
2009-12-21 10:41:20 +00:00
Zhongxing Xu fd62a33616 Add comments.
llvm-svn: 91818
2009-12-21 06:52:24 +00:00
Eli Friedman 9025ec2ee5 Fix for PR5840: fix the kind of name lookup used for classes in
Sema::getTypeName.

"LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though; 
it doesn't ignore namespaces.  Someone more familiar with the lookup code
should fix this properly.

llvm-svn: 91809
2009-12-21 01:42:38 +00:00
Eli Friedman a26001bf96 Small comment fix.
llvm-svn: 91808
2009-12-21 01:26:45 +00:00
Chris Lattner 3a6af3de6c indentation fix
llvm-svn: 91807
2009-12-21 01:10:56 +00:00
Anders Carlsson 2b7f444366 Incomplete structs should also have internal linkage.
llvm-svn: 91805
2009-12-21 00:41:42 +00:00
Anders Carlsson 18e6ee1b20 Correcly handle pointers to member pointer types where the class or the pointee is incomplete.
llvm-svn: 91804
2009-12-20 23:37:55 +00:00
Nuno Lopes 518e370719 fix PR4010: add support for the warn_unused_result for function pointers
llvm-svn: 91803
2009-12-20 23:11:08 +00:00
Chris Lattner 1576850a76 fix PR5500: clang fails to parse inline asm with :: in C++ mode
llvm-svn: 91802
2009-12-20 23:08:04 +00:00
Chris Lattner bf5fff5fbb refactor asm stmt parsing to avoid nesting as much, and
pull ':' eating out of ParseAsmOperandsOpt.

llvm-svn: 91801
2009-12-20 23:00:41 +00:00
Anders Carlsson d008129f34 Rework the way pointer types are handled by the RTTI builder. We now get the right linkage for indirect pointers to incomplete structs.
llvm-svn: 91799
2009-12-20 22:30:54 +00:00
Eli Friedman 7dac3712a2 Make sure we instantiate the destructor for variables initialized by
assignment.

llvm-svn: 91798
2009-12-20 22:29:11 +00:00