1. Aug 31, 2012
    • Richard Trieu's avatar
      Add -Wduplicate-enum warning. Clang will emit this warning when an implicitly · 73e306e5
      Richard Trieu authored
      initiated enum constant has the same value as another enum constant.
      
      For instance:
      enum test { A, B, C = -1, D, E = 1 };
      Clang will warn that:
       A and D both have value 0
       B and E both have value 1
      
      A few exceptions are made to keep the noise down.  Enum constants which are
      initialized to another enum constant, or an enum constant plus or minus 1 will
      not trigger this warning.  Also, anonymous enums are not checked.
      
      llvm-svn: 162938
      73e306e5
    • Douglas Gregor's avatar
      Extend the "__is_pod" hack, which demotes various type trait keywords · 8bea83a8
      Douglas Gregor authored
      (__is_pod, __is_signed, etc.) to normal identifiers if they are
      encountered in certain places in the grammar where we know that prior
      versions of libstdc++ or libc++ use them, to still allow the use of
      these keywords as type traits. Fixes <rdar://problem/9836262> and PR10184.
      
      llvm-svn: 162937
      8bea83a8
    • Manuel Klimek's avatar
      Fixes a bug for binding memoized match results. · fdf98763
      Manuel Klimek authored
      Intorduces an abstraction for DynTypedNode which makes
      is impossible to create in ways that introduced the bug;
      also hides the implementation details of the template
      magic away from the user and prepares the code for adding
      QualType and TypeLoc bindings, as well as using DynTypedNode
      instead of overloads for child and ancestor matching.
      
      getNodeAs<T> was changed towards a non-pointer type, as
      we'll want QualType and TypeLoc nodes to be returned
      by value (the alternative would be to create new storage
      which is prohibitively costly if we want to use it for
      child / ancestor matching).
      
      DynTypedNode is moved into a new header ASTTypeTraits.h,
      as it is completely independent of the rest of the matcher
      infrastructure - if the need comes up, we can move it to
      a more common place.
      
      The interface for users before the introduction of the
      common storage change remains the same, minus the introduced
      bug, for which a regression test was added.
      
      llvm-svn: 162936
      fdf98763
    • Anna Zaks's avatar
      [analyzer] Do not propagate the [super init] could be nil assumption · 4818bbe3
      Anna Zaks authored
      from callee to caller.
      
      radar://12109638
      
      llvm-svn: 162935
      4818bbe3
    • Ted Kremenek's avatar
      Teach RetainCountChecker about 'pragma clang arc_cf_code_audited'. · 401ce8ed
      Ted Kremenek authored
      llvm-svn: 162934
      401ce8ed
    • Ted Kremenek's avatar
      Fix missing 'clang' in pragma example in ARC doc. · 60993a35
      Ted Kremenek authored
      llvm-svn: 162933
      60993a35
    • Ted Kremenek's avatar
      Rename 'MaxLoop' to 'maxBlockVisitOnPath' to reflect reality. We · efca7a7e
      Ted Kremenek authored
      should consider renaming the command line option as well.
      
      llvm-svn: 162932
      efca7a7e
    • Ted Kremenek's avatar
      Rename 'VisualizeEGUbi' and 'VisualizeEGDot' to 'visualizeExplodedGraphWithUbigGraph' · b8f8b357
      Ted Kremenek authored
      and 'visualizeExplodedGraphWithGraphViz' respectively.
      
      llvm-svn: 162931
      b8f8b357
    • Ted Kremenek's avatar
      6f5131f1
    • Ted Kremenek's avatar
      Store const& to AnalyzerOptions in AnalysisManager instead of copying · 8756c4a1
      Ted Kremenek authored
      individual flags.
      
      llvm-svn: 162929
      8756c4a1
    • Ted Kremenek's avatar
      Move AnalyzerOptions.h to include/clang/StaticAnalyzer. · 45c5c0aa
      Ted Kremenek authored
      llvm-svn: 162928
      45c5c0aa
    • Ted Kremenek's avatar
      Move Analyses.def to include/clang/StaticAnalyzer. · 3cc42279
      Ted Kremenek authored
      llvm-svn: 162927
      3cc42279
    • Nadav Rotem's avatar
      · ea973bda
      Nadav Rotem authored
      Currently targets that do not support selects with scalar conditions and vector operands - scalarize the code. ARM is such a target
      because it does not support CMOV of vectors. To implement this efficientlyi, we broadcast the condition bit and use a sequence of NAND-OR
      to select between the two operands. This is the same sequence we use for targets that don't have vector BLENDs (like SSE2).
      
      rdar://12201387
      
      llvm-svn: 162926
      ea973bda
    • Howard Hinnant's avatar
      Change sleep_for, sleep_until, and the condition_variable timed wait · aad745a0
      Howard Hinnant authored
      functions to protect against duration and time_point overflow.  Since
      we're about to wait anyway, we can afford to spend a few more cycles on
      this checking.  I purposefully did not treat the timed try_locks with
      overflow checking.  This fixes
      http://llvm.org/bugs/show_bug.cgi?id=13721 .  I'm unsure if the standard
      needs clarification in this area, or if this is simply QOI.  The
      <chrono> facilities were never intended to overflow check, but just to
      not overflow if durations stayed within +/- 292 years.
      
      llvm-svn: 162925
      aad745a0
    • Enrico Granata's avatar
      b7188a2d
    • Fariborz Jahanian's avatar
      objective-C: clang must implicitly convert · f2578574
      Fariborz Jahanian authored
      __objc_yes/__objc_no to (BOOL)1/(BOOL)0 when
      BOOL is declared; otherwise it resorts to
      default of 'signed char'. This is important to
      selecting the correct Numeric API numberWithBool:
      Can't have a clang test for this. Will checkin and
      executable llvm test. // rdar://12156616
      
      llvm-svn: 162922
      f2578574
    • Greg Clayton's avatar
      OptionValueFileSpec had an accessor to read the contents of the file and... · 0b0b512f
      Greg Clayton authored
      OptionValueFileSpec had an accessor to read the contents of the file and return the data. This can end up being used to get the string contents of a text file and could end up not being NULL terminated. I added accessors to get the file contents raw, or with a null terminator. Added the needed calls to make this happen in the FileSpec and File classes.
      
      llvm-svn: 162921
      0b0b512f
    • Chad Rosier's avatar
      [ms-inline asm] Add a new function, GetMCInstOperandNum, to the · 738ea259
      Chad Rosier authored
      AsmMatcherEmitter.  This function maps inline assembly operands to MCInst
      operands.
      
      For example, '__asm mov j, eax' is represented by the follow MCInst:
      
      <MCInst 1460 <MCOperand Reg:0> <MCOperand Imm:1> <MCOperand Reg:0> 
                   <MCOperand Expr:(j)> <MCOperand Reg:0> <MCOperand Reg:43>>
      
      The first 5 MCInst operands are a result of j matching as a memory operand
      consisting of a BaseReg (Reg:0), MemScale (Imm:1), MemIndexReg(Reg:0), 
      Expr (Expr:(j), and a MemSegReg (Reg:0).  The 6th MCInst operand represents
      the eax register (Reg:43).
      
      This translation is necessary to determine the Input and Output Exprs.  If a
      single asm operand maps to multiple MCInst operands, the index of the first
      MCInst operand is returned.  Ideally, it would return the operand we really
      care out (i.e., the Expr:(j) in this case), but I haven't found an easy way
      of doing this yet.
      
      llvm-svn: 162920
      738ea259
    • Michael Liao's avatar
      Introduce 'UseSSEx' to force SSE legacy encoding · bbd10792
      Michael Liao authored
      - Add 'UseSSEx' to force SSE legacy insn not being selected when AVX is
        enabled.
      
        As the penalty of inter-mixing SSE and AVX instructions, we need
        prevent SSE legacy insn from being generated except explicitly
        specified through some intrinsics. For patterns supported by both
        SSE and AVX, so far, we force AVX insn will be tried first relying on
        AddedComplexity or position in td file. It's error-prone and
        introduces bugs accidentally.
      
        'UseSSEx' is disabled when AVX is turned on. For SSE insns inherited
        by AVX, we need this predicate to force VEX encoding or SSE legacy
        encoding only.
      
        For insns not inherited by AVX, we still use the previous predicates,
        i.e. 'HasSSEx'. So far, these insns fall into the following
        categories:
        * SSE insns with MMX operands
        * SSE insns with GPR/MEM operands only (xFENCE, PREFETCH, CLFLUSH,
          CRC, and etc.)
        * SSE4A insns.
        * MMX insns.
        * x87 insns added by SSE.
      
      2 test cases are modified:
      
       - test/CodeGen/X86/fast-isel-x86-64.ll
         AVX code generation is different from SSE one. 'vcvtsi2sdq' cannot be
         selected by fast-isel due to complicated pattern and fast-isel
         fallback to materialize it from constant pool.
      
       - test/CodeGen/X86/widen_load-1.ll
         AVX code generation is different from SSE one after fixing SSE/AVX
         inter-mixing. Exec-domain fixing prefers 'vmovapd' instead of
         'vmovaps'.
      
      llvm-svn: 162919
      bbd10792
    • NAKAMURA Takumi's avatar
    • NAKAMURA Takumi's avatar
      Apply "/Og-" also to MSC15(aka VS9) on VMCore/Function.cpp. · fa814380
      NAKAMURA Takumi authored
      llvm-svn: 162917
      fa814380
  2. Aug 30, 2012