Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/clang-lm32
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0a7d3c2ecbbe
Choose a base ref
...
head repository: m-labs/clang-lm32
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 01a9a76ff0b6
Choose a head ref

Commits on Nov 22, 2012

  1. Make helpers static/anonymous.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168500 91177308-0d34-0410-b5e6-96231b3b80d8
    d0k committed Nov 22, 2012
    Copy the full SHA
    4d9f4e5 View commit details

Commits on Nov 23, 2012

  1. Reapply a subset of r167567 to clean up Darwin-specific code for invo…

    …king gcc.
    
    Unlike my previous attempt at this, this patch leaves intact the check for
    whether clang can handle the input file type, and for non-Darwin toolchains it
    will invoke gcc for things it cannot handle. For Darwin toolchains, the
    behavior reported in pr14338 still occurs with this patch, but that is a
    definite improvement from what happens currently, where it just crashes with
    an assertion failure.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168505 91177308-0d34-0410-b5e6-96231b3b80d8
    bob-wilson committed Nov 23, 2012
    Copy the full SHA
    66b8a66 View commit details
  2. PR14306: Move -fbounds-checking to -fsanitize=bounds.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168510 91177308-0d34-0410-b5e6-96231b3b80d8
    jgouly committed Nov 23, 2012
    Copy the full SHA
    8548908 View commit details
  3. Check that we don't warn on this testcase. This is basically a test that

    Decl::isUsed checks the attribute. If the function had a body just the check
    is DeclMustBeEmitted would be sufficient.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168514 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 23, 2012
    Copy the full SHA
    4875bf2 View commit details
  4. Remove redundant check.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168515 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 23, 2012
    Copy the full SHA
    385e1d9 View commit details
  5. Merge used flags so that we don't have to iterate on isUsed. With thi…

    …s change
    
    "clang -cc1 -fsyntax-only" on the preprocessed output of
    
    #define M extern int a;
    #define M2 M M
    #define M4 M2 M2
    #define M8 M4 M4
    #define M16 M8 M8
    #define M32 M16 M16
    #define M64 M32 M32
    #define M128 M64 M64
    #define M256 M128 M128
    #define M512 M256 M256
    #define M1024 M512 M512
    #define M2048 M1024 M1024
    #define M4096 M2048 M2048
    #define M8192 M4096 M4096
    #define M16384 M8192 M8192
    M16384
    
    goes from 2.994s to 1.416s. GCC is at 0.022s, so we still have a long way to go.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168519 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 23, 2012
    Copy the full SHA
    919b7e6 View commit details
  6. Sema: Provide a valid source location when instantiating templates ba…

    …sed on a CXXDefaultArgExpr.
    
    Fixes PR13758.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168521 91177308-0d34-0410-b5e6-96231b3b80d8
    d0k committed Nov 23, 2012
    Copy the full SHA
    63b6ebe View commit details

Commits on Nov 24, 2012

  1. Make err_module_expected_semi consistent with all the other expected_…

    …semi diags.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168535 91177308-0d34-0410-b5e6-96231b3b80d8
    nico committed Nov 24, 2012
    Copy the full SHA
    f9cb0be View commit details
  2. Revert r168519, "Merge used flags so that we don't have to iterate on…

    … isUsed. With this change"
    
    It brought bunch of (possibly false) warnings.
    
    llvm/unittests/VMCore/PassManagerTest.cpp:60:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        char ModuleNDNM::ID=0;
                         ^
    llvm/unittests/VMCore/PassManagerTest.cpp:86:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        char ModuleNDM2::ID=0;
                         ^
    llvm/unittests/VMCore/PassManagerTest.cpp:106:21: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        char ModuleDNM::ID=0;
                        ^
    llvm/unittests/VMCore/PassManagerTest.cpp:217:16: warning: variable 'initcount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        int LPass::initcount=0;
                   ^
    llvm/unittests/VMCore/PassManagerTest.cpp:218:16: warning: variable 'fincount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        int LPass::fincount=0;
                   ^
    llvm/unittests/VMCore/PassManagerTest.cpp:259:16: warning: variable 'inited' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        int BPass::inited=0;
                   ^
    llvm/unittests/VMCore/PassManagerTest.cpp:260:16: warning: variable 'fin' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        int BPass::fin=0;
                   ^
    llvm/unittests/VMCore/PassManagerTest.cpp:283:24: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
        char OnTheFlyTest::ID=0;
                           ^
    8 warnings generated.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168549 91177308-0d34-0410-b5e6-96231b3b80d8
    chapuni committed Nov 24, 2012
    Copy the full SHA
    6df81a9 View commit details

Commits on Nov 25, 2012

  1. Fix test case for linking with sanitizer opts added in r168428.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168562 91177308-0d34-0410-b5e6-96231b3b80d8
    Alexey Samsonov committed Nov 25, 2012
    Copy the full SHA
    1059653 View commit details
  2. Add a basic testcase for the "variable is not needed" warning and one…

    … that
    
    regressed in r168519.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168563 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 25, 2012
    Copy the full SHA
    1c80b52 View commit details
  3. Add r168519 back, but with a fix to also merge the used flag in varia…

    …bles.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168564 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 25, 2012
    Copy the full SHA
    8dbf697 View commit details

Commits on Nov 26, 2012

  1. PR14428: When instantiating a 'new' expression, if we had a non-depen…

    …dent
    
    initialization, don't rebuild it. Remove a couple of hacks which were trying to
    work around this. Fix the special case for one-argument CXXConstructExprs to
    not apply if the one argument is a default argument.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168582 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Nov 26, 2012
    Copy the full SHA
    73ed67c View commit details
  2. Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-ab…

    …i microsoft
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168583 91177308-0d34-0410-b5e6-96231b3b80d8
    timurrrr committed Nov 26, 2012
    Copy the full SHA
    79b7cc5 View commit details
  3. MSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. T…

    …his patch makes Clang reflect this scheme.
    
    Patch by Job Noorman!
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168598 91177308-0d34-0410-b5e6-96231b3b80d8
    asl committed Nov 26, 2012
    Copy the full SHA
    f419a85 View commit details
  4. [analyzer] Fix a crash reported in PR 14400.

    The AllocaRegion did not have the superRegion (based on LocationContext)
    as part of it's hash. As a consequence, the AllocaRegions from
    different frames were uniqued to be the same region.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168599 91177308-0d34-0410-b5e6-96231b3b80d8
    AnnaZaks committed Nov 26, 2012
    Copy the full SHA
    dac6cd5 View commit details
  5. [analyzer] SATestBuild.py: allow make builds to disable parallelization

    Before, SATestBuild unilaterally added '-j<n>' to every project built with
    'make'. Now, we check and see if there's a -j option already specified, which
    allows a project to explicitly be marked '-j1'.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168603 91177308-0d34-0410-b5e6-96231b3b80d8
    jrose-apple committed Nov 26, 2012
    Copy the full SHA
    7bd51ea View commit details
  6. check that always_inline attribute works with -fno-inline

    Clean up the existing test to use FileCheck.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168607 91177308-0d34-0410-b5e6-96231b3b80d8
    Sebastian Pop committed Nov 26, 2012
    Copy the full SHA
    9e4bafc View commit details
  7. Add missing "break". Thanks to Craig for spotting it.

    I'm looking at ways to fix the relevant test so it can catch this sort of mistake.
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168618 91177308-0d34-0410-b5e6-96231b3b80d8
    eefriedman committed Nov 26, 2012
    Copy the full SHA
    f582499 View commit details
  8. Improve diagnostic on C++11 attribute specifiers that appear at wrong…

    … syntactic locations around class specifiers.
    
    This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute
    specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like 
    "expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also 
    fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected.
    
    Thanks to Richard Smith for reviewing!
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168626 91177308-0d34-0410-b5e6-96231b3b80d8
    Michael Han authored and Michael Han committed Nov 26, 2012
    Copy the full SHA
    2e39713 View commit details

Commits on Nov 27, 2012

  1. Frontend: Create a virtual file for named pipe inputs.

     - This ensures we see the right buffer size for the file.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168636 91177308-0d34-0410-b5e6-96231b3b80d8
    ddunbar committed Nov 27, 2012
    Copy the full SHA
    acf3612 View commit details
  2. Move Clang code owners list from llvm/ to cfe/.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168639 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Nov 27, 2012
    Copy the full SHA
    f18dd8e View commit details
  3. Duplicate some common owners between Clang and LLVM.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168650 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Nov 27, 2012
    Copy the full SHA
    4b98b2b View commit details
  4. Revert r168411 for now.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168667 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 27, 2012
    Copy the full SHA
    8272be5 View commit details
  5. Add a testcase that r168411 would break.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168669 91177308-0d34-0410-b5e6-96231b3b80d8
    espindola committed Nov 27, 2012
    Copy the full SHA
    ec351f1 View commit details
  6. [analyzer] Fix test to work on non-LP64 systems.

    Thanks for the original catch in r168303, Takumi.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168671 91177308-0d34-0410-b5e6-96231b3b80d8
    jrose-apple committed Nov 27, 2012
    Copy the full SHA
    6e99f9f View commit details
  7. Copy the full SHA
    3fa3c44 View commit details
  8. This patch addresses an incompatibility relative to the 64-bit PowerPC

    ELF ABI.
    
    Complex values are to be passed in registers as though the real and
    imaginary parts were passed as separate parameters.  Prior to this
    patch, complex values were passed as byval aggregates.  It turns out
    that specifying getDirect() for all complex types when classifying the
    argument type results in the desired behavior.
    
    The new Clang test case verifies that the correct LLVM IR is generated
    for caller and callee for each of the underlying types for _Complex.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168673 91177308-0d34-0410-b5e6-96231b3b80d8
    wschmidt-ibm committed Nov 27, 2012
    Copy the full SHA
    c9715fc View commit details
  9. Copy the full SHA
    6902e41 View commit details
  10. Test for r168674.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168675 91177308-0d34-0410-b5e6-96231b3b80d8
    eefriedman committed Nov 27, 2012
    Copy the full SHA
    55f6c33 View commit details
  11. clang/test/lit.cfg: Disable dev-fd-fs on cygwin for now.

    open("/dev/fd/1-foobar") fails with EEXIST on cygwin.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168676 91177308-0d34-0410-b5e6-96231b3b80d8
    chapuni committed Nov 27, 2012
    Copy the full SHA
    93308b9 View commit details
  12. Merge branch 'master' of http://llvm.org/git/clang

    JP Bonn committed Nov 27, 2012
    Copy the full SHA
    4c93bae View commit details
  13. Remove outdated FIXME; should have removed that in r160782

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168698 91177308-0d34-0410-b5e6-96231b3b80d8
    timurrrr committed Nov 27, 2012
    Copy the full SHA
    5e7b43e View commit details
  14. Merge branch 'master' of http://llvm.org/git/clang

    JP Bonn committed Nov 27, 2012
    Copy the full SHA
    01a9a76 View commit details
Showing with 585 additions and 781 deletions.
  1. +40 −0 CODE_OWNERS.TXT
  2. +4 −0 include/clang/AST/ASTContext.h
  3. +2 −0 include/clang/AST/ExprCXX.h
  4. +2 −1 include/clang/Basic/Builtins.def
  5. +1 −1 include/clang/Basic/DiagnosticParseKinds.td
  6. +2 −1 include/clang/Basic/Sanitizers.def
  7. +3 −2 include/clang/Basic/TargetInfo.h
  8. +0 −3 include/clang/Frontend/CodeGenOptions.def
  9. +4 −2 include/clang/Parse/Parser.h
  10. +9 −0 lib/AST/ASTContext.cpp
  11. +6 −4 lib/AST/Decl.cpp
  12. +1 −7 lib/AST/DeclBase.cpp
  13. +1 −1 lib/AST/MicrosoftMangle.cpp
  14. +1 −0 lib/Basic/TargetInfo.cpp
  15. +2 −0 lib/Basic/Targets.cpp
  16. +2 −4 lib/CodeGen/BackendUtil.cpp
  17. +5 −2 lib/CodeGen/TargetInfo.cpp
  18. +1 −1 lib/Driver/SanitizerArgs.h
  19. +1 −3 lib/Driver/ToolChains.cpp
  20. +14 −620 lib/Driver/Tools.cpp
  21. +7 −57 lib/Driver/Tools.h
  22. +5 −1 lib/Frontend/CompilerInstance.cpp
  23. +0 −2 lib/Frontend/CompilerInvocation.cpp
  24. +32 −5 lib/Parse/ParseDecl.cpp
  25. +58 −1 lib/Parse/ParseDeclCXX.cpp
  26. +8 −0 lib/Sema/SemaDecl.cpp
  27. +16 −20 lib/Sema/SemaExprCXX.cpp
  28. +1 −1 lib/Sema/SemaOverload.cpp
  29. +3 −2 lib/Sema/TreeTransform.h
  30. +1 −0 lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
  31. +2 −2 lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  32. +2 −1 lib/StaticAnalyzer/Core/MemRegion.cpp
  33. +8 −5 test/Analysis/malloc.c
  34. +5 −0 test/Analysis/misc-ps-region-store.cpp
  35. +4 −1 test/CodeGen/always-inline.c
  36. +1 −1 test/CodeGen/bounds-checking.c
  37. +182 −0 test/CodeGen/ppc64-complex-parms.c
  38. +0 −2 test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
  39. +9 −2 test/CodeGenCXX/mangle-ms.cpp
  40. +10 −6 test/Driver/bounds-checking.c
  41. +16 −2 test/Driver/darwin-sanitizer-ld.c
  42. +4 −3 test/Driver/fsanitize.c
  43. +9 −1 test/Driver/ubsan-ld.c
  44. +0 −3 test/Misc/dev-fd-fs.c
  45. +23 −0 test/Parser/cxx0x-attributes.cpp
  46. +1 −1 test/Sema/attr-used.c
  47. +11 −0 test/Sema/merge-decls.c
  48. +11 −0 test/Sema/pid_t.c
  49. +27 −0 test/SemaCXX/warn-variable-not-needed.cpp
  50. +19 −0 test/SemaTemplate/default-expr-arguments.cpp
  51. +1 −1 test/lit.cfg
  52. +4 −1 tools/libclang/CIndexCodeCompletion.cpp
  53. +2 −7 tools/scan-build/scan-build
  54. +2 −1 utils/analyzer/SATestBuild.py
40 changes: 40 additions & 0 deletions CODE_OWNERS.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
This file is a list of the people responsible for ensuring that patches for a
particular part of Clang are reviewed, either by themself or by someone else.
They are also the gatekeepers for their part of Clang, with the final word on
what goes in or not.

The list is sorted by surname and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).

N: Chandler Carruth
E: chandlerc@gmail.com
E: chandlerc@google.com
D: CMake, library layering

N: Eric Christopher
E: echristo@gmail.com
D: Debug Information, autotools/configure/make build, inline assembly

N: Doug Gregor
D: All parts of Clang not covered by someone else

N: Anton Korobeynikov
E: anton@korobeynikov.info
D: Exception handling, Windows codegen, ARM EABI

N: Ted Kremenek
D: Clang Static Analyzer

N: John McCall
E: rjmccall@apple.com
D: Clang LLVM IR generation

N: Chad Rosier
E: mcrosier@apple.com
D: MS-inline asm, and the compiler driver

N: Richard Smith
E: richard@metafoo.co.uk
D: Clang Semantic Analysis (tools/clang/lib/Sema/* tools/clang/include/clang/Sema/*)
4 changes: 4 additions & 0 deletions include/clang/AST/ASTContext.h
Original file line number Diff line number Diff line change
@@ -1109,6 +1109,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
/// <stddef.h>. Pointer - pointer requires this (C99 6.5.6p9).
QualType getPointerDiffType() const;

/// \brief Return the unique type for "pid_t" defined in
/// <sys/types.h>. We need this to compute the correct type for vfork().
QualType getProcessIDType() const;

/// \brief Return the C structure type used to represent constant CFStrings.
QualType getCFConstantStringType() const;

2 changes: 2 additions & 0 deletions include/clang/AST/ExprCXX.h
Original file line number Diff line number Diff line change
@@ -795,6 +795,8 @@ class CXXDefaultArgExpr : public Expr {
return SourceRange();
}

SourceLocation getExprLoc() const LLVM_READONLY { return Loc; }

static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXDefaultArgExprClass;
}
3 changes: 2 additions & 1 deletion include/clang/Basic/Builtins.def
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
// J -> jmp_buf
// SJ -> sigjmp_buf
// K -> ucontext_t
// p -> pid_t
// . -> "...". This may only occur at the end of the function list.
//
// Types may be prefixed with the following modifiers:
@@ -737,7 +738,7 @@ LIBBUILTIN(strcasecmp, "icC*cC*", "f", "strings.h", ALL_LANGUAGES)
LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_LANGUAGES)
// POSIX unistd.h
LIBBUILTIN(_exit, "vi", "fr", "unistd.h", ALL_LANGUAGES)
LIBBUILTIN(vfork, "i", "fj", "unistd.h", ALL_LANGUAGES)
LIBBUILTIN(vfork, "p", "fj", "unistd.h", ALL_LANGUAGES)
// POSIX setjmp.h

// In some systems setjmp is a macro that expands to _setjmp. We undefine
2 changes: 1 addition & 1 deletion include/clang/Basic/DiagnosticParseKinds.td
Original file line number Diff line number Diff line change
@@ -768,7 +768,7 @@ let CategoryName = "Modules Issue" in {
def err_module_expected_ident : Error<
"expected a module name after module import">;
def err_module_expected_semi : Error<
"expected a semicolon name after module name">;
"expected ';' after module name">;
}

} // end of Parser diagnostics
3 changes: 2 additions & 1 deletion include/clang/Basic/Sanitizers.def
Original file line number Diff line number Diff line change
@@ -56,14 +56,15 @@ SANITIZER("null", Null)
SANITIZER("vptr", Vptr)
SANITIZER("object-size", ObjectSize)
SANITIZER("float-cast-overflow", FloatCastOverflow)
SANITIZER("bounds", Bounds)

// -fsanitize=undefined (and its alias -fcatch-undefined-behavior). This should
// include all the sanitizers which have low overhead, no ABI or address space
// layout implications, and only catch undefined behavior.
SANITIZER_GROUP("undefined", Undefined,
SignedIntegerOverflow | DivideByZero | Shift | Unreachable |
Return | VLABound | Alignment | Null | Vptr | ObjectSize |
FloatCastOverflow)
FloatCastOverflow | Bounds)

#undef SANITIZER
#undef SANITIZER_GROUP
5 changes: 3 additions & 2 deletions include/clang/Basic/TargetInfo.h
Original file line number Diff line number Diff line change
@@ -172,7 +172,8 @@ class TargetInfo : public RefCountedBase<TargetInfo> {

protected:
IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType,
WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType;
WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType,
ProcessIDType;

/// \brief Whether Objective-C's built-in boolean type should be signed char.
///
@@ -213,7 +214,7 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
IntType getChar32Type() const { return Char32Type; }
IntType getInt64Type() const { return Int64Type; }
IntType getSigAtomicType() const { return SigAtomicType; }

IntType getProcessIDType() const { return ProcessIDType; }

/// \brief Return the width (in bits) of the specified integer type enum.
///
3 changes: 0 additions & 3 deletions include/clang/Frontend/CodeGenOptions.def
Original file line number Diff line number Diff line change
@@ -113,9 +113,6 @@ CODEGENOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information
/// or 0 if unspecified.
VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)

/// The run-time penalty for bounds checking, or 0 to disable.
VALUE_CODEGENOPT(BoundsChecking, 8, 0)

/// The lower bound for a buffer to be considered for stack protection.
VALUE_CODEGENOPT(SSPBufferSize, 32, 0)

6 changes: 4 additions & 2 deletions include/clang/Parse/Parser.h
Original file line number Diff line number Diff line change
@@ -1637,7 +1637,8 @@ class Parser : public CodeCompletionHandler {

bool ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, DeclSpecContext DSC);
AccessSpecifier AS, DeclSpecContext DSC,
ParsedAttributesWithRange &Attrs);
DeclSpecContext getDeclSpecContextFromDeclaratorContext(unsigned Context);
void ParseDeclarationSpecifiers(DeclSpec &DS,
const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
@@ -2098,7 +2099,8 @@ class Parser : public CodeCompletionHandler {
void ParseClassSpecifier(tok::TokenKind TagTokKind, SourceLocation TagLoc,
DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, bool EnteringContext,
DeclSpecContext DSC);
DeclSpecContext DSC,
ParsedAttributesWithRange &Attributes);
void ParseCXXMemberSpecification(SourceLocation StartLoc, unsigned TagType,
Decl *TagDecl);
ExprResult ParseCXXMemberInitializer(Decl *D, bool IsFunction,
9 changes: 9 additions & 0 deletions lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
@@ -3537,6 +3537,12 @@ QualType ASTContext::getPointerDiffType() const {
return getFromTargetType(Target->getPtrDiffType(0));
}

/// \brief Return the unique type for "pid_t" defined in
/// <sys/types.h>. We need this to compute the correct type for vfork().
QualType ASTContext::getProcessIDType() const {
return getFromTargetType(Target->getProcessIDType());
}

//===----------------------------------------------------------------------===//
// Type Operators
//===----------------------------------------------------------------------===//
@@ -7250,6 +7256,9 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context,
return QualType();
}
break;
case 'p':
Type = Context.getProcessIDType();
break;
}

// If there are modifiers and if we're allowed to parse them, go for it.
10 changes: 6 additions & 4 deletions lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
@@ -777,10 +777,12 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate) {
if (llvm::Optional<Visibility> Vis = Function->getExplicitVisibility())
LV.mergeVisibility(*Vis, true);
}

// Note that Sema::MergeCompatibleFunctionDecls already takes care of
// merging storage classes and visibility attributes, so we don't have to
// look at previous decls in here.

if (const FunctionDecl *Prev = Function->getPreviousDecl()) {
LinkageInfo PrevLV = getLVForDecl(Prev, OnlyTemplate);
if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
LV.mergeVisibility(PrevLV);
}

return LV;
}
8 changes: 1 addition & 7 deletions lib/AST/DeclBase.cpp
Original file line number Diff line number Diff line change
@@ -260,13 +260,7 @@ bool Decl::isUsed(bool CheckUsedAttr) const {
// Check for used attribute.
if (CheckUsedAttr && hasAttr<UsedAttr>())
return true;

// Check redeclarations for used attribute.
for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
if ((CheckUsedAttr && I->hasAttr<UsedAttr>()) || I->Used)
return true;
}


return false;
}

2 changes: 1 addition & 1 deletion lib/AST/MicrosoftMangle.cpp
Original file line number Diff line number Diff line change
@@ -453,7 +453,7 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,

if (const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(ND)) {
if (NS->isAnonymousNamespace()) {
Out << "?A";
Out << "?A@";
break;
}
}
1 change: 1 addition & 0 deletions lib/Basic/TargetInfo.cpp
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ TargetInfo::TargetInfo(const std::string &T) : TargetOpts(), Triple(T)
Char32Type = UnsignedInt;
Int64Type = SignedLongLong;
SigAtomicType = SignedInt;
ProcessIDType = SignedInt;
UseSignedCharForObjCBool = true;
UseBitFieldTypeAlignment = true;
UseZeroLengthBitfieldAlignment = false;
2 changes: 2 additions & 0 deletions lib/Basic/Targets.cpp
Original file line number Diff line number Diff line change
@@ -2079,6 +2079,7 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
setFeatureEnabled(Features, "lzcnt", true);
setFeatureEnabled(Features, "aes", true);
setFeatureEnabled(Features, "pclmul", true);
break;
case CK_BDVER2:
setFeatureEnabled(Features, "xop", true);
setFeatureEnabled(Features, "lzcnt", true);
@@ -2899,6 +2900,7 @@ class HaikuX86_32TargetInfo : public X86_32TargetInfo {
SizeType = UnsignedLong;
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
ProcessIDType = SignedLong;
this->UserLabelPrefix = "";
this->TLSSupported = false;
}
6 changes: 2 additions & 4 deletions lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
@@ -152,10 +152,9 @@ static void addObjCARCOptPass(const PassManagerBuilder &Builder, PassManagerBase
PM.add(createObjCARCOptPass());
}

static unsigned BoundsChecking;
static void addBoundsCheckingPass(const PassManagerBuilder &Builder,
PassManagerBase &PM) {
PM.add(createBoundsCheckingPass(BoundsChecking));
PM.add(createBoundsCheckingPass());
}

static void addAddressSanitizerPass(const PassManagerBuilder &Builder,
@@ -197,8 +196,7 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
addObjCARCOptPass);
}

if (CodeGenOpts.BoundsChecking > 0) {
BoundsChecking = CodeGenOpts.BoundsChecking;
if (LangOpts.SanitizeBounds) {
PMBuilder.addExtension(PassManagerBuilder::EP_ScalarOptimizerLate,
addBoundsCheckingPass);
PMBuilder.addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0,
7 changes: 5 additions & 2 deletions lib/CodeGen/TargetInfo.cpp
Original file line number Diff line number Diff line change
@@ -2777,6 +2777,9 @@ PPC64_SVR4_ABIInfo::isPromotableTypeForABI(QualType Ty) const {

ABIArgInfo
PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const {
if (Ty->isAnyComplexType())
return ABIArgInfo::getDirect();

if (isAggregateTypeForABI(Ty)) {
// Records with non trivial destructors/constructors should not be passed
// by value.
@@ -3789,9 +3792,9 @@ void MSP430TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
F->addFnAttr(llvm::Attributes::NoInline);

// Step 3: Emit ISR vector alias.
unsigned Num = attr->getNumber() + 0xffe0;
unsigned Num = attr->getNumber() / 2;
new llvm::GlobalAlias(GV->getType(), llvm::Function::ExternalLinkage,
"vector_" + Twine::utohexstr(Num),
"__isr_" + Twine(Num),
GV, &M.getModule());
}
}
2 changes: 1 addition & 1 deletion lib/Driver/SanitizerArgs.h
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ class SanitizerArgs {
#include "clang/Basic/Sanitizers.def"
NeedsAsanRt = Address,
NeedsTsanRt = Thread,
NeedsUbsanRt = Undefined
NeedsUbsanRt = Undefined ^ Bounds
};
unsigned Kind;

4 changes: 1 addition & 3 deletions lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
@@ -194,13 +194,11 @@ Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA,
case Action::BindArchClass:
llvm_unreachable("Invalid tool kind.");
case Action::PreprocessJobClass:
T = new tools::darwin::Preprocess(*this); break;
case Action::AnalyzeJobClass:
case Action::MigrateJobClass:
T = new tools::Clang(*this); break;
case Action::PrecompileJobClass:
case Action::CompileJobClass:
T = new tools::darwin::Compile(*this); break;
T = new tools::Clang(*this); break;
case Action::AssembleJobClass: {
if (UseIntegratedAs)
T = new tools::ClangAs(*this);
Loading