]> granicus.if.org Git - clang/log
clang
14 years agoInitial checkin of CIndex Python bindings, by Andrew Sutton!
Daniel Dunbar [Sun, 24 Jan 2010 02:02:07 +0000 (02:02 +0000)]
Initial checkin of CIndex Python bindings, by Andrew Sutton!
 - Some tweaks by me for API changes, Darwin, and x86_64 support. Still needs
   substantial updating to match recent CIndex API changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94349 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR6034, a crash on invalid where the switch stack would get
Chris Lattner [Sun, 24 Jan 2010 01:50:29 +0000 (01:50 +0000)]
fix PR6034, a crash on invalid where the switch stack would get
unbalanced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94347 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a prototype for __builtin_fpclassify. We don't know how to
Chris Lattner [Sun, 24 Jan 2010 01:30:04 +0000 (01:30 +0000)]
add a prototype for __builtin_fpclassify.  We don't know how to
codegen it, so we get 'cannot compile this builtin function yet'
errors, just like we do currently for __builtin_isinf.  However,
this should let us parse headers that use it without barfing,
which should help PR6083.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94346 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodisable this test, it is failing sporadically.
Chris Lattner [Sun, 24 Jan 2010 00:30:31 +0000 (00:30 +0000)]
disable this test, it is failing sporadically.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94344 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a nasty bug where temporaries weren't marked as being conditional in some cases.
Anders Carlsson [Sun, 24 Jan 2010 00:20:05 +0000 (00:20 +0000)]
Fix a nasty bug where temporaries weren't marked as being conditional in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94341 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse new initialization code when dealing with [dcl.init.aggr]p12. This fixes the...
Anders Carlsson [Sun, 24 Jan 2010 00:19:41 +0000 (00:19 +0000)]
Use new initialization code when dealing with [dcl.init.aggr]p12. This fixes the bug where array elements and member initializers weren't copied correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94340 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange all InitializedEntity pointers over to be references.
Anders Carlsson [Sat, 23 Jan 2010 23:23:01 +0000 (23:23 +0000)]
Change all InitializedEntity pointers over to be references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94335 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart passing InitializedEntity to CheckDesignatedInitializer.
Anders Carlsson [Sat, 23 Jan 2010 22:49:02 +0000 (22:49 +0000)]
Start passing InitializedEntity to CheckDesignatedInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94334 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPreserve access for enum constants during template instantiation.
John McCall [Sat, 23 Jan 2010 22:37:59 +0000 (22:37 +0000)]
Preserve access for enum constants during template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94333 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore init work, adding more entity parameters.
Anders Carlsson [Sat, 23 Jan 2010 20:47:59 +0000 (20:47 +0000)]
More init work, adding more entity parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94332 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTemporary flip default for -Wunreachable-code so some bots can test it
Mike Stump [Sat, 23 Jan 2010 20:23:40 +0000 (20:23 +0000)]
Temporary flip default for -Wunreachable-code so some bots can test it
out.  They should all be done later tonight, but if something bad
happens, feel free to revert sooner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94330 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse the new init code for member subobjects.
Anders Carlsson [Sat, 23 Jan 2010 20:20:40 +0000 (20:20 +0000)]
Use the new init code for member subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94329 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch some array initialization over to the new init code.
Anders Carlsson [Sat, 23 Jan 2010 20:13:41 +0000 (20:13 +0000)]
Switch some array initialization over to the new init code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94327 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInsulate these from changes to the default for -Wunreachable-code.
Mike Stump [Sat, 23 Jan 2010 20:12:18 +0000 (20:12 +0000)]
Insulate these from changes to the default for -Wunreachable-code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94326 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBaby steps towards migrating the InitListChecker over to the new initialization code...
Anders Carlsson [Sat, 23 Jan 2010 19:55:29 +0000 (19:55 +0000)]
Baby steps towards migrating the InitListChecker over to the new initialization code. Pass an InitializedEntity pointer through to most init checker functions. Right now, it's ignored everywhere except when initializing vectors in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94325 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen an InitializedEntity is passed to CheckSingleInitializer, call the new Sema...
Anders Carlsson [Sat, 23 Jan 2010 19:22:30 +0000 (19:22 +0000)]
When an InitializedEntity is passed to CheckSingleInitializer, call the new Sema::PerformCopyInitialization overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94324 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd bzero builtin; this should help codegen quality for code using this
Eli Friedman [Sat, 23 Jan 2010 19:00:10 +0000 (19:00 +0000)]
Add bzero builtin; this should help codegen quality for code using this
function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94320 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange CheckSingleInitializer to take/return OwningExprResults instead. No functional...
Anders Carlsson [Sat, 23 Jan 2010 18:35:41 +0000 (18:35 +0000)]
Change CheckSingleInitializer to take/return OwningExprResults instead. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94316 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo.
Anders Carlsson [Sat, 23 Jan 2010 18:26:49 +0000 (18:26 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94315 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify code with StringRef.
Benjamin Kramer [Sat, 23 Jan 2010 18:16:35 +0000 (18:16 +0000)]
Simplify code with StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94314 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNo need to terminate this buffer.
Benjamin Kramer [Sat, 23 Jan 2010 18:16:07 +0000 (18:16 +0000)]
No need to terminate this buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94313 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd doxygen comment to clang_getClangVersion().
Ted Kremenek [Sat, 23 Jan 2010 17:51:23 +0000 (17:51 +0000)]
Add doxygen comment to clang_getClangVersion().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94311 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdjust testcase for recent AsmPrinter changes, sigh.
Benjamin Kramer [Sat, 23 Jan 2010 10:15:32 +0000 (10:15 +0000)]
Adjust testcase for recent AsmPrinter changes, sigh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94307 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdjust testcase for recent DWARF printer changes.
Benjamin Kramer [Sat, 23 Jan 2010 10:14:58 +0000 (10:14 +0000)]
Adjust testcase for recent DWARF printer changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94306 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProduce a special diagnostic when users call a function with an argument of
John McCall [Sat, 23 Jan 2010 08:10:49 +0000 (08:10 +0000)]
Produce a special diagnostic when users call a function with an argument of
incomplete type (or a pointer/reference to such).

The causes of this problem are different enough to justify a different "design"
for the diagnostic.  Most notably, it doesn't give an operand index:
it's usually pretty obvious which operand is the problem, it adds a lot of
clutter to mention it, and the fix is usually in a different part of the file
anyway.

This is yet another diagnostic that should really have an analogue in the
non-overloaded case --- which should be much easier to write because of
the weaker space constraints.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94303 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix the EntityKind order so that all entity kinds that can be copied (using copy...
Anders Carlsson [Sat, 23 Jan 2010 05:47:27 +0000 (05:47 +0000)]
Fix the EntityKind order so that all entity kinds that can be copied (using copy constructors) come first. Also, fix a bug where EK_New was left out of the err_init_conversion_failed diagnostic (It is now reported as 'new value'). Please review Doug :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94289 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDuring overload resolution diagnostics, sort non-viable candidates by the quality...
John McCall [Sat, 23 Jan 2010 05:17:32 +0000 (05:17 +0000)]
During overload resolution diagnostics, sort non-viable candidates by the quality of their
conversions.  To make this work, fill out all conversions for all candidates
(but only when diagnosing overload failure).  Split out a few cases from
ovl_fail_bad_conversion which didn't actually involve a failed argument
conversion.

I'm pretty sure this is not a well-founded ordering, but I'm not sure it matters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94283 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSeparate EK_ArrayOrVectorElement into EK_ArrayElement and EK_VectorElement; arrays...
Anders Carlsson [Sat, 23 Jan 2010 04:34:47 +0000 (04:34 +0000)]
Separate EK_ArrayOrVectorElement into EK_ArrayElement and EK_VectorElement; arrays and vectors are pretty different beasts in C++. Doug, please review/comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94279 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCreated __builtin___NSStringMakeConstantString() builtin, which generates constant...
David Chisnall [Sat, 23 Jan 2010 02:40:42 +0000 (02:40 +0000)]
Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94274 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename getClangFullVendorVersion() to getClangFullVersion().
Ted Kremenek [Sat, 23 Jan 2010 02:11:34 +0000 (02:11 +0000)]
Rename getClangFullVendorVersion() to getClangFullVersion().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94273 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement elementary access control.
John McCall [Sat, 23 Jan 2010 00:46:32 +0000 (00:46 +0000)]
Implement elementary access control.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94268 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the cursor visitor to recurse into the type information of
Douglas Gregor [Sat, 23 Jan 2010 00:40:08 +0000 (00:40 +0000)]
Teach the cursor visitor to recurse into the type information of
explicit casts, sizeof, alignof, and compound literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94265 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
Daniel Dunbar [Sat, 23 Jan 2010 00:26:38 +0000 (00:26 +0000)]
Extern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
{thumb,no-thumb}).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94264 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a FIXME, this test folds to a constant now.
Daniel Dunbar [Sat, 23 Jan 2010 00:26:29 +0000 (00:26 +0000)]
Fix a FIXME, this test folds to a constant now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94263 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtend clang_createTranslationUnitFromSourceFile() to support creating
Douglas Gregor [Sat, 23 Jan 2010 00:14:00 +0000 (00:14 +0000)]
Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94258 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agooutside a method, 'super' should resolve in a normal name look up
Fariborz Jahanian [Fri, 22 Jan 2010 23:04:44 +0000 (23:04 +0000)]
outside a method, 'super' should resolve in a normal name look up
to mimic gcc's behavior. Fixes radar 7400691.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94246 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 'clang_getClangVersion()' function to CIndex. This exposes the full Clang versio...
Ted Kremenek [Fri, 22 Jan 2010 22:44:15 +0000 (22:44 +0000)]
Add 'clang_getClangVersion()' function to CIndex.  This exposes the full Clang version string through the CIndex API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94242 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixup the rest of the testcases to grep the .ll file instead of the .s
Mike Stump [Fri, 22 Jan 2010 22:37:17 +0000 (22:37 +0000)]
Fixup the rest of the testcases to grep the .ll file instead of the .s
file, and add FIXMEs to the remaining broken tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94238 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes test.
Fariborz Jahanian [Fri, 22 Jan 2010 22:30:25 +0000 (22:30 +0000)]
Fixes test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94236 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getCl...
Ted Kremenek [Fri, 22 Jan 2010 22:29:50 +0000 (22:29 +0000)]
Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94235 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove content and structure of the Doxygen documentation for the
Douglas Gregor [Fri, 22 Jan 2010 22:29:16 +0000 (22:29 +0000)]
Improve content and structure of the Doxygen documentation for the
CIndex API. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94234 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago(1) Rename getClangSubversionRevision() to getClangRevision(), and
Ted Kremenek [Fri, 22 Jan 2010 22:12:47 +0000 (22:12 +0000)]
(1) Rename getClangSubversionRevision() to getClangRevision(), and
    have it return a StringRef instead of an integer (to be more VCS
    agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
    amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
    getClangFullRepositoryVersion() instead of also emitting the value
    of getClangSubversionRevision() (which has been removed).  This is
    functionally equivalent.

More cleanup to version string generation pending...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94231 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConvert more testcases to checking the .ll file instead of the .s file.
Mike Stump [Fri, 22 Jan 2010 22:06:55 +0000 (22:06 +0000)]
Convert more testcases to checking the .ll file instead of the .s file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94229 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoYet more CIndex API cleanup:
Douglas Gregor [Fri, 22 Jan 2010 21:44:22 +0000 (21:44 +0000)]
Yet more CIndex API cleanup:
  - Added more routines to manipulate/compare source locations and ranges
  - Switched clang_getCursor() over to take a CXSourceLocation rather
  than file/line/column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94226 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoui64, etc. are valid VS suffixes.
Fariborz Jahanian [Fri, 22 Jan 2010 21:36:53 +0000 (21:36 +0000)]
ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94224 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.
Ted Kremenek [Fri, 22 Jan 2010 20:59:36 +0000 (20:59 +0000)]
Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94214 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename getClangSubversionPath() -> getClangRepositoryPath() and have it return a...
Ted Kremenek [Fri, 22 Jan 2010 20:55:35 +0000 (20:55 +0000)]
Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94213 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate index-test; all of its tested functionality is now in c-index-test.
Douglas Gregor [Fri, 22 Jan 2010 20:40:20 +0000 (20:40 +0000)]
Eliminate index-test; all of its tested functionality is now in c-index-test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94211 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate CIndex's dependency on the Clang Index library, since we
Douglas Gregor [Fri, 22 Jan 2010 20:35:53 +0000 (20:35 +0000)]
Eliminate CIndex's dependency on the Clang Index library, since we
weren't actually using any of its facilities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94210 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBe sure to select primary bases among the nearly empties in preorder,
Mike Stump [Fri, 22 Jan 2010 20:27:17 +0000 (20:27 +0000)]
Be sure to select primary bases among the nearly empties in preorder,
not just among the direct bases.  Before we where missing nearly
empties that were bases of virtual base classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94208 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach CIndex's cursor visitor to restrict its traversal to a specific
Douglas Gregor [Fri, 22 Jan 2010 19:49:59 +0000 (19:49 +0000)]
Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
  - Extend Preprocessor::getLocForEndOfToken() to accept an offset
  from the end, making it easy to move to the last character in the
  token (rather than just past the end of the token).
  - In Lexer::MeasureTokenLength(), the length of whitespace is zero.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94200 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFinish off fixing up debug information.
Mike Stump [Fri, 22 Jan 2010 18:48:47 +0000 (18:48 +0000)]
Finish off fixing up debug information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94193 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPatch fixes a lookup bug in c++'s anonymous union member
Fariborz Jahanian [Fri, 22 Jan 2010 18:30:17 +0000 (18:30 +0000)]
Patch fixes a lookup bug in c++'s anonymous union member
lookup. Fixes radar 7562438.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94191 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoNo need to canonicalize the type and use dyn_cast. Also, correctly diagnose trying...
Anders Carlsson [Fri, 22 Jan 2010 17:37:20 +0000 (17:37 +0000)]
No need to canonicalize the type and use dyn_cast. Also, correctly diagnose trying to override a function returning an lvalue reference with a function overriding an rvalue reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94183 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate some Clang warnings
Douglas Gregor [Fri, 22 Jan 2010 15:41:14 +0000 (15:41 +0000)]
Eliminate some Clang warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94177 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify code.
Benjamin Kramer [Fri, 22 Jan 2010 13:59:13 +0000 (13:59 +0000)]
Simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94175 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix an obvious goof that caused us to only see the top level of return types
Chandler Carruth [Fri, 22 Jan 2010 13:07:41 +0000 (13:07 +0000)]
Fix an obvious goof that caused us to only see the top level of return types
when checking for covariance. Added some fun test cases, fixes PR6110.

This felt obvious enough to just commit. ;] Let me know if anything needs
tweaking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94173 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnsure we output all non-virtual base vtables. Fixes PR5890.
Mike Stump [Fri, 22 Jan 2010 06:45:05 +0000 (06:45 +0000)]
Ensure we output all non-virtual base vtables.  Fixes PR5890.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94163 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProcess cast according to the cast kind. Prepare for more specific cast
Zhongxing Xu [Fri, 22 Jan 2010 04:30:00 +0000 (04:30 +0000)]
Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94153 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin: Update tool chain to use static clang_rt libraries provided by
Daniel Dunbar [Fri, 22 Jan 2010 03:38:14 +0000 (03:38 +0000)]
Driver/Darwin: Update tool chain to use static clang_rt libraries provided by
compiler-rt. This tool chain now works on x86 and ARM, but isn't the x86 default
yet.

This drastically cleans up the linker invocation, old invocation:
--
"/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "t.o" "-lSystem" "-lgcc"
--

New invocation:
--
# For 10.6:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-o" "a.out" "-lcrt1.10.6.o" "t.o" "-lSystem"
# For 10.4:
 "/usr/bin/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.4" "-o" "a.out" "-lcrt1.o" "t.o" "-lSystem" "-lgcc_s.10.4" "/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib/clang/1.1/lib/darwin/libclang_rt.10.4.a"
--

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94150 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
Daniel Dunbar [Fri, 22 Jan 2010 03:37:33 +0000 (03:37 +0000)]
Driver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
not always added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94149 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate debugging code.
Mike Stump [Fri, 22 Jan 2010 02:51:26 +0000 (02:51 +0000)]
Update debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94145 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
Daniel Dunbar [Fri, 22 Jan 2010 02:04:58 +0000 (02:04 +0000)]
Driver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
name being used in an driver invocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94139 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
Daniel Dunbar [Fri, 22 Jan 2010 02:04:52 +0000 (02:04 +0000)]
Driver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
diverge from gcc anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94138 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a Coding Standards section to hacking.html, and point out that cstdio is forbidden.
Daniel Dunbar [Fri, 22 Jan 2010 02:04:46 +0000 (02:04 +0000)]
Add a Coding Standards section to hacking.html, and point out that cstdio is forbidden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94137 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse raw_ostream instead of cstdio.
Daniel Dunbar [Fri, 22 Jan 2010 02:04:41 +0000 (02:04 +0000)]
Use raw_ostream instead of cstdio.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94136 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoVisit if, switch statements properly
Douglas Gregor [Fri, 22 Jan 2010 01:00:11 +0000 (01:00 +0000)]
Visit if, switch statements properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94126 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the cursor visitor to walk all of the C and Objective-C
Douglas Gregor [Fri, 22 Jan 2010 00:50:27 +0000 (00:50 +0000)]
Teach the cursor visitor to walk all of the C and Objective-C
declarations that have enough source information to make such a walk
useful. This includes walking into variable initializers and enum
constants, the types behind typedefs, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94124 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCreate function, block, and template parameters in the context of the
John McCall [Fri, 22 Jan 2010 00:28:27 +0000 (00:28 +0000)]
Create function, block, and template parameters in the context of the
translation unit.  This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts.  This gives us the nice property that everything created
in a record DC should have access in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorevert my patch for rdar://7520940 that warns when a published header
Chris Lattner [Fri, 22 Jan 2010 00:14:44 +0000 (00:14 +0000)]
revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94120 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWire up the new range reporting for unreachable code.
Mike Stump [Thu, 21 Jan 2010 23:49:01 +0000 (23:49 +0000)]
Wire up the new range reporting for unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94118 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the cursor visitor to walk statements and expressions, including
Douglas Gregor [Thu, 21 Jan 2010 23:27:09 +0000 (23:27 +0000)]
Teach the cursor visitor to walk statements and expressions, including
a few important subkinds. Now we're cookin' with gas!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94116 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings with respect to dead member and
Mike Stump [Thu, 21 Jan 2010 23:15:53 +0000 (23:15 +0000)]
Improve unreachable code warnings with respect to dead member and
dead array references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94115 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDue to local reversions and re-patching, I accidentally had multiple copies
John McCall [Thu, 21 Jan 2010 22:59:41 +0000 (22:59 +0000)]
Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94109 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings for with respect to dead functional casts in C++.
Mike Stump [Thu, 21 Jan 2010 22:12:18 +0000 (22:12 +0000)]
Improve unreachable code warnings for with respect to dead functional casts in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94106 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the cursor visitor to walk into typeof types (both kinds). This
Douglas Gregor [Thu, 21 Jan 2010 20:48:56 +0000 (20:48 +0000)]
Teach the cursor visitor to walk into typeof types (both kinds). This
is hard to test now; tests will come when we can walk stataements and
expressions properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94099 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings for with respect to c-style casts.
Mike Stump [Thu, 21 Jan 2010 19:51:34 +0000 (19:51 +0000)]
Improve unreachable code warnings for with respect to c-style casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94094 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings for with respect to ? :.
Mike Stump [Thu, 21 Jan 2010 19:44:04 +0000 (19:44 +0000)]
Improve unreachable code warnings for with respect to ? :.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94093 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAllocate the 'Protocols' array in ObjCInterfaceType and
Ted Kremenek [Thu, 21 Jan 2010 19:22:34 +0000 (19:22 +0000)]
Allocate the 'Protocols' array in ObjCInterfaceType and
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94090 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r94073, it fails in Release-Asserts builds.
Benjamin Kramer [Thu, 21 Jan 2010 18:14:21 +0000 (18:14 +0000)]
Revert r94073, it fails in Release-Asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94089 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a comment.
Fariborz Jahanian [Thu, 21 Jan 2010 17:39:43 +0000 (17:39 +0000)]
Fixes a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94088 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPatch to implement rewriting of properties.
Fariborz Jahanian [Thu, 21 Jan 2010 17:36:00 +0000 (17:36 +0000)]
Patch to implement rewriting of properties.
Fixes radar 7562952.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings for with respect to compound
Mike Stump [Thu, 21 Jan 2010 17:31:41 +0000 (17:31 +0000)]
Improve unreachable code warnings for with respect to compound
assignments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94086 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the cursor visitor to walk into a variety of different TypeLoc
Douglas Gregor [Thu, 21 Jan 2010 17:29:07 +0000 (17:29 +0000)]
Teach the cursor visitor to walk into a variety of different TypeLoc
kinds, so that we see referenced types, protocols, classes, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94085 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImprove unreachable code warnings with respect to dead binary and
Mike Stump [Thu, 21 Jan 2010 17:21:23 +0000 (17:21 +0000)]
Improve unreachable code warnings with respect to dead binary and
unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a test for clang_rt support on Darwin. With appropriate massaging, this
Daniel Dunbar [Thu, 21 Jan 2010 17:10:39 +0000 (17:10 +0000)]
Add a test for clang_rt support on Darwin. With appropriate massaging, this
checks that the runtime library can be linked and works for compiling on 10.6
for 10.{4,5,6} targets. Currently test is only for x86, and misses some
compiler-rt functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94083 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak OptionalTests paths.
Daniel Dunbar [Thu, 21 Jan 2010 17:09:39 +0000 (17:09 +0000)]
Tweak OptionalTests paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94082 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate to use llvm/utils/GetSourceVersion to detect version number, instead of
Daniel Dunbar [Thu, 21 Jan 2010 16:56:47 +0000 (16:56 +0000)]
Update to use llvm/utils/GetSourceVersion to detect version number, instead of
assuming SVN. This should be fixed to not necessarily be an integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94081 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd utils/OptionalTests, a dumping ground for additional (lit) tests which for
Daniel Dunbar [Thu, 21 Jan 2010 16:55:39 +0000 (16:55 +0000)]
Add utils/OptionalTests, a dumping ground for additional (lit) tests which for
one reason or another don't belong in the regular test suite.

Inside is utils/OptionalTests/Extra which is specifically for tests that match
the layout of the regular tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94080 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove the VTT related code into its own file, CGVTT.cpp
Anders Carlsson [Thu, 21 Jan 2010 16:50:45 +0000 (16:50 +0000)]
Move the VTT related code into its own file, CGVTT.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94079 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce type references into the C API, capturing references to
Douglas Gregor [Thu, 21 Jan 2010 16:28:34 +0000 (16:28 +0000)]
Introduce type references into the C API, capturing references to
typedefs only (for now).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94078 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach code-completion to deal with calls to functions without prototypes.
Douglas Gregor [Thu, 21 Jan 2010 15:46:19 +0000 (15:46 +0000)]
Teach code-completion to deal with calls to functions without prototypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94076 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSpeed up compilation by avoiding generating exceptional edges from
Mike Stump [Thu, 21 Jan 2010 15:20:48 +0000 (15:20 +0000)]
Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls.  Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges.  All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMatch branch labels with the trailing colon so we don't accidentally match something...
Benjamin Kramer [Thu, 21 Jan 2010 15:19:14 +0000 (15:19 +0000)]
Match branch labels with the trailing colon so we don't accidentally match something else.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94073 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove some recent checking code into SemaChecking instead.
Mike Stump [Thu, 21 Jan 2010 03:59:47 +0000 (03:59 +0000)]
Move some recent checking code into SemaChecking instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94067 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid instantiating std::sort to save on compiler size.
Mike Stump [Thu, 21 Jan 2010 03:43:13 +0000 (03:43 +0000)]
Avoid instantiating std::sort to save on compiler size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94065 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen checking for unreachable code, we can trivially avoid checking
Mike Stump [Thu, 21 Jan 2010 03:07:51 +0000 (03:07 +0000)]
When checking for unreachable code, we can trivially avoid checking
for unreachable loops if all the blocks are already marked live by
this point.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94064 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen checking for unreachable blocks, we can trivially avoid extra
Mike Stump [Thu, 21 Jan 2010 02:55:37 +0000 (02:55 +0000)]
When checking for unreachable blocks, we can trivially avoid extra
work, if we know we already marked all blocks as live.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94063 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd infrastructure to add base initializers and member initializers to
Mike Stump [Thu, 21 Jan 2010 02:21:40 +0000 (02:21 +0000)]
Add infrastructure to add base initializers and member initializers to
the CFG.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes comments.
Fariborz Jahanian [Thu, 21 Jan 2010 00:08:17 +0000 (00:08 +0000)]
Fixes comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94053 91177308-0d34-0410-b5e6-96231b3b80d8