Skip to content
Snippets Groups Projects
  1. Aug 05, 2015
  2. Aug 03, 2015
  3. Jul 28, 2015
  4. Jul 09, 2015
    • Diego Novillo's avatar
      Add GCC-compatible flags -fprofile-generate and -fprofile-use. · 9b5c02e4
      Diego Novillo authored
      This patch adds support for specifying where the profile is emitted in a
      way similar to GCC. These flags are used to specify directories instead
      of filenames. When -fprofile-generate=DIR is used, the compiler will
      generate code to write to <DIR>/default.profraw.
      
      The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be
      used to override the directory and file name to use and -fprofile-use
      accepts both directories and filenames.
      
      To simplify the set of flags used in the backend, all the flags get
      canonicalized to -fprofile-instr-{generate,use} when passed to the
      backend. The decision to use a default name for the profile is done
      in the driver.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241825 91177308-0d34-0410-b5e6-96231b3b80d8
      9b5c02e4
  5. Jun 19, 2015
    • Alexey Samsonov's avatar
      [CFI] Require -flto instead of implying it. · 340eaaf2
      Alexey Samsonov authored
      Summary:
      This is unfortunate, but would let us land http://reviews.llvm.org/D10467,
      that makes ToolChains responsible for computing the set of sanitizers
      they support.
      
      Unfortunately, Darwin ToolChains doesn't know about actual OS they
      target until ToolChain::TranslateArgs() is called. In particular, it
      means we won't be able to construct SanitizerArgs for these ToolChains
      before that.
      
      This change removes SanitizerArgs::needsLTO() method, so that now
      ToolChain::IsUsingLTO(), which is called very early, doesn't need
      SanitizerArgs to implement this method.
      
      Docs and test cases are updated accordingly. See
      https://llvm.org/bugs/show_bug.cgi?id=23539, which describes why we
      start all these.
      
      Test Plan: regression test suite
      
      Reviewers: pcc
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D10560
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240170 91177308-0d34-0410-b5e6-96231b3b80d8
      340eaaf2
    • Peter Collingbourne's avatar
      Implement diagnostic mode for -fsanitize=cfi*, -fsanitize=cfi-diag. · cbd703b1
      Peter Collingbourne authored
      This causes programs compiled with this flag to print a diagnostic when
      a control flow integrity check fails instead of aborting. Diagnostics are
      printed using UBSan's runtime library.
      
      The main motivation of this feature over -fsanitize=vptr is fidelity with
      the -fsanitize=cfi implementation: the diagnostics are printed under exactly
      the same conditions as those which would cause -fsanitize=cfi to abort the
      program. This means that the same restrictions apply regarding compiling
      all translation units with -fsanitize=cfi, cross-DSO virtual calls are
      forbidden, etc.
      
      Differential Revision: http://reviews.llvm.org/D10268
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240109 91177308-0d34-0410-b5e6-96231b3b80d8
      cbd703b1
    • Peter Collingbourne's avatar
      Introduce -fsanitize-trap= flag. · e530af8e
      Peter Collingbourne authored
      This flag controls whether a given sanitizer traps upon detecting
      an error. It currently only supports UBSan. The existing flag
      -fsanitize-undefined-trap-on-error has been made an alias of
      -fsanitize-trap=undefined.
      
      This change also cleans up some awkward behavior around the combination
      of -fsanitize-trap=undefined and -fsanitize=undefined. Previously we
      would reject command lines containing the combination of these two flags,
      as -fsanitize=vptr is not compatible with trapping. This required the
      creation of -fsanitize=undefined-trap, which excluded -fsanitize=vptr
      (and -fsanitize=function, but this seems like an oversight).
      
      Now, -fsanitize=undefined is an alias for -fsanitize=undefined-trap,
      and if -fsanitize-trap=undefined is specified, we treat -fsanitize=vptr
      as an "unsupported" flag, which means that we error out if the flag is
      specified explicitly, but implicitly disable it if the flag was implied
      by -fsanitize=undefined.
      
      Differential Revision: http://reviews.llvm.org/D10464
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240105 91177308-0d34-0410-b5e6-96231b3b80d8
      e530af8e
  6. Jun 15, 2015
    • Peter Collingbourne's avatar
      Protection against stack-based memory corruption errors using SafeStack: Clang... · 4d2986d8
      Peter Collingbourne authored
      Protection against stack-based memory corruption errors using SafeStack: Clang command line option and function attribute
      
      This patch adds the -fsanitize=safe-stack command line argument for clang,
      which enables the Safe Stack protection (see http://reviews.llvm.org/D6094
      for the detailed description of the Safe Stack).
      
      This patch is our implementation of the safe stack on top of Clang. The
      patches make the following changes:
      
      - Add -fsanitize=safe-stack and -fno-sanitize=safe-stack options to clang
        to control safe stack usage (the safe stack is disabled by default).
      
      - Add __attribute__((no_sanitize("safe-stack"))) attribute to clang that can be
        used to disable the safe stack for individual functions even when enabled
        globally.
      
      Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
      Lab at EPFL; updates and upstreaming by myself.
      
      Differential Revision: http://reviews.llvm.org/D6095
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239762 91177308-0d34-0410-b5e6-96231b3b80d8
      4d2986d8
  7. May 28, 2015
  8. May 22, 2015
  9. May 15, 2015
  10. May 08, 2015
  11. Apr 27, 2015
  12. Apr 02, 2015
  13. Mar 20, 2015
  14. Mar 14, 2015
  15. Mar 09, 2015
  16. Mar 05, 2015
  17. Mar 03, 2015
    • Alexey Samsonov's avatar
      [UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent. · 6cb698a5
      Alexey Samsonov authored
      -fsanitize=shift is now a group that includes both these checks, so
      exisiting users should not be affected.
      
      This change introduces two new UBSan kinds that sanitize only left-hand
      side and right-hand side of shift operation. In practice, invalid
      exponent value (negative or too large) tends to cause more portability
      problems, including inconsistencies between different compilers, crashes
      and inadequeate results on non-x86 architectures etc. That is,
      -fsanitize=shift-exponent failures should generally be addressed first.
      
      As a bonus, this change simplifies CodeGen implementation for emitting left
      shift (separate checks for base and exponent are now merged by the
      existing generic logic in EmitCheck()), and LLVM IR for these checks
      (the number of basic blocks is reduced).
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231150 91177308-0d34-0410-b5e6-96231b3b80d8
      6cb698a5
  18. Feb 26, 2015
  19. Feb 20, 2015
  20. Feb 11, 2015
  21. Jan 12, 2015
    • Alexey Samsonov's avatar
      Reimplement -fsanitize-recover family of flags. · e6c5c3f4
      Alexey Samsonov authored
      Introduce the following -fsanitize-recover flags:
        - -fsanitize-recover=<list>: Enable recovery for selected checks or
            group of checks. It is forbidden to explicitly list unrecoverable
            sanitizers here (that is, "address", "unreachable", "return").
        - -fno-sanitize-recover=<list>: Disable recovery for selected checks or
           group of checks.
        - -f(no-)?sanitize-recover is now a synonym for
          -f(no-)?sanitize-recover=undefined,integer and will soon be deprecated.
      
      These flags are parsed left to right, and mask of "recoverable"
      sanitizer is updated accordingly, much like what we do for -fsanitize= flags.
      -fsanitize= and -fsanitize-recover= flag families are independent.
      
      CodeGen change: If there is a single UBSan handler function, responsible
      for implementing multiple checks, which have different recoverable setting,
      then we emit two handler calls instead of one:
      the first one for the set of "unrecoverable" checks, another one - for
      set of "recoverable" checks. If all checks implemented by a handler have the
      same recoverability setting, then the generated code will be the same.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225719 91177308-0d34-0410-b5e6-96231b3b80d8
      e6c5c3f4
  22. Oct 21, 2014
  23. Sep 18, 2014
    • Nico Weber's avatar
      Change -Wbind-to-temporary-copy from an ExtWarn to an Extension. · 3bdb38bf
      Nico Weber authored
      The reasoning is that this construct is accepted by all compilers and valid in
      C++11, so it doesn't seem like a useful warning to have enabled by default.
      Building with -pedantic, -Wbind-to-temporary-copy, or -Wc++98-compat still
      shows the warning.
      
      The motivation is that I built re2, and this was the only warning that was
      emitted during the build. Both changing re2 to fix the warning and detecting
      clang and suppressing the warning in re2's build seem inferior than just giving
      the compiler a good default for this warning.
      
      Also move the cxx98compat version of this warning to CXX98CompatPedantic, and
      update tests accordingly.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218008 91177308-0d34-0410-b5e6-96231b3b80d8
      3bdb38bf
  24. Sep 08, 2014
    • Alexey Samsonov's avatar
      Implement nonnull-attribute sanitizer · 565e4df1
      Alexey Samsonov authored
      Summary:
      This patch implements a new UBSan check, which verifies
      that function arguments declared to be nonnull with __attribute__((nonnull))
      are actually nonnull in runtime.
      
      To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
      (where applicable) and if function declaration has nonnull attribute specified
      for a certain formal parameter, we compare the corresponding RValue to null as
      soon as it's calculated.
      
      Test Plan: regression test suite
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: cfe-commits, rnk
      
      Differential Revision: http://reviews.llvm.org/D5082
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217389 91177308-0d34-0410-b5e6-96231b3b80d8
      565e4df1
  25. Aug 13, 2014
  26. Aug 05, 2014
  27. Aug 04, 2014
  28. Jul 11, 2014
  29. Jun 24, 2014
    • Diego Novillo's avatar
      Add new debug kind LocTrackingOnly. · e8e39804
      Diego Novillo authored
      Summary:
      This new debug emission kind supports emitting line location
      information in all instructions, but stops code generation
      from emitting debug info to the final output.
      
      This mode is useful when the backend wants to track source
      locations during code generation, but it does not want to
      produce debug info. This is currently used by optimization
      remarks (-Rpass, -Rpass-missed and -Rpass-analysis).
      
      When one of the -Rpass flags is used, the front end will enable
      location tracking, only if no other debug option is enabled.
      
      To prevent debug information from being generated, a new debug
      info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to
      not emit the llvm.dbg.cu annotation. This blocks final code generation
      from generating debug info in the back end.
      
      Depends on D4234.
      
      Reviewers: echristo, dblaikie
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D4235
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211610 91177308-0d34-0410-b5e6-96231b3b80d8
      e8e39804
  30. Jun 17, 2014
  31. Jun 14, 2014
  32. Jun 13, 2014
  33. May 29, 2014
  34. Apr 23, 2014
Loading