Permalink
Browse files

Initialise subtarget features to false in constructor

ParseSubTargetFeatures can only set features to true, not false.
Any default trues have to be handled by this method to be able
to override them.
  • Loading branch information...
1 parent bbcbd8a commit 3e6400e2d9bc3b1b0708ff36f6d18a0e2c774868 @skristiansson skristiansson committed Jul 27, 2012
Showing with 8 additions and 7 deletions.
  1. +2 −1 lib/Target/LM32/LM32.td
  2. +6 −6 lib/Target/LM32/LM32Subtarget.cpp
View
3 lib/Target/LM32/LM32.td
@@ -54,7 +54,8 @@ def FeatureSPBias :
// LM32 supported processors.
//===----------------------------------------------------------------------===//
-def : Processor< "lm32", LM32Itineraries, []>;
+def : Processor< "lm32", LM32Itineraries, [FeatureDIV, FeatureMUL,
+ FeatureBarrel, FeatureSPBias]>;
//===----------------------------------------------------------------------===//
View
12 lib/Target/LM32/LM32Subtarget.cpp
@@ -26,13 +26,13 @@ using namespace llvm;
LM32Subtarget::LM32Subtarget(const std::string &TT,
const std::string &CPU,
const std::string &FS)
- : LM32GenSubtargetInfo(TT, CPU, FS)
+ : LM32GenSubtargetInfo(TT, CPU, FS),
+ HasSDIV(false),
+ HasDIV(false),
+ HasMUL(false),
+ HasBarrel(false),
+ HasSPBias(false)
{
- HasSDIV = false;
- HasDIV = true;
- HasMUL = true;
- HasBarrel = true;
- HasSPBias = true;
// Parse features string.
std::string CPUName = CPU;

0 comments on commit 3e6400e

Please sign in to comment.