Commit Graph

19862 Commits

Author SHA1 Message Date
David Chisnall 481e3a87fe Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.
llvm-svn: 94274
2010-01-23 02:40:42 +00:00
Ted Kremenek 4c0df3dc1d Rename getClangFullVendorVersion() to getClangFullVersion().
llvm-svn: 94273
2010-01-23 02:11:34 +00:00
John McCall 553c0796ee Implement elementary access control.
llvm-svn: 94268
2010-01-23 00:46:32 +00:00
Douglas Gregor 625a515120 Teach the cursor visitor to recurse into the type information of
explicit casts, sizeof, alignof, and compound literals.

llvm-svn: 94265
2010-01-23 00:40:08 +00:00
Daniel Dunbar 4c823ba358 Extern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
{thumb,no-thumb}).

llvm-svn: 94264
2010-01-23 00:26:38 +00:00
Daniel Dunbar c766b8a1f4 Fix a FIXME, this test folds to a constant now.
llvm-svn: 94263
2010-01-23 00:26:29 +00:00
Douglas Gregor aa98ed9a07 Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.

llvm-svn: 94258
2010-01-23 00:14:00 +00:00
Fariborz Jahanian 935f041243 outside a method, 'super' should resolve in a normal name look up
to mimic gcc's behavior. Fixes radar 7400691.

llvm-svn: 94246
2010-01-22 23:04:44 +00:00
Ted Kremenek c0f3f72fa4 Add 'clang_getClangVersion()' function to CIndex. This exposes the full Clang version string through the CIndex API.
llvm-svn: 94242
2010-01-22 22:44:15 +00:00
Mike Stump 1891698a9b Fixup the rest of the testcases to grep the .ll file instead of the .s
file, and add FIXMEs to the remaining broken tests.

llvm-svn: 94238
2010-01-22 22:37:17 +00:00
Fariborz Jahanian 60794cfa27 Fixes test.
llvm-svn: 94236
2010-01-22 22:30:25 +00:00
Ted Kremenek 51b8bc93f8 Move version string generation (e.g., "clang 1.1 ...") to libBasic/Version.cpp, getClangFullVendorVersion().
llvm-svn: 94235
2010-01-22 22:29:50 +00:00
Douglas Gregor 6007cf2e9e Improve content and structure of the Doxygen documentation for the
CIndex API. No functionality change.

llvm-svn: 94234
2010-01-22 22:29:16 +00:00
Ted Kremenek 18e066f6a9 (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...

llvm-svn: 94231
2010-01-22 22:12:47 +00:00
Mike Stump 3cd08d9df7 Convert more testcases to checking the .ll file instead of the .s file.
llvm-svn: 94229
2010-01-22 22:06:55 +00:00
Douglas Gregor 816fd36316 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.

llvm-svn: 94226
2010-01-22 21:44:22 +00:00
Fariborz Jahanian 8c6c0b6a1f ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

llvm-svn: 94224
2010-01-22 21:36:53 +00:00
Ted Kremenek 17437130e9 Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.
llvm-svn: 94214
2010-01-22 20:59:36 +00:00
Ted Kremenek 2377a0e0ea Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.
llvm-svn: 94213
2010-01-22 20:55:35 +00:00
Douglas Gregor 9ae8d349e6 Eliminate index-test; all of its tested functionality is now in c-index-test.
llvm-svn: 94211
2010-01-22 20:40:20 +00:00
Douglas Gregor 877524918a Eliminate CIndex's dependency on the Clang Index library, since we
weren't actually using any of its facilities.

llvm-svn: 94210
2010-01-22 20:35:53 +00:00
Mike Stump 0a2754ed8a 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.

llvm-svn: 94208
2010-01-22 20:27:17 +00:00
Douglas Gregor 562c1f9365 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.

llvm-svn: 94200
2010-01-22 19:49:59 +00:00
Mike Stump 1f49d65235 Finish off fixing up debug information.
llvm-svn: 94193
2010-01-22 18:48:47 +00:00
Fariborz Jahanian 53967e2abd Patch fixes a lookup bug in c++'s anonymous union member
lookup. Fixes radar 7562438.

llvm-svn: 94191
2010-01-22 18:30:17 +00:00
Anders Carlsson 7caa4cb87a 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.
llvm-svn: 94183
2010-01-22 17:37:20 +00:00
Douglas Gregor 0599df16a6 Eliminate some Clang warnings
llvm-svn: 94177
2010-01-22 15:41:14 +00:00
Benjamin Kramer d6b28fc6ad Simplify code.
llvm-svn: 94175
2010-01-22 13:59:13 +00:00
Chandler Carruth df7fd5f8d5 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.

llvm-svn: 94173
2010-01-22 13:07:41 +00:00
Mike Stump 9eb76d47f2 Ensure we output all non-virtual base vtables. Fixes PR5890.
llvm-svn: 94163
2010-01-22 06:45:05 +00:00
Zhongxing Xu a1293a67cd Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.

llvm-svn: 94153
2010-01-22 04:30:00 +00:00
Daniel Dunbar 7cde09ac8a 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"
--

llvm-svn: 94150
2010-01-22 03:38:14 +00:00
Daniel Dunbar 93d7acfcf2 Driver/Darwin/ld: Fix refacto, -force_cpusubtype_ALL should only be forwarded,
not always added.

llvm-svn: 94149
2010-01-22 03:37:33 +00:00
Mike Stump d2808449e4 Update debugging code.
llvm-svn: 94145
2010-01-22 02:51:26 +00:00
Daniel Dunbar dcc3b657f2 Driver/Darwin/ld: Factor out getDarwinArchName, for getting the "Darwin" arch
name being used in an driver invocation.

llvm-svn: 94139
2010-01-22 02:04:58 +00:00
Daniel Dunbar a48823fdbe Driver/Darwin/ld: Eliminate AddDarwinSubArch, our linker invocation is going to
diverge from gcc anyway.

llvm-svn: 94138
2010-01-22 02:04:52 +00:00
Daniel Dunbar d6f13c3ff9 Add a Coding Standards section to hacking.html, and point out that cstdio is forbidden.
llvm-svn: 94137
2010-01-22 02:04:46 +00:00
Daniel Dunbar 42e3df065e Use raw_ostream instead of cstdio.
llvm-svn: 94136
2010-01-22 02:04:41 +00:00
Douglas Gregor e1084fa2d2 Visit if, switch statements properly
llvm-svn: 94126
2010-01-22 01:00:11 +00:00
Douglas Gregor d824f8825b 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.

llvm-svn: 94124
2010-01-22 00:50:27 +00:00
John McCall f7b2fb51d1 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++.

llvm-svn: 94122
2010-01-22 00:28:27 +00:00
Chris Lattner fde85356c6 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.

llvm-svn: 94120
2010-01-22 00:14:44 +00:00
Mike Stump 6cbe36fe5a Wire up the new range reporting for unreachable code.
llvm-svn: 94118
2010-01-21 23:49:01 +00:00
Douglas Gregor 5e8cf37917 Teach the cursor visitor to walk statements and expressions, including
a few important subkinds. Now we're cookin' with gas!

llvm-svn: 94116
2010-01-21 23:27:09 +00:00
Mike Stump 60dbeebee8 Improve unreachable code warnings with respect to dead member and
dead array references.

llvm-svn: 94115
2010-01-21 23:15:53 +00:00
John McCall 1848ea4fe3 Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.

llvm-svn: 94109
2010-01-21 22:59:41 +00:00
Mike Stump fcd6f94ba7 Improve unreachable code warnings for with respect to dead functional casts in C++.
llvm-svn: 94106
2010-01-21 22:12:18 +00:00
Douglas Gregor 6479fc4554 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.

llvm-svn: 94099
2010-01-21 20:48:56 +00:00
Mike Stump d12e495f17 Improve unreachable code warnings for with respect to c-style casts.
llvm-svn: 94094
2010-01-21 19:51:34 +00:00
Mike Stump c18c403670 Improve unreachable code warnings for with respect to ? :.
llvm-svn: 94093
2010-01-21 19:44:04 +00:00